diff --git a/.github/workflows/pypi-test.yml b/.github/workflows/pypi-test.yml index 347da4c..b12b947 100644 --- a/.github/workflows/pypi-test.yml +++ b/.github/workflows/pypi-test.yml @@ -24,11 +24,8 @@ jobs: python-version: '3.11' cache: 'poetry' - - name: Install local project - run: make init - - name: Package project - run: poetry build + run: make build - name: Store the distribution uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4 diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml index 3c4084e..e58832a 100644 --- a/.github/workflows/pypi.yml +++ b/.github/workflows/pypi.yml @@ -25,11 +25,8 @@ jobs: python-version: '3.11' cache: 'poetry' - - name: Install local project - run: make init - - name: Package project - run: poetry build + run: make build - name: Store the distribution uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index aa34eac..fd9612c 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -30,9 +30,6 @@ jobs: python-version: ${{ matrix.pyversion }} cache: 'poetry' - - name: Install local project - run: make init - - name: Unit tests run: make test-unit diff --git a/Makefile b/Makefile index 916d946..9a85b76 100644 --- a/Makefile +++ b/Makefile @@ -18,6 +18,12 @@ init: ## Bootstrap for local development poetry install poetry run pre-commit install +# Build + +.PHONY: build +build: init schemas # Build package + rm -rf dist + poetry build -vvv # Tests @@ -25,7 +31,7 @@ init: ## Bootstrap for local development test: init test-unit test-e2e ## Launch all the test tasks (unit, end-to-end) .PHONY: test-unit -test-unit: schemas-xsd ## Launch unit tests +test-unit: build ## Launch unit tests poetry run pytest --cov $(PYTEST_ARGS) .PHONY: test-e2e @@ -55,10 +61,9 @@ test-e2e-case: .PHONY: prepare-test-env -prepare-test-env: schemas-xsd +prepare-test-env: build @echo -e "$(YELLOW)Preparting tests$(NO_COLOR)" - rm -rf $(TEST_ENV_DIR) dist - poetry build + rm -rf $(TEST_ENV_DIR) poetry run virtualenv $(TEST_ENV_DIR) $(TEST_ENV_DIR)/bin/pip install dist/*.whl rm -rf $(TEST_OUTPUT_DIR) @@ -79,11 +84,11 @@ cli/src/dac7/schemas/%.xsd: schemas/xml/%.xsd .PHONY: schemas-json schemas-json: - $(DAC7_CMD) schemas json2xml > schemas/json/DPIXML_v1.1-fr1.json - $(DAC7_CMD) schemas build platform-operator > schemas/json/partial/platform_operator.json - $(DAC7_CMD) schemas build other-platform-operators > schemas/json/partial/other_platform_operators.json - $(DAC7_CMD) schemas build entity-sellers > schemas/json/partial/entity_sellers.json - $(DAC7_CMD) schemas build individual-sellers > schemas/json/partial/individual_sellers.json + poetry run dac7 schemas json2xml > schemas/json/DPIXML_v1.1-fr1.json + poetry run dac7 schemas build platform-operator > schemas/json/partial/platform_operator.json + poetry run dac7 schemas build other-platform-operators > schemas/json/partial/other_platform_operators.json + poetry run dac7 schemas build entity-sellers > schemas/json/partial/entity_sellers.json + poetry run dac7 schemas build individual-sellers > schemas/json/partial/individual_sellers.json # Implements this pattern for autodocumenting Makefiles: # https://marmelab.com/blog/2016/02/29/auto-documented-makefile.html diff --git a/poetry.lock b/poetry.lock index ae0074b..5ae41ae 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 1.8.3 and should not be changed by hand. +# This file is automatically @generated by Poetry 1.8.5 and should not be changed by hand. [[package]] name = "annotated-types" diff --git a/schemas/json/DPIXML_v1.1-fr1.json b/schemas/json/DPIXML_v1.1-fr1.json index 86c037e..10009eb 100644 --- a/schemas/json/DPIXML_v1.1-fr1.json +++ b/schemas/json/DPIXML_v1.1-fr1.json @@ -990,25 +990,16 @@ "properties": { "dpi:TransmittingCountry": { "const": "FR", - "enum": [ - "FR" - ], "title": "Dpi:Transmittingcountry", "type": "string" }, "dpi:ReceivingCountry": { "const": "FR", - "enum": [ - "FR" - ], "title": "Dpi:Receivingcountry", "type": "string" }, "dpi:MessageType": { "const": "DPI", - "enum": [ - "DPI" - ], "title": "Dpi:Messagetype", "type": "string" }, @@ -1693,25 +1684,16 @@ "properties": { "@xmlns:dpi": { "const": "urn:oecd:ties:dpi", - "enum": [ - "urn:oecd:ties:dpi" - ], "title": "@Xmlns:Dpi", "type": "string" }, "@xmlns:stf": { "const": "urn:oecd:ties:dpistf", - "enum": [ - "urn:oecd:ties:dpistf" - ], "title": "@Xmlns:Stf", "type": "string" }, "@version": { "const": "1.0", - "enum": [ - "1.0" - ], "title": "@Version", "type": "string" },