diff --git a/requirements/base.txt b/requirements/base.txt index b4e6bb8e..4b7e307c 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -7,6 +7,7 @@ defusedxml==0.6.0 jsonschema==3.2.0 lxml==4.5.0 marshmallow==2.19.5 +pydantic==1.6.1 pyOpenSSL==18.0.0 pytz==2019.3 signxml==2.8.1 diff --git a/setup.cfg b/setup.cfg index 9c4a8b24..97c770b7 100644 --- a/setup.cfg +++ b/setup.cfg @@ -19,6 +19,8 @@ directory = test-reports/coverage/html [mypy] python_version = 3.7 platform = linux +plugins = + pydantic.mypy follow_imports = normal ignore_missing_imports = False @@ -62,6 +64,12 @@ ignore_missing_imports = True [mypy-pytz.*] ignore_missing_imports = True +[pydantic-mypy] +init_forbid_extra = True +init_typed = True +warn_required_dynamic_aliases = True +warn_untyped_fields = True + [flake8] ignore = # W503 line break before binary operator diff --git a/setup.py b/setup.py index f406d9a0..0e3eb46b 100644 --- a/setup.py +++ b/setup.py @@ -27,6 +27,7 @@ def get_version(*file_paths: Sequence[str]) -> str: 'jsonschema>=3.1.1', 'lxml>=4.5.0,<5', 'marshmallow>=2.19.2,<3', + 'pydantic>=1.6.1', # TODO: remove upper-bound after a new release of 'signxml' drops the requirement 'pyOpenSSL<20' 'pyOpenSSL>=18.0.0,<20', 'pytz>=2019.3',