From d9b8cbb0e5e8745dcaa80e54345e6f5c0b459519 Mon Sep 17 00:00:00 2001 From: Mauko Quiroga Date: Fri, 1 Oct 2021 19:14:05 +0200 Subject: [PATCH 1/3] Add test-built task --- tasks/publish.mk | 2 ++ tasks/test_code.mk | 26 ++++++++++++++++++++++---- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/tasks/publish.mk b/tasks/publish.mk index 55c48200a9..7f868cf3b9 100644 --- a/tasks/publish.mk +++ b/tasks/publish.mk @@ -24,4 +24,6 @@ build: ## Upload openfisca-core package to PyPi. publish: + @$(call print_help,$@:) @twine upload dist/* --username $${PYPI_USERNAME} --password $${PYPI_PASSWORD} + @$(call print_pass,$@:) diff --git a/tasks/test_code.mk b/tasks/test_code.mk index 13d88df4d6..03641ac77f 100644 --- a/tasks/test_code.mk +++ b/tasks/test_code.mk @@ -1,3 +1,6 @@ +## The path to the installed packages. +python_packages = $(shell python -c "import sysconfig; print(sysconfig.get_paths()[\"purelib\"])") + ## Run openfisca-core. test-code: test-core @## Usage: @@ -13,9 +16,24 @@ test-code: test-core @$(call print_pass,$@:) ## Run openfisca-core tests. -test-core: $(shell git ls-files "tests/*.py") +test-core: + @$(call print_help,$@:) + @PYTEST_ADDOPTS="\ + ${PYTEST_ADDOPTS} \ + --cov=src \ + ${pytest_args} \ + " \ + openfisca test $(shell find tests -name "*.py") ${openfisca_args} + @$(call print_pass,$@:) + +## Run openfisca-core tests against the built version. +test-built: @$(call print_help,$@:) - @PYTEST_ADDOPTS="${PYTEST_ADDOPTS} --cov=src ${pytest_args}" \ - openfisca test $? \ - ${openfisca_args} + @PYTEST_ADDOPTS=" \ + ${PYTEST_ADDOPTS} \ + --cov=${python_packages}/openfisca_core \ + --cov=${python_packages}/openfisca_web_api \ + ${pytest_args} \ + " \ + openfisca test $(shell find tests -name "*.py") ${openfisca_args} @$(call print_pass,$@:) From 7beeb3b092cc0291f7ccacc53c75615d1d45db65 Mon Sep 17 00:00:00 2001 From: Mauko Quiroga Date: Fri, 1 Oct 2021 19:14:31 +0200 Subject: [PATCH 2/3] Adapt circleci --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 00a2995b34..935ad0c45c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -45,7 +45,7 @@ jobs: - run: name: Run openfisca-core tests - command: make test-core pytest_args="--exitfirst" + command: make test-built pytest_args="--exitfirst" - run: name: Check NumPy typing against latest 3 minor versions From 1f4043d70e75f21d61e7df76230ab2363f5a05cc Mon Sep 17 00:00:00 2001 From: Mauko Quiroga Date: Fri, 1 Oct 2021 19:15:37 +0200 Subject: [PATCH 3/3] Bump patch to 35.5.5 --- CHANGELOG.md | 8 ++++++++ setup.cfg | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 42ea9b44f3..cc8161b00d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +### 35.5.5 [#1037](https://github.com/openfisca/openfisca-core/pull/1037) + +#### Technical changes + + - Test openfisca-core against its packaged version + - Doing so allows to prevent publishing corrupted versions + - What we test is what the user gets when installing openfisca-core + ### 35.5.4 [#1059](https://github.com/openfisca/openfisca-core/pull/1059) #### Non-technical changes diff --git a/setup.cfg b/setup.cfg index 3e9bf9b0e4..8647618d2a 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = OpenFisca-Core -version = 35.5.4 +version = 35.5.5 author = OpenFisca Team author_email = contact@openfisca.org license = https://www.fsf.org/licensing/licenses/agpl-3.0.html