From d2960a87e8498cfa6a8a2a0999d23cdd790bf5c9 Mon Sep 17 00:00:00 2001 From: Mauko Quiroga Date: Tue, 17 Sep 2024 01:18:28 +0200 Subject: [PATCH] chore(version): bump --- CHANGELOG.md | 6 ++ openfisca_core/entities/types.py | 23 +++--- openfisca_core/types.py | 5 ++ setup.cfg | 116 +++++++++++++++++-------------- setup.py | 2 +- 5 files changed, 84 insertions(+), 68 deletions(-) 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 5fe994a18..1269a5507 100644 --- a/openfisca_core/entities/types.py +++ b/openfisca_core/entities/types.py @@ -1,34 +1,29 @@ from __future__ import annotations from collections.abc import Iterable -from typing import Protocol, TypedDict +from typing import Protocol +from typing_extensions import TypedDict -from openfisca_core import types +from openfisca_core import types as t # Entities -class CoreEntity(types.CoreEntity, Protocol): - ... - - -class SingleEntity(types.SingleEntity, Protocol): +class CoreEntity(t.CoreEntity, Protocol): key: str plural: str | None +class SingleEntity(t.SingleEntity, Protocol): + ... + -class GroupEntity(types.GroupEntity, Protocol): +class GroupEntity(t.GroupEntity, Protocol): ... -class Role(types.Role, Protocol): - max: int | None +class Role(t.Role, Protocol): subroles: Iterable[Role] | None - @property - def key(self) -> str: - ... - class RoleParams(TypedDict, total=False): key: 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=[