From 4596d8326f5494876b0b550cc489cbcf44e7add4 Mon Sep 17 00:00:00 2001 From: Jose Tomas Robles Hahn Date: Fri, 3 Feb 2023 18:29:14 -0300 Subject: [PATCH 1/5] chore: Install Python package 'types-pyOpenSSL' > This is a PEP 561 type stub package for the `pyOpenSSL` package. > It can be used by type-checking tools like mypy, pyright, pytype, > PyCharm, etc. to check code that uses `pyOpenSSL`. - Web site: https://github.com/python/typeshed/ - VCS: https://github.com/python/typeshed.git - Documentation: https://github.com/python/typeshed/blob/af2ce282d57cb33857eaa8bfbee947081aa84671/README.md - Python Package Index: https://pypi.org/project/types-pyOpenSSL/ --- requirements-dev.in | 1 + requirements-dev.txt | 3 +++ 2 files changed, 4 insertions(+) diff --git a/requirements-dev.in b/requirements-dev.in index 309c799f..20618b5f 100644 --- a/requirements-dev.in +++ b/requirements-dev.in @@ -13,5 +13,6 @@ isort==5.10.1 mypy==0.991 tox==3.25.1 twine==3.1.1 +types-pyOpenSSL==23.0.0.2 types-pytz==2022.7.1.0 wheel==0.38.4 diff --git a/requirements-dev.txt b/requirements-dev.txt index 08f2590a..544e5a94 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -34,6 +34,7 @@ cryptography==38.0.4 # via # -c requirements.txt # secretstorage + # types-pyopenssl distlib==0.3.6 # via virtualenv docutils==0.19 @@ -129,6 +130,8 @@ typed-ast==1.5.4 # via # black # mypy +types-pyopenssl==23.0.0.2 + # via -r requirements-dev.in types-pytz==2022.7.1.0 # via -r requirements-dev.in typing-extensions==4.3.0 From 2f5341ab368a16ffe5351d3776a00f54071fad2b Mon Sep 17 00:00:00 2001 From: Jose Tomas Robles Hahn Date: Fri, 3 Feb 2023 18:30:10 -0300 Subject: [PATCH 2/5] chore: Enable type checking for `OpenSSL` - Update Mypy configuration. - Fix errors reported by Mypy. --- cl_sii/libs/xml_utils.py | 2 +- mypy.ini | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/cl_sii/libs/xml_utils.py b/cl_sii/libs/xml_utils.py index 49ec992a..f0728b4f 100644 --- a/cl_sii/libs/xml_utils.py +++ b/cl_sii/libs/xml_utils.py @@ -362,7 +362,7 @@ def write_xml_doc(xml_doc: XmlElement, output: IO[bytes]) -> None: def verify_xml_signature( xml_doc: XmlElement, - trusted_x509_cert: Union[crypto_utils.X509Cert, crypto_utils._X509CertOpenSsl] = None, + trusted_x509_cert: Optional[Union[crypto_utils.X509Cert, crypto_utils._X509CertOpenSsl]] = None, xml_verifier: Optional[signxml.XMLVerifier] = None, xml_verifier_supports_multiple_signatures: bool = False, ) -> Tuple[bytes, XmlElementTree, XmlElementTree]: diff --git a/mypy.ini b/mypy.ini index 2c1793c2..c8aa6d95 100644 --- a/mypy.ini +++ b/mypy.ini @@ -37,9 +37,6 @@ ignore_missing_imports = True [mypy-marshmallow.*] ignore_missing_imports = True -[mypy-OpenSSL.*] -ignore_missing_imports = True - [mypy-rest_framework.*] ignore_missing_imports = True From 2c165ef1fcbd5f83d84b256f72c90f801db2a13f Mon Sep 17 00:00:00 2001 From: Jose Tomas Robles Hahn Date: Fri, 3 Feb 2023 18:32:05 -0300 Subject: [PATCH 3/5] chore: Enable type checking for `cryptography` --- mypy.ini | 3 --- 1 file changed, 3 deletions(-) diff --git a/mypy.ini b/mypy.ini index c8aa6d95..dab896da 100644 --- a/mypy.ini +++ b/mypy.ini @@ -19,9 +19,6 @@ show_error_codes = True show_error_context = True error_summary = True -[mypy-cryptography.*] -ignore_missing_imports = True - [mypy-defusedxml.*] ignore_missing_imports = True From 197b653153b50faedfab86591bf0f7d53c844278 Mon Sep 17 00:00:00 2001 From: Jose Tomas Robles Hahn Date: Fri, 3 Feb 2023 18:33:27 -0300 Subject: [PATCH 4/5] chore: Install Python package 'types-jsonschema' > This is a PEP 561 type stub package for the `jsonschema` package. > It can be used by type-checking tools like mypy, pyright, pytype, PyCharm, etc. to check code that uses `jsonschema`. - Web site: https://github.com/python/typeshed/ - VCS: https://github.com/python/typeshed.git - Documentation: https://github.com/python/typeshed/blob/4fea314594fc21fe03af54c08d071c3621f3720e/README.md - Python Package Index: https://pypi.org/project/types-jsonschema/ --- requirements-dev.in | 1 + requirements-dev.txt | 2 ++ 2 files changed, 3 insertions(+) diff --git a/requirements-dev.in b/requirements-dev.in index 20618b5f..3f1806c9 100644 --- a/requirements-dev.in +++ b/requirements-dev.in @@ -13,6 +13,7 @@ isort==5.10.1 mypy==0.991 tox==3.25.1 twine==3.1.1 +types-jsonschema==4.17.0.3 types-pyOpenSSL==23.0.0.2 types-pytz==2022.7.1.0 wheel==0.38.4 diff --git a/requirements-dev.txt b/requirements-dev.txt index 544e5a94..41304cb3 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -130,6 +130,8 @@ typed-ast==1.5.4 # via # black # mypy +types-jsonschema==4.17.0.3 + # via -r requirements-dev.in types-pyopenssl==23.0.0.2 # via -r requirements-dev.in types-pytz==2022.7.1.0 From 636b0f41ce6e49403781b249d374bc169107bf9f Mon Sep 17 00:00:00 2001 From: Jose Tomas Robles Hahn Date: Fri, 3 Feb 2023 18:35:27 -0300 Subject: [PATCH 5/5] chore: Enable type checking for `jsonschema` --- mypy.ini | 3 --- 1 file changed, 3 deletions(-) diff --git a/mypy.ini b/mypy.ini index dab896da..d5a433e6 100644 --- a/mypy.ini +++ b/mypy.ini @@ -25,9 +25,6 @@ ignore_missing_imports = True [mypy-django.*] ignore_missing_imports = True -[mypy-jsonschema] -ignore_missing_imports = True - [mypy-lxml.*] ignore_missing_imports = True