pybind/mgr: tox: also test mypy with python 3.7

Signed-off-by: Sebastian Wagner <sewagner@redhat.com>
This commit is contained in:
Sebastian Wagner 2021-08-10 18:06:38 +02:00
parent 5ca7b8b622
commit 2dd86c9e3e
No known key found for this signature in database
GPG Key ID: 8D2442807E6979F8
2 changed files with 37 additions and 34 deletions

View 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)

View 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}