Skip to content

Commit

Permalink
Add mypy checks for xmlschema>=3.1.0
Browse files Browse the repository at this point in the history
  - 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.
  • Loading branch information
brunato committed Sep 9, 2024
1 parent 34dd4ef commit ca8e13a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 12 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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=[
Expand Down
28 changes: 17 additions & 11 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,22 @@ 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

[testenv]
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]
Expand All @@ -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
Expand All @@ -65,32 +65,38 @@ 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
xmlschema=={env:VERSION}
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
Expand Down

0 comments on commit ca8e13a

Please sign in to comment.