[tox]
envlist = py36,py37,py38,py39
skip_missing_interpreters = true

# Used to run tests, **do not** set GS_CREDS_FILENAME to run off-line tests
[testenv]
description = Run project test suite
passenv = GS_RECORD_MODE GS_CREDS_FILENAME APPDATA
deps = -r test-requirements.txt
commands = pytest tests/

# Used by the CI to check code format/security
[testenv:lint]
description = Run code linters
deps = -r lint-requirements.txt
commands = black --check .
        codespell --skip=".tox,.git" .
        flake8 --ignore=E203 --max-complexity=10 --max-line-length=255 \
            --show-source --statistics .
        isort --check-only --profile black .

# Used by developers to format code, best advised to be run before commit
[testenv:format]
description = Format code
deps = -r lint-requirements.txt
commands = black .
        isort --profile black .


[testenv:build]
description = Build project package
deps = setuptools
commands = python3 setup.py sdist bdist_wheel

[testenv:doc]
description = Build the documentation
deps = sphinx
commands = sphinx-build -M html docs docs/build

[tox]
envlist = py36,py37,py38,py39
skip_missing_interpreters = true

# Used to run tests, **do not** set GS_CREDS_FILENAME to run off-line tests
[testenv]
description = Run project test suite
passenv = GS_RECORD_MODE GS_CREDS_FILENAME APPDATA
deps = -r test-requirements.txt
commands = pytest {posargs} tests/

# Used by the CI to check code format/security
[testenv:lint]
description = Run code linters
deps = -r lint-requirements.txt
commands = black --check .
        codespell --skip=".tox,.git" .
        flake8 --ignore=E203 --max-complexity=10 --max-line-length=255 \
            --show-source --statistics .
        isort --check-only --profile black .

# Used by developers to format code, best advised to be run before commit
[testenv:format]
description = Format code
deps = -r lint-requirements.txt
commands = black .
        isort --profile black .


[testenv:build]
description = Build project package
deps = setuptools
commands = python3 setup.py sdist bdist_wheel

[testenv:doc]
description = Build the documentation
deps = sphinx
commands = sphinx-build -M html docs docs/build

Allow passing arguments to pytest
Allow passing arguments to pytest

When running test suite, now one can pass arguments to pytest
using the following format: `tox -e pyt -- -v`
This passes `-v` to pytest as follow: `pytest -v ...`
