]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
pybind/mgr: tox: also test mypy with python 3.7
authorSebastian Wagner <sewagner@redhat.com>
Tue, 10 Aug 2021 16:06:38 +0000 (18:06 +0200)
committerSebastian Wagner <sewagner@redhat.com>
Tue, 10 Aug 2021 16:06:38 +0000 (18:06 +0200)
Signed-off-by: Sebastian Wagner <sewagner@redhat.com>
src/pybind/mgr/mgr_module.py
src/pybind/mgr/tox.ini

index 76fded798e4719221657b519d1af626f7d47794b..131d8feb31bd8a0b763e75420f038d6c470a78d1 100644 (file)
@@ -29,13 +29,13 @@ from mgr_util import profile_method
 if sys.version_info >= (3, 8):
     from typing import get_args, get_origin
 else:
-    def get_args(tp):
+    def get_args(tp: Any) -> Any:
         if tp is Generic:
             return tp
         else:
             return getattr(tp, '__args__', ())
 
-    def get_origin(tp):
+    def get_origin(tp: Any) -> Any:
         return getattr(tp, '__origin__', None)
 
 
index 8664e1ca9db76b9e17f0a867ebf65da63da599ba..9709d8edd32c18ce5e00ed32e2d043e9789d5777 100644 (file)
@@ -60,6 +60,38 @@ setenv =
 passenv =
     MYPYPATH
 basepython = python3
+mypy_args = --config-file=../../mypy.ini
+           -m alerts
+           -m balancer
+           -m cephadm
+           -m crash
+           -m dashboard
+           -m devicehealth
+           -m diskprediction_local
+           -m hello
+           -m influx
+           -m iostat
+           -m localpool
+           -m mds_autoscaler
+           -m mgr_module
+           -m mgr_util
+           -m mirroring
+           -m nfs
+           -m orchestrator
+           -m pg_autoscaler
+           -m progress
+           -m prometheus
+           -m rbd_support
+           -m rook
+           -m snap_schedule
+           -m selftest
+           -m stats
+           -m status
+           -m telegraf
+           -m telemetry
+           -m test_orchestrator
+           -m volumes
+           -m zabbix
 deps =
     cython
     -rrequirements.txt
@@ -71,38 +103,9 @@ deps =
     types-PyYAML
     types-jwt
 commands =
-    mypy --config-file=../../mypy.ini \
-           -m alerts \
-           -m balancer \
-           -m cephadm \
-           -m crash \
-           -m dashboard \
-           -m devicehealth \
-           -m diskprediction_local \
-           -m hello \
-           -m influx \
-           -m iostat \
-           -m localpool \
-           -m mds_autoscaler \
-           -m mgr_module \
-           -m mgr_util \
-           -m mirroring \
-           -m nfs \
-           -m orchestrator \
-           -m pg_autoscaler \
-           -m progress \
-           -m prometheus \
-           -m rbd_support \
-           -m rook \
-           -m snap_schedule \
-           -m selftest \
-           -m stats \
-           -m status \
-           -m telegraf \
-           -m telemetry \
-           -m test_orchestrator \
-           -m volumes \
-           -m zabbix
+    mypy {[testenv:mypy]mypy_args}
+    mypy --python-version 3.7 {[testenv:mypy]mypy_args}
+
 
 [testenv:test]
 setenv = {[testenv]setenv}