summaryrefslogtreecommitdiffstats
path: root/src/pybind/mgr/tox.ini
diff options
context:
space:
mode:
Diffstat (limited to 'src/pybind/mgr/tox.ini')
-rw-r--r--src/pybind/mgr/tox.ini190
1 files changed, 190 insertions, 0 deletions
diff --git a/src/pybind/mgr/tox.ini b/src/pybind/mgr/tox.ini
new file mode 100644
index 000000000..6270dbdca
--- /dev/null
+++ b/src/pybind/mgr/tox.ini
@@ -0,0 +1,190 @@
+[tox]
+envlist =
+ py3,
+ mypy,
+ fix
+ flake8
+ jinjalint
+ nooptional
+skipsdist = true
+skip_missing_interpreters = true
+
+[pytest]
+log_level=NOTSET
+norecursedirs = dashboard rook/rook_client rook/rook-client-python
+
+[base]
+deps =
+ -rrequirements.txt
+
+[pylint]
+# Allow similarity/code duplication detection
+jobs = 1
+addopts = -rn --rcfile=.pylintrc --jobs={[pylint]jobs}
+
+[flake8]
+max-line-length = 100
+ignore =
+ E501,
+ W503,
+exclude =
+ .tox \
+ .vagrant \
+ __pycache__ \
+ *.pyc \
+ templates \
+ .eggs
+statistics = True
+
+[autopep8]
+addopts =
+ --max-line-length {[flake8]max-line-length} \
+ --exclude "{[flake8]exclude}" \
+ --in-place \
+ --recursive \
+ --ignore-local-config
+
+[testenv]
+setenv =
+ UNITTEST = true
+ PYTHONPATH = $PYTHONPATH:..
+deps =
+ behave
+ -rrequirements.txt
+ -rrook/requirements.txt
+commands =
+ pytest --doctest-modules {posargs:}
+
+[testenv:nooptional]
+setenv =
+ UNITTEST = true
+ PYTHONPATH = $PYTHONPATH:..
+deps =
+ -rrequirements.txt
+commands =
+ pytest {posargs:cephadm/tests/test_ssh.py}
+
+
+[testenv:mypy]
+setenv =
+ MYPYPATH = {toxinidir}/..
+passenv =
+ MYPYPATH
+basepython = python3
+deps =
+ -rrequirements.txt
+ -c{toxinidir}/../../mypy-constrains.txt
+ mypy
+ types-backports
+ types-pkg_resources
+ types-python-dateutil
+ types-requests
+ 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 rgw \
+ -m rook \
+ -m snap_schedule \
+ -m selftest \
+ -m stats \
+ -m status \
+ -m telegraf \
+ -m telemetry \
+ -m test_orchestrator \
+ -m volumes \
+ -m zabbix
+
+[testenv:test]
+setenv = {[testenv]setenv}
+deps = {[testenv]deps}
+commands = {[testenv]commands}
+
+[testenv:fix]
+basepython = python3
+deps =
+ autopep8
+modules =
+ alerts \
+ balancer \
+ cephadm \
+ cli_api \
+ crash \
+ devicehealth \
+ diskprediction_local \
+ insights \
+ iostat \
+ nfs \
+ orchestrator \
+ prometheus \
+ rgw \
+ status \
+ telemetry
+commands =
+ python --version
+ autopep8 {[autopep8]addopts} \
+ {posargs:{[testenv:fix]modules}}
+
+[testenv:pylint]
+basepython = python3
+deps =
+ pylint
+modules =
+ cli_api
+commands =
+ pylint {[pylint]addopts} {posargs:{[testenv:pylint]modules}}
+
+[testenv:flake8]
+basepython = python3
+deps =
+ flake8
+allowlist_externals = bash
+modules =
+ alerts \
+ balancer \
+ cephadm \
+ cli_api \
+ crash \
+ devicehealth \
+ diskprediction_local \
+ hello \
+ iostat \
+ localpool \
+ nfs \
+ orchestrator \
+ prometheus \
+ rbd_support \
+ rgw \
+ selftest
+commands =
+ flake8 --config=tox.ini {posargs} \
+ {posargs:{[testenv:flake8]modules}}
+ bash -c 'test $(git ls-files cephadm | grep ".py$" | grep -v tests | xargs grep "docker.io" | wc -l) == 13'
+
+[testenv:jinjalint]
+basepython = python3
+deps =
+ jinjaninja
+commands =
+ jinja-ninja cephadm/templates