Newer
Older
[tox]
minversion = 1.6
skipsdist = True
John L. Villalovos
committed
skip_missing_interpreters = True
envlist = py310,py39,py38,py37,flake8,black,twine-check,mypy,isort,cz,pylint,pre-commit
passenv =
DOCKER_HOST
FORCE_COLOR
GITHUB_ACTIONS
GITHUB_WORKSPACE
GITLAB_IMAGE
GITLAB_TAG
NO_COLOR
PWD
PY_COLORS
usedevelop = True
install_command = pip install {opts} {packages}
-r{toxinidir}/requirements-test.txt
pytest tests/unit tests/meta {posargs}
[testenv:black]
basepython = python3
envdir={toxworkdir}/lint
deps = -r{toxinidir}/requirements-lint.txt
[testenv:isort]
basepython = python3
envdir={toxworkdir}/lint
deps = -r{toxinidir}/requirements-lint.txt
isort {posargs} {toxinidir}
envdir={toxworkdir}/lint
deps = -r{toxinidir}/requirements-lint.txt
[testenv:flake8]
basepython = python3
envdir={toxworkdir}/lint
deps = -r{toxinidir}/requirements-lint.txt
commands =
flake8 {posargs} .
[testenv:pylint]
basepython = python3
envdir={toxworkdir}/lint
deps = -r{toxinidir}/requirements-lint.txt
commands =
pylint {posargs} gitlab/
[testenv:cz]
basepython = python3
envdir={toxworkdir}/lint
deps = -r{toxinidir}/requirements-lint.txt
commands =
cz check --rev-range 65ecadc..HEAD # cz is fast, check from first valid commit
basepython = python3
deps = -r{toxinidir}/requirements.txt
python3 setup.py sdist bdist_wheel
twine check dist/*
[testenv:venv]
commands = {posargs}
[flake8]
exclude = .git,.venv,.tox,dist,doc,*egg,build,
# We ignore the following because we use black to handle code-formatting
# E203: Whitespace before ':'
# E501: Line too long
# W503: Line break occurred before a binary operator
ignore = E203,E501,W503
per-file-ignores =
gitlab/v4/objects/__init__.py:F401,F403
deps = -r{toxinidir}/requirements-docs.txt
commands = sphinx-build -n -W --keep-going -b html docs build/sphinx/html
pytest --cov --cov-report term --cov-report html \
--cov-report xml tests/unit tests/meta {posargs}
[coverage:run]
omit = *tests*
[coverage:report]
exclude_lines =
pragma: no cover
if TYPE_CHECKING:
if debug:
deps = -r{toxinidir}/requirements-docker.txt
pytest --script-launch-mode=subprocess --cov --cov-report xml tests/functional/cli {posargs}
[testenv:api_func_v4]
deps = -r{toxinidir}/requirements-docker.txt
pytest --cov --cov-report xml tests/functional/api {posargs}
[testenv:smoke]
deps = -r{toxinidir}/requirements-test.txt
commands = pytest tests/smoke {posargs}
[testenv:pre-commit]
skip_install = true
deps = -r requirements-precommit.txt
commands = pre-commit run --all-files --show-diff-on-failure
[testenv:install]
skip_install = true
deps = -r{toxinidir}/requirements.txt
-r{toxinidir}/requirements-test.txt
commands = pytest tests/install