From ca8e13a8d67dc529ea855c091dde5cda46d4fa94 Mon Sep 17 00:00:00 2001 From: Davide Brunato Date: Mon, 9 Sep 2024 11:27:19 +0200 Subject: [PATCH] Add mypy checks for xmlschema>=3.1.0 - mypy: full compliant if xmlschema>=3.1.0, some error codes with v3.0.2, more errors with older versions; - Keep test env with v2.5.1, remove older ones and add recent releases. --- setup.py | 2 +- tox.ini | 28 +++++++++++++++++----------- 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/setup.py b/setup.py index e2ade720..a0c00749 100644 --- a/setup.py +++ b/setup.py @@ -31,7 +31,7 @@ long_description=long_description, python_requires='>=3.8', extras_require={ - 'dev': ['tox', 'coverage', 'lxml', 'xmlschema>=2.2.3', 'Sphinx', + 'dev': ['tox', 'coverage', 'lxml', 'xmlschema>=3.3.2', 'Sphinx', 'memory-profiler', 'memray', 'flake8', 'mypy', 'lxml-stubs'] }, classifiers=[ diff --git a/tox.ini b/tox.ini index 58baa3d1..ef9acf49 100644 --- a/tox.ini +++ b/tox.ini @@ -8,7 +8,7 @@ min_version = 4.0 envlist = py{38,39,310,311,312,313}, pypy3, docs, flake8, mypy-py{38,39,310,311,312,py3}, pytest, coverage, - xmlschema{223,231,240,251,301,332}, w3c-xsdtests + xmlschema{251,302,310,321,332}, w3c-xsdtests skip_missing_interpreters = true work_dir = {tox_root}/../.tox/elementpath @@ -16,14 +16,14 @@ work_dir = {tox_root}/../.tox/elementpath deps = lxml lxml-stubs - xmlschema>=3.0.1 + xmlschema>=3.0.2 docs: Sphinx coverage: coverage commands = python -m unittest [testenv:py313] deps = - xmlschema>=3.0.1 + xmlschema>=3.0.2 commands = python -m unittest [testenv:docs] @@ -47,7 +47,7 @@ commands = [testenv:mypy-py{38,39,310,311,312,py3}] deps = mypy==1.11.2 - xmlschema>=3.0.1 + xmlschema>=3.1.0 lxml-stubs commands = mypy --strict elementpath @@ -65,21 +65,22 @@ deps = pytest-randomly lxml lxml-stubs - xmlschema>=3.0.1 + xmlschema>=3.0.2 commands = pytest tests -ra -[testenv:xmlschema{223,231,240,251,301,332}] +[testenv:xmlschema{251,302,310,321,332}] +description = Run xmlschema tests and mypy on xmlschema source (>=3.1.0) platform = (linux|darwin) set_env = - xmlschema223: VERSION = 2.2.3 - xmlschema231: VERSION = 2.3.1 - xmlschema240: VERSION = 2.4.0 xmlschema251: VERSION = 2.5.1 - xmlschema301: VERSION = 3.0.1 + xmlschema302: VERSION = 3.0.2 + xmlschema310: VERSION = 3.1.0 + xmlschema321: VERSION = 3.2.1 xmlschema332: VERSION = 3.3.2 change_dir = {env_tmp_dir} deps = + mypy==1.11.2 lxml lxml-stubs jinja2 @@ -87,10 +88,15 @@ deps = commands = pip download xmlschema=={env:VERSION} --no-deps --no-binary xmlschema tar xzf xmlschema-{env:VERSION}.tar.gz --strip-components=1 + bash -c 'if [[ "{env:VERSION}" > "3.0.2" ]]; then mypy --strict xmlschema; fi' python tests/test_all.py -allowlist_externals = tar + +allowlist_externals = + bash + tar [testenv:w3c-xsdtests] +description = Run W3C XSD 1.0/1.1 tests using xmlschema==3.0.2 platform = (linux|darwin) set_env = VERSION = 3.0.2