diff --git a/CHANGELOG.md b/CHANGELOG.md index 4b0f3e63a..ade861023 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +### 41.5.5 [#1220](https://github.com/openfisca/openfisca-core/pull/1220) + +#### Technical changes + +- Fix doc & type definitions in the entities module + ### 41.5.4 [#1219](https://github.com/openfisca/openfisca-core/pull/1219) #### Technical changes diff --git a/openfisca_core/entities/types.py b/openfisca_core/entities/types.py index de011d8ee..2f9acd040 100644 --- a/openfisca_core/entities/types.py +++ b/openfisca_core/entities/types.py @@ -35,13 +35,8 @@ class GroupEntity(t.GroupEntity, Protocol): class Role(t.Role, Protocol): - max: int | None subroles: Iterable[Role] | None - @property - def key(self) -> str: - ... - class RoleParams(TypedDict, total=False): key: Required[str] diff --git a/openfisca_core/types.py b/openfisca_core/types.py index 8b83bff1c..b34a55543 100644 --- a/openfisca_core/types.py +++ b/openfisca_core/types.py @@ -61,8 +61,13 @@ class GroupEntity(CoreEntity, Protocol): class Role(Protocol): entity: Any + max: int | None subroles: Any + @property + def key(self) -> str: + ... + # Holders diff --git a/setup.cfg b/setup.cfg index 451f68b91..cc850c06a 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,76 +1,86 @@ -# C011X: We (progressively) document the code base. -# D10X: We (progressively) check docstrings (see https://www.pydocstyle.org/en/2.1.1/error_codes.html#grouping). -# DARXXX: We (progressively) check docstrings (see https://github.com/terrencepreilly/darglint#error-codes). -# E203: We ignore a false positive in whitespace before ":" (see https://github.com/PyCQA/pycodestyle/issues/373). -# F403/405: We ignore * imports. -# R0401: We avoid cyclic imports —required for unit/doc tests. -# RST301: We use Google Python Style (see https://pypi.org/project/flake8-rst-docstrings/). -# W503/504: We break lines before binary operators (Knuth's style). +# C011X: We (progressively) document the code base. +# D10X: We (progressively) check docstrings (see https://www.pydocstyle.org/en/2.1.1/error_codes.html#grouping). +# DARXXX: We (progressively) check docstrings (see https://github.com/terrencepreilly/darglint#error-codes). +# E203: We ignore a false positive in whitespace before ":" (see https://github.com/PyCQA/pycodestyle/issues/373). +# F403/405: We ignore * imports. +# R0401: We avoid cyclic imports —required for unit/doc tests. +# RST301: We use Google Python Style (see https://pypi.org/project/flake8-rst-docstrings/). +# W503/504: We break lines before binary operators (Knuth's style). [flake8] -convention = google -docstring_style = google -extend-ignore = D -ignore = E203, E501, F405, RST301, W503 -in-place = true -include-in-doctest = openfisca_core/commons openfisca_core/entities openfisca_core/holders openfisca_core/periods openfisca_core/projectors -max-line-length = 88 -per-file-ignores = */types.py:D101,D102,E704, */test_*.py:D101,D102,D103, */__init__.py:F401 -rst-directives = attribute, deprecated, seealso, versionadded, versionchanged -rst-roles = any, attr, class, exc, func, meth, mod, obj -strictness = short +convention = google +docstring_style = google +extend-ignore = D +ignore = E203, E501, F405, RST301, W503 +in-place = true +include-in-doctest = openfisca_core/commons openfisca_core/entities openfisca_core/holders openfisca_core/periods openfisca_core/projectors +max-line-length = 88 +per-file-ignores = */types.py:D101,D102,E704, */test_*.py:D101,D102,D103, */__init__.py:F401 +rst-directives = attribute, deprecated, seealso, versionadded, versionchanged +rst-roles = any, attr, class, exc, func, meth, mod, obj +strictness = short [pylint.MASTER] -load-plugins = pylint_per_file_ignores +load-plugins = pylint_per_file_ignores [pylint.message_control] -disable = all -enable = C0115, C0116, R0401 -per-file-ignores = +disable = all +enable = C0115, C0116, R0401 +per-file-ignores = types.py:C0115,C0116 /tests/:C0116 -score = no +score = no [isort] -case_sensitive = true +case_sensitive = true force_alphabetical_sort_within_sections = false -group_by_package = true -honor_noqa = true -include_trailing_comma = true -known_first_party = openfisca_core -known_openfisca = openfisca_country_template, openfisca_extension_template -known_typing = *collections.abc*, *typing*, *typing_extensions* -known_types = *types* -profile = black -py_version = 39 -sections = FUTURE, TYPING, TYPES, STDLIB, THIRDPARTY, OPENFISCA, FIRSTPARTY, LOCALFOLDER +group_by_package = true +honor_noqa = true +include_trailing_comma = true +known_first_party = openfisca_core +known_openfisca = openfisca_country_template, openfisca_extension_template +known_typing = *collections.abc*, *typing*, *typing_extensions* +known_types = *types* +profile = black +py_version = 39 +sections = FUTURE, TYPING, TYPES, STDLIB, THIRDPARTY, OPENFISCA, FIRSTPARTY, LOCALFOLDER [coverage:paths] -source = . */site-packages +source = . */site-packages [coverage:run] -branch = true -source = openfisca_core, openfisca_web_api +branch = true +source = openfisca_core, openfisca_web_api [coverage:report] -fail_under = 75 -show_missing = true -skip_covered = true -skip_empty = true +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 -python_files = **/*.py -testpaths = tests +addopts = --disable-pytest-warnings --doctest-modules --showlocals +doctest_optionflags = ELLIPSIS IGNORE_EXCEPTION_DETAIL NUMBER NORMALIZE_WHITESPACE +python_files = **/*.py +testpaths = tests [mypy] -disallow_any_unimported = true -ignore_missing_imports = true -install_types = true -non_interactive = true -plugins = numpy.typing.mypy_plugin -python_version = 3.9 +check_untyped_defs = false +disallow_any_decorated = false +disallow_any_explicit = false +disallow_any_expr = false +disallow_any_unimported = false +follow_imports = skip +ignore_missing_imports = true +implicit_reexport = false +install_types = true +non_interactive = true +plugins = numpy.typing.mypy_plugin +pretty = true +python_version = 3.9 +strict = false +warn_no_return = true +warn_unreachable = true [mypy-openfisca_core.*.tests.*] -ignore_errors = True +ignore_errors = True diff --git a/setup.py b/setup.py index 92971f40b..cca107bee 100644 --- a/setup.py +++ b/setup.py @@ -67,7 +67,7 @@ setup( name="OpenFisca-Core", - version="41.5.4", + version="41.5.5", author="OpenFisca Team", author_email="contact@openfisca.org", classifiers=[