[tox] envlist = flake8 mypy check-black py3 skipsdist = true # REMINDER: run `tox -e format-black` to apply black formatting # with the exact same specs as `check-black` expects. [flake8] max-line-length = 100 inline-quotes = ' ignore = E501, W503, exclude = .tox, .vagrant, __pycache__, *.pyc, templates, .eggs statistics = True [testenv] setenv = PYTHONPATH = $PYTHONPATH:..:{toxinidir}/../python-common passenv = PYTHONPATH skip_install=true deps = -rzipapp-reqs.txt pyfakefs == 4.5.6 ; python_version < "3.7" pyfakefs == 5.3.5 ; python_version >= "3.7" mock pytest pyyaml commands=pytest {posargs} [testenv:mypy] setenv = MYPYPATH = {toxinidir}/..:{toxinidir}/../python-common passenv = MYPYPATH deps = mypy types-PyYAML -rzipapp-reqs.txt -c{toxinidir}/../mypy-constrains.txt commands = mypy --config-file ../mypy.ini {posargs:cephadm.py cephadmlib} [testenv:flake8] allowlist_externals = bash deps = flake8 flake8-quotes commands = flake8 --config=tox.ini {posargs:cephadm.py cephadmlib} bash -c 'test $(git ls-files 'cephadm.py' 'cephadmlib/*.py' | sort -u | xargs grep "docker.io" | wc -l) == 1' bash -c 'test $(git ls-files 'cephadm.py' 'cephadmlib/*.py' | sort -u | xargs grep "quay.io" | wc -l) == 7' # Downstream distributions may choose to alter this "docker.io" number, # to make sure no new references to docker.io are creeping in unnoticed. # coverage env is intentionally left out of the envlist. It is here for developers # to run locally to generate and review test coverage of cephadm. [testenv:coverage] skip_install=true deps = {[testenv]deps} pytest-cov commands = pytest -v --cov=cephadm --cov-report=term-missing --cov-report=html {posargs} [testenv:check-black] deps = black>=23,<24 commands = black --check -l78 -t py36 --skip-string-normalization -v cephadmlib/ [testenv:format-black] deps = black>=23,<24 commands = black -q -l78 -t py36 --skip-string-normalization cephadmlib/ # test_build env is intentionally left out of the envlist. It is here for developers # to run locally as it has some unusual requirements: needs podman, etc [testenv:test_build] skip_install=true deps = {[testenv]deps} commands = pytest {posargs} tests/build