add mypy tox environment and dependencies

This commit is contained in:
wisp3rwind 2022-12-17 22:20:33 +01:00
parent 195ef6c78a
commit e577838631
2 changed files with 18 additions and 1 deletions

View file

@ -119,6 +119,15 @@ setup(
'flake8-docstrings', 'flake8-docstrings',
'pep8-naming', 'pep8-naming',
], ],
'mypy': [
'mypy',
'types-Pillow',
'types-urllib3',
'types-beautifulsoup4',
'types-PyYAML',
'types-requests',
'types-Flask-Cors',
],
# Plugin (optional) dependencies: # Plugin (optional) dependencies:
'absubmit': ['requests'], 'absubmit': ['requests'],

10
tox.ini
View file

@ -4,7 +4,7 @@
# and then run "tox" from this directory. # and then run "tox" from this directory.
[tox] [tox]
envlist = py38-{cov,lint}, docs envlist = py38-{cov,lint,mypy}, docs
[_test] [_test]
deps = .[test] deps = .[test]
@ -13,15 +13,23 @@ deps = .[test]
deps = .[lint] deps = .[lint]
files = beets beetsplug beet test setup.py docs files = beets beetsplug beet test setup.py docs
[_mypy]
deps =
.[mypy]
.[test]
[testenv] [testenv]
deps = deps =
{test,cov}: {[_test]deps} {test,cov}: {[_test]deps}
lint: {[_lint]deps} lint: {[_lint]deps}
mypy: {[_mypy]deps}
passenv = INTEGRATION_TEST passenv = INTEGRATION_TEST
commands = commands =
test: python -bb -m pytest -rs {posargs} test: python -bb -m pytest -rs {posargs}
cov: coverage run -m pytest -rs {posargs} cov: coverage run -m pytest -rs {posargs}
lint: python -m flake8 {posargs} {[_lint]files} lint: python -m flake8 {posargs} {[_lint]files}
mypy: mypy -p beets -p beetsplug
mypy: mypy test
[testenv:docs] [testenv:docs]
basepython = python3.10 basepython = python3.10