]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
python-common: add a dedicated tox env to run mypy 50743/head
authorJohn Mulligan <jmulligan@redhat.com>
Thu, 30 Mar 2023 20:49:27 +0000 (16:49 -0400)
committerJohn Mulligan <jmulligan@redhat.com>
Thu, 30 Mar 2023 20:52:53 +0000 (16:52 -0400)
IMO it's not a good practice to overload a tox rule with multiple
different test tools. It forces the tools to share the same virtualenvs
and makes it impossible to run the tools individually. A separate mypy
env also better matches the other tox.ini files in the ceph tree.
Since the new 'mypy' env is in the default env list it will continue
to get run automatically when no specific envs are selected.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
src/python-common/tox.ini

index 0699c047652608b379739baf70b178f4e2d25ecb..2737a87e8207a68089db6294b1df649242c1eb9c 100644 (file)
@@ -1,5 +1,5 @@
 [tox]
-envlist = py3, lint
+envlist = py3, mypy, lint
 skip_missing_interpreters = true
 
 [testenv:py3]
@@ -11,6 +11,13 @@ commands=
     pytest {posargs}
     mypy --config-file=../mypy.ini -p ceph
 
+[testenv:mypy]
+deps=
+    -rrequirements.txt
+    -c{toxinidir}/../mypy-constrains.txt
+commands=
+    mypy --config-file=../mypy.ini -p ceph
+
 [tool:pytest]
 norecursedirs = .* _* virtualenv