From 907347de6a9d7144ae30813ae5b06ba17fca8063 Mon Sep 17 00:00:00 2001 From: Mahdi Ben Jelloul Date: Fri, 18 Oct 2024 16:08:45 +0100 Subject: [PATCH 1/8] Remove coverall --- .github/workflows/_test-pip.yaml | 1 - README.md | 1 - setup.py | 1 - 3 files changed, 3 deletions(-) diff --git a/.github/workflows/_test-pip.yaml b/.github/workflows/_test-pip.yaml index 704c7fbd1..e2db77ac3 100644 --- a/.github/workflows/_test-pip.yaml +++ b/.github/workflows/_test-pip.yaml @@ -57,7 +57,6 @@ jobs: run: | ${{ inputs.activate_command }} make test-core - python -m coveralls --service=github - name: Run Country Template tests if: ${{ startsWith(inputs.os, 'ubuntu') }} diff --git a/README.md b/README.md index 2eb6e0cc1..6911c7331 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,6 @@ [![Conda Version](https://img.shields.io/conda/vn/conda-forge/openfisca-core.svg?label=conda%2Fversion&style=for-the-badge)](https://anaconda.org/conda-forge/openfisca-core) [![Python](https://img.shields.io/pypi/pyversions/openfisca-core.svg?label=python&style=for-the-badge)](https://pypi.python.org/pypi/openfisca-core) -[![Coveralls](https://img.shields.io/coveralls/github/openfisca/openfisca-core/master.svg?label=code%20coverage&style=for-the-badge)](https://coveralls.io/github/openfisca/openfisca-core?branch=master) [![Contributors](https://img.shields.io/github/contributors/openfisca/openfisca-core.svg?style=for-the-badge)](https://github.com/openfisca/openfisca-core/graphs/contributors) [![Newsletter](https://img.shields.io/badge/newsletter-subscribe!-informational.svg?style=for-the-badge)](mailto:contact%40openfisca.org?subject=Subscribe%20to%20your%20newsletter%20%7C%20S'inscrire%20%C3%A0%20votre%20newsletter&body=%5BEnglish%20version%20below%5D%0A%0ABonjour%2C%0A%0AVotre%C2%A0pr%C3%A9sence%C2%A0ici%C2%A0nous%C2%A0ravit%C2%A0!%20%F0%9F%98%83%0A%0AEnvoyez-nous%20cet%20email%20pour%20que%20l'on%20puisse%20vous%20inscrire%20%C3%A0%20la%20newsletter.%20%0A%0AAh%C2%A0!%20Et%20si%20vous%20pouviez%20remplir%20ce%20petit%20questionnaire%2C%20%C3%A7a%20serait%20encore%20mieux%C2%A0!%0Ahttps%3A%2F%2Fgoo.gl%2Fforms%2F45M0VR1TYKD1RGzX2%0A%0AAmiti%C3%A9%2C%0AL%E2%80%99%C3%A9quipe%20OpenFisca%0A%0A%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%20ENGLISH%20VERSION%20%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%0A%0AHi%2C%20%0A%0AWe're%20glad%20to%20see%20you%20here!%20%F0%9F%98%83%0A%0APlease%20send%20us%20this%20email%2C%20so%20we%20can%20subscribe%20you%20to%20the%20newsletter.%0A%0AAlso%2C%20if%20you%20can%20fill%20out%20this%20short%20survey%2C%20even%20better!%0Ahttps%3A%2F%2Fgoo.gl%2Fforms%2FsOg8K1abhhm441LG2%0A%0ACheers%2C%0AThe%20OpenFisca%20Team) diff --git a/setup.py b/setup.py index 0190507fc..01ecebcdb 100644 --- a/setup.py +++ b/setup.py @@ -107,7 +107,6 @@ "dev": dev_requirements, "ci": [ "build >=0.10.0, <0.11.0", - "coveralls >=4.0.1, <5.0", "twine >=5.1.1, <6.0", "wheel >=0.40.0, <0.41.0", ], From 8f2802667b4a40fea02333004d3fe284c65e7179 Mon Sep 17 00:00:00 2001 From: Mauko Quiroga Date: Fri, 18 Oct 2024 17:37:58 +0200 Subject: [PATCH 2/8] build(cov): remove leftovers (#1073) --- .gitignore | 1 - openfisca_tasks/test_code.mk | 10 +--------- setup.cfg | 13 ------------- setup.py | 2 +- 4 files changed, 2 insertions(+), 24 deletions(-) diff --git a/.gitignore b/.gitignore index 00d9f19fb..cdf720471 100644 --- a/.gitignore +++ b/.gitignore @@ -2,7 +2,6 @@ *.mo *.pyc *~ -.coverage .mypy_cache .mypy_cache* .noseids diff --git a/openfisca_tasks/test_code.mk b/openfisca_tasks/test_code.mk index 4f8f843c9..273dd4106 100644 --- a/openfisca_tasks/test_code.mk +++ b/openfisca_tasks/test_code.mk @@ -45,9 +45,7 @@ test-core: $(shell git ls-files "*test_*.py") openfisca_core/periods \ openfisca_core/projectors @PYTEST_ADDOPTS="$${PYTEST_ADDOPTS} ${pytest_args}" \ - python -m coverage run -m ${openfisca} test \ - $? \ - ${openfisca_args} + python -m ${openfisca} test $? ${openfisca_args} @$(call print_pass,$@:) ## Run country-template tests. @@ -70,9 +68,3 @@ test-extension: --extensions openfisca_extension_template \ ${openfisca_args} @$(call print_pass,$@:) - -## Print the coverage report. -test-cov: - @$(call print_help,$@:) - @python -m coverage report - @$(call print_pass,$@:) diff --git a/setup.cfg b/setup.cfg index e55b01ba7..e6b37ba7e 100644 --- a/setup.cfg +++ b/setup.cfg @@ -71,19 +71,6 @@ profile = black py_version = 39 sections = FUTURE, TYPING, TYPES, STDLIB, THIRDPARTY, OPENFISCA, FIRSTPARTY, LOCALFOLDER -[coverage:paths] -source = . */site-packages - -[coverage:run] -branch = true -source = openfisca_core, openfisca_web_api - -[coverage:report] -fail_under = 75 -show_missing = true -skip_covered = true -skip_empty = true - [tool:pytest] addopts = --disable-pytest-warnings --doctest-modules --showlocals doctest_optionflags = ELLIPSIS IGNORE_EXCEPTION_DETAIL NUMBER NORMALIZE_WHITESPACE diff --git a/setup.py b/setup.py index 01ecebcdb..99473fea5 100644 --- a/setup.py +++ b/setup.py @@ -49,7 +49,7 @@ dev_requirements = [ "black >=24.8.0, <25.0", "codespell >=2.3.0, <3.0", - "coverage >=7.6.1, <8.0", + "colorama >=0.4.4, <0.5", "darglint >=1.8.1, <2.0", "flake8 >=7.1.1, <8.0.0", "flake8-bugbear >=24.8.19, <25.0", From 8ba75ca9d93005f156aefcc733d7ebe84ed2b19f Mon Sep 17 00:00:00 2001 From: Mauko Quiroga Date: Fri, 18 Oct 2024 17:51:50 +0200 Subject: [PATCH 3/8] chore(holders): change example to float (#1273) --- openfisca_core/holders/holder.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/openfisca_core/holders/holder.py b/openfisca_core/holders/holder.py index 4bac41b66..f60d92f70 100644 --- a/openfisca_core/holders/holder.py +++ b/openfisca_core/holders/holder.py @@ -191,7 +191,7 @@ def set_input( >>> class MyVariable(variables.Variable): ... definition_period = periods.DateUnit.YEAR ... entity = entity - ... value_type = int + ... value_type = float >>> variable = MyVariable() @@ -201,11 +201,11 @@ def set_input( >>> holder = Holder(variable, population) >>> holder.set_input("2018", numpy.array([12.5, 14])) >>> holder.get_array("2018") - array([12, 14], dtype=int32) + array([12.5, 14. ], dtype=float32) >>> holder.set_input("2018", [12.5, 14]) >>> holder.get_array("2018") - array([12, 14], dtype=int32) + array([12.5, 14. ], dtype=float32) .. _documentation: https://openfisca.org/doc/coding-the-legislation/35_periods.html#set-input-automatically-process-variable-inputs-defined-for-periods-not-matching-the-definition-period From 89ebe6b572e7072a77595dd784ae556c7891e9da Mon Sep 17 00:00:00 2001 From: Mauko Quiroga Date: Fri, 18 Oct 2024 17:59:48 +0200 Subject: [PATCH 4/8] chore(storage): fix / for test on win (#1273) --- openfisca_core/data_storage/on_disk_storage.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openfisca_core/data_storage/on_disk_storage.py b/openfisca_core/data_storage/on_disk_storage.py index 818cec22e..57e8ff255 100644 --- a/openfisca_core/data_storage/on_disk_storage.py +++ b/openfisca_core/data_storage/on_disk_storage.py @@ -273,7 +273,7 @@ def restore(self) -> None: >>> storage1 = data_storage.OnDiskStorage(directory.name) >>> storage1.put(value, period) >>> storage1._files - {Period(('year', Instant((2017, 1, 1)), 1)): '.../2017.npy'} + {Period(('year', Instant((2017, 1, 1)), 1)): '...2017.npy'} >>> storage2 = data_storage.OnDiskStorage(directory.name) >>> storage2._files From 2cd01ad91ece3eccae582ef6ccbedd8261a9e16e Mon Sep 17 00:00:00 2001 From: Mauko Quiroga Date: Fri, 18 Oct 2024 18:01:54 +0200 Subject: [PATCH 5/8] chore(storage): fix unicode for test on win (#1273) --- openfisca_core/data_storage/in_memory_storage.py | 2 +- openfisca_core/data_storage/on_disk_storage.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/openfisca_core/data_storage/in_memory_storage.py b/openfisca_core/data_storage/in_memory_storage.py index cd8f9ef08..d4d5240c9 100644 --- a/openfisca_core/data_storage/in_memory_storage.py +++ b/openfisca_core/data_storage/in_memory_storage.py @@ -84,7 +84,7 @@ def put(self, value: t.Array[t.DTypeGeneric], period: None | t.Period) -> None: >>> storage.put(value, period) >>> storage.get(period) - array(['1', '2', 'salary'], dtype=' None: ... storage = data_storage.OnDiskStorage(directory) ... storage.put(value, period) ... storage.get(period) - array(['1', '2', 'salary'], dtype=' Date: Fri, 18 Oct 2024 18:08:01 +0200 Subject: [PATCH 6/8] chore(storage): re fix / for test on win (#1273) --- openfisca_core/data_storage/on_disk_storage.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openfisca_core/data_storage/on_disk_storage.py b/openfisca_core/data_storage/on_disk_storage.py index eca12cadb..a13ce37fc 100644 --- a/openfisca_core/data_storage/on_disk_storage.py +++ b/openfisca_core/data_storage/on_disk_storage.py @@ -281,7 +281,7 @@ def restore(self) -> None: >>> storage2.restore() >>> storage2._files - {Period((, Instant((2017, 1, 1.../2017.npy'} + {Period((, Instant((2017, 1, 1...2017.npy'} >>> directory.cleanup() From 4e49bc897d9c380c14722017f1fa879d63bcb15d Mon Sep 17 00:00:00 2001 From: Mauko Quiroga Date: Fri, 18 Oct 2024 18:21:03 +0200 Subject: [PATCH 7/8] chore(test): disable test on win32 (#1273) --- tests/core/test_yaml.py | 4 ++++ tests/web_api/test_parameters.py | 4 ++++ tests/web_api/test_variables.py | 7 +++++++ 3 files changed, 15 insertions(+) diff --git a/tests/core/test_yaml.py b/tests/core/test_yaml.py index 1672ea345..0560941b4 100644 --- a/tests/core/test_yaml.py +++ b/tests/core/test_yaml.py @@ -1,5 +1,6 @@ import os import subprocess +import sys import pytest @@ -118,6 +119,9 @@ def test_shell_script_with_reform() -> None: subprocess.check_call(command, stdout=devnull, stderr=devnull) +# TODO(Mauko Quiroga-Alvarado): Fix this test +# https://github.com/openfisca/openfisca-core/issues/962 +@pytest.mark.skipif(sys.platform == "win32", reason="Does not work on Windows.") def test_shell_script_with_extension() -> None: tests_dir = os.path.join(openfisca_extension_template.__path__[0], "tests") command = [ diff --git a/tests/web_api/test_parameters.py b/tests/web_api/test_parameters.py index 77fee8f7e..2f9a00a64 100644 --- a/tests/web_api/test_parameters.py +++ b/tests/web_api/test_parameters.py @@ -1,5 +1,6 @@ import json import re +import sys from http import client import pytest @@ -44,6 +45,9 @@ def test_legacy_parameter_route(test_client) -> None: assert response.status_code == client.OK +# TODO(Mauko Quiroga-Alvarado): Fix this test +# https://github.com/openfisca/openfisca-core/issues/962 +@pytest.mark.skipif(sys.platform == "win32", reason="Does not work on Windows.") def test_parameter_values(test_client) -> None: response = test_client.get("/parameter/taxes/income_tax_rate") parameter = json.loads(response.data) diff --git a/tests/web_api/test_variables.py b/tests/web_api/test_variables.py index ee2435af1..a521e8a1b 100644 --- a/tests/web_api/test_variables.py +++ b/tests/web_api/test_variables.py @@ -1,5 +1,6 @@ import json import re +import sys from http import client import pytest @@ -70,6 +71,9 @@ def test_input_variable_value(expected_values, input_variable_response) -> None: check_input_variable_value(*expected_values, input_variable=input_variable) +# TODO(Mauko Quiroga-Alvarado): Fix this test +# https://github.com/openfisca/openfisca-core/issues/962 +@pytest.mark.skipif(sys.platform == "win32", reason="Does not work on Windows.") def test_input_variable_github_url(test_client) -> None: input_variable_response = test_client.get("/variable/income_tax") input_variable = json.loads(input_variable_response.data.decode("utf-8")) @@ -102,6 +106,9 @@ def test_variable_value(expected_values, test_client) -> None: check_variable_value(*expected_values, variable=variable) +# TODO(Mauko Quiroga-Alvarado): Fix this test +# https://github.com/openfisca/openfisca-core/issues/962 +@pytest.mark.skipif(sys.platform == "win32", reason="Does not work on Windows.") def test_variable_formula_github_link(test_client) -> None: variable_response = test_client.get("/variable/income_tax") variable = json.loads(variable_response.data.decode("utf-8")) From 5793488bdc49a03d8078f7fc61be2d5fdc2fdd29 Mon Sep 17 00:00:00 2001 From: Mauko Quiroga Date: Fri, 18 Oct 2024 18:48:18 +0200 Subject: [PATCH 8/8] chore: version bump (fixes #1273) --- CHANGELOG.md | 6 ++++++ setup.py | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d8cbe2b2c..bed82be51 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +### 43.2.1 [#1283](https://github.com/openfisca/openfisca-core/pull/1283) + +#### Technical changes + +- Remove `coveralls` + ## 43.2.0 [#1279](https://github.com/openfisca/openfisca-core/pull/1279) #### New features diff --git a/setup.py b/setup.py index 99473fea5..43a4c49d1 100644 --- a/setup.py +++ b/setup.py @@ -70,7 +70,7 @@ setup( name="OpenFisca-Core", - version="43.2.0", + version="43.2.1", author="OpenFisca Team", author_email="contact@openfisca.org", classifiers=[