Skip to content

Commit

Permalink
Add Python 3.12 support and update static typing checks
Browse files Browse the repository at this point in the history
  - Use mypy==1.2.0 for static typing checks
  - Add py312, mypy-pypy3 and mypy-py312 test environments
  - py312: skip	lxml installation for now
  • Loading branch information
brunato committed Apr 14, 2023
1 parent 62e317e commit 7c772c2
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 13 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/test-xmlschema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ jobs:
- name: Lint with mypy if Python version != 3.7
if: ${{ matrix.python-version != '3.7' }}
run: |
pip install mypy==1.0.1 elementpath==4.0.1 lxml-stubs
pip install mypy==1.2.0 elementpath==4.1.1 lxml-stubs
mypy --show-error-codes --strict xmlschema
- name: Lint with mypy if Python version == 3.7
if: ${{ matrix.python-version == '3.7' }}
run: |
pip install mypy==1.0.1 elementpath==4.0.1 lxml-stubs
pip install mypy==1.2.0 elementpath==4.1.1 lxml-stubs
mypy --show-error-codes --no-warn-redundant-casts --no-warn-unused-ignores --strict xmlschema
25 changes: 14 additions & 11 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tox]
envlist = py{37,38,39,310,311}, pypy3, ep{40}, docs,
flake8, mypy-py{37,38,39,310,311}, coverage, pytest
envlist = py{37,38,39,310,311,312,py3}, ep{40}, docs,
flake8, mypy-py{37,38,39,310,311,312,py3}, coverage, pytest
skip_missing_interpreters = true
work_dir = {tox_root}/../.tox/xmlschema

Expand All @@ -15,10 +15,12 @@ deps =
coverage: coverage
commands =
python -m unittest
allowlist_externals = make

[testenv:pypy3]
commands = python -m unittest
[testenv:py312]
deps =
elementpath>=4.0.0, <5.0.0
# lxml: skip for now
jinja2

[testenv:ep40]
deps =
Expand All @@ -31,6 +33,7 @@ commands =
make -C doc latexpdf SPHINXOPTS="-W -n"
make -C doc doctest SPHINXOPTS="-W -n"
sphinx-build -W -n -T -b man doc build/sphinx/man
allowlist_externals = make

[flake8]
max-line-length = 100
Expand All @@ -44,17 +47,17 @@ commands =

[testenv:mypy-py37]
deps =
mypy==1.0.1
elementpath==4.0.1
mypy==1.2.0
elementpath==4.1.1
lxml-stubs
jinja2
commands =
mypy --config-file {toxinidir}/mypy.ini xmlschema

[testenv:mypy-py{38,39,310,311}]
[testenv:mypy-py{38,39,310,311,312,py3}]
deps =
mypy==1.0.1
elementpath==4.0.1
mypy==1.2.0
elementpath==4.1.1
lxml-stubs
jinja2
commands =
Expand All @@ -74,7 +77,7 @@ deps =
elementpath>=4.0.0, <5.0.0
lxml
jinja2
mypy==1.0.1
mypy==1.2.0
lxml-stubs
commands =
pytest tests -ra
Expand Down

0 comments on commit 7c772c2

Please sign in to comment.