From 1b2d069a11412fb5b778edb424552b6aaebdcf98 Mon Sep 17 00:00:00 2001 From: Brett Holman Date: Tue, 12 Apr 2022 09:17:12 -0500 Subject: Mypy stubs and other tox maintenance (SC-920) (#1374) - add type stubs for mypy: jsonschema, oauthlib - specify mypy directories to avoid env/ false positive - add conftest.py and setup.py - make setup.py pass pylint: - check ./tools/render-cloudcfg return code in setup.py - find_sources() has no return code, don't check for one --- tox.ini | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'tox.ini') diff --git a/tox.ini b/tox.ini index b9fe5622..6ed69cb3 100644 --- a/tox.ini +++ b/tox.ini @@ -16,6 +16,8 @@ isort==5.10.1 mypy==0.931 pylint==2.11.1 pytest==7.0.0 +types-jsonschema==4.4.2 +types-oauthlib==3.1.6 types-PyYAML==6.0.4 types-requests==2.27.8 types-setuptools==57.4.9 @@ -23,14 +25,14 @@ types-setuptools==57.4.9 [testenv:flake8] deps = flake8=={[format_deps]flake8} -commands = {envpython} -m flake8 {posargs:cloudinit/ tests/ tools/ setup.py} +commands = {envpython} -m flake8 {posargs:cloudinit/ tests/ tools/ conftest.py setup.py} [testenv:pylint] deps = pylint=={[format_deps]pylint} -r{toxinidir}/test-requirements.txt -r{toxinidir}/integration-requirements.txt -commands = {envpython} -m pylint {posargs:cloudinit tests tools} +commands = {envpython} -m pylint {posargs:cloudinit/ tests/ tools/ conftest.py setup.py} [testenv:black] deps = @@ -45,11 +47,13 @@ commands = {envpython} -m isort . --check-only [testenv:mypy] deps = mypy=={[format_deps]mypy} + types-jsonschema=={[format_deps]types-jsonschema} + types-oauthlib=={[format_deps]types-oauthlib} types-pyyaml=={[format_deps]types-PyYAML} types-requests=={[format_deps]types-requests} types-setuptools=={[format_deps]types-setuptools} pytest=={[format_deps]pytest} -commands = {envpython} -m mypy . +commands = {envpython} -m mypy cloudinit/ tests/ tools/ [testenv:check_format] deps = @@ -59,6 +63,8 @@ deps = mypy=={[format_deps]mypy} pylint=={[format_deps]pylint} pytest=={[format_deps]pytest} + types-jsonschema=={[format_deps]types-jsonschema} + types-oauthlib=={[format_deps]types-oauthlib} types-pyyaml=={[format_deps]types-PyYAML} types-requests=={[format_deps]types-requests} types-setuptools=={[format_deps]types-setuptools} @@ -139,20 +145,22 @@ commands = doc8 doc/rtd [testenv:tip-flake8] -commands = {envpython} -m flake8 {posargs:cloudinit/ tests/ tools/ setup.py} +commands = {envpython} -m flake8 {posargs:cloudinit/ tests/ tools/ conftest.py setup.py} deps = flake8 [testenv:tip-mypy] -commands = {envpython} -m mypy --install-types --non-interactive . +commands = {envpython} -m mypy --install-types --non-interactive cloudinit/ tests/ tools/ deps = mypy pytest + types-jsonschema + types-oauthlib types-PyYAML types-requests types-setuptools [testenv:tip-pylint] -commands = {envpython} -m pylint {posargs:cloudinit tests tools} +commands = {envpython} -m pylint {posargs:cloudinit/ tests/ tools/ conftest.py setup.py} deps = # requirements pylint -- cgit v1.2.1