This PR introduces tox and autopep8 to format the Python code according to PEP8. It does NOT include any lint related things.
Signed-off-by: Volker Theile <vtheile@suse.com>
--- /dev/null
+autopep8; python_version >= '3'
[tox]
-envlist = py3, mypy
+envlist =
+ py3,
+ mypy,
+ test,
+ fix
skipsdist = true
requires = cython
+[flake8]
+max-line-length = 100
+exclude =
+ .tox,
+ .vagrant,
+ __pycache__,
+ *.pyc,
+ templates,
+ .eggs
+
+[autopep8]
+addopts =
+ --max-line-length {[flake8]max-line-length}
+ --exclude "{[flake8]exclude}"
+ --in-place
+ --recursive
+ --ignore-local-config
+
[testenv]
setenv =
UNITTEST = true
cython
-rrequirements.txt
mypy==0.782
-commands = mypy --config-file=../../mypy.ini \
+commands =
+ mypy --config-file=../../mypy.ini \
cephadm/module.py \
mgr_module.py \
dashboard/module.py \
rook/module.py \
test_orchestrator/module.py \
volumes/__init__.py
+
+[testenv:test]
+setenv = {[testenv]setenv}
+deps = {[testenv]deps}
+commands = {[testenv]commands}
+
+[testenv:fix]
+basepython = python3
+deps = -rrequirements-fix.txt
+commands =
+ python --version
+ autopep8 {[autopep8]addopts} {posargs: \
+ cephadm/}