mirror of
https://github.com/beetbox/beets.git
synced 2026-01-05 07:23:33 +01:00
Merge pull request #4591 from wisp3rwind/pr_mypy
Add mypy to tox and CI
This commit is contained in:
commit
cc7abe3a47
4 changed files with 32 additions and 1 deletions
9
.github/workflows/ci.yaml
vendored
9
.github/workflows/ci.yaml
vendored
|
|
@ -54,6 +54,15 @@ jobs:
|
|||
run: |
|
||||
tox -vv -e py-cov
|
||||
|
||||
- name: Test latest Python version with tox and mypy
|
||||
if: matrix.python-version == '3.10'
|
||||
# continue-on-error is not ideal since it doesn't give a visible
|
||||
# warning, but there doesn't seem to be anything better:
|
||||
# https://github.com/actions/toolkit/issues/399
|
||||
continue-on-error: true
|
||||
run: |
|
||||
tox -vv -e py-mypy
|
||||
|
||||
- name: Test nightly Python version with tox
|
||||
if: matrix.python-version == '3.11-dev'
|
||||
# continue-on-error is not ideal since it doesn't give a visible
|
||||
|
|
|
|||
5
.mypy.ini
Normal file
5
.mypy.ini
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
[mypy]
|
||||
# FIXME: Would be better to actually type the libraries (if under our control),
|
||||
# or write our own stubs. For now, silence errors
|
||||
ignore_missing_imports = True
|
||||
|
||||
9
setup.py
9
setup.py
|
|
@ -119,6 +119,15 @@ setup(
|
|||
'flake8-docstrings',
|
||||
'pep8-naming',
|
||||
],
|
||||
'mypy': [
|
||||
'mypy',
|
||||
'types-Pillow',
|
||||
'types-urllib3',
|
||||
'types-beautifulsoup4',
|
||||
'types-PyYAML',
|
||||
'types-requests',
|
||||
'types-Flask-Cors',
|
||||
],
|
||||
|
||||
# Plugin (optional) dependencies:
|
||||
'absubmit': ['requests'],
|
||||
|
|
|
|||
10
tox.ini
10
tox.ini
|
|
@ -4,7 +4,7 @@
|
|||
# and then run "tox" from this directory.
|
||||
|
||||
[tox]
|
||||
envlist = py38-{cov,lint}, docs
|
||||
envlist = py38-{cov,lint,mypy}, docs
|
||||
|
||||
[_test]
|
||||
deps = .[test]
|
||||
|
|
@ -13,15 +13,23 @@ deps = .[test]
|
|||
deps = .[lint]
|
||||
files = beets beetsplug beet test setup.py docs
|
||||
|
||||
[_mypy]
|
||||
deps =
|
||||
.[mypy]
|
||||
.[test]
|
||||
|
||||
[testenv]
|
||||
deps =
|
||||
{test,cov}: {[_test]deps}
|
||||
lint: {[_lint]deps}
|
||||
mypy: {[_mypy]deps}
|
||||
passenv = INTEGRATION_TEST
|
||||
commands =
|
||||
test: python -bb -m pytest -rs {posargs}
|
||||
cov: coverage run -m pytest -rs {posargs}
|
||||
lint: python -m flake8 {posargs} {[_lint]files}
|
||||
mypy: mypy -p beets -p beetsplug
|
||||
mypy: mypy test
|
||||
|
||||
[testenv:docs]
|
||||
basepython = python3.10
|
||||
|
|
|
|||
Loading…
Reference in a new issue