[tox]
skipsdist = true
maxversion = 3.7.0
isolated_build = True

[testenv:test-sample-default]
description = test the default sample
basepython = python3
changedir = samples/default
setenv =
    PIPENV_IGNORE_VIRTUALENVS = 1
deps = pipenv
commands =
    python3 -m pipenv run sphinx-build

[testenv:lint]
description = lint with pylint
setenv = PYTHONPATH = {toxinidir}/src
deps =
    {toxinidir}
    pylint >= 2.12.2, < 3
commands =
    python3 -m pylint {toxinidir}/src {posargs}


[testenv:format]
description = format code
basepython = python3
deps =
    autopep8 >= 1.6.0, < 2
commands =
    python3 -m autopep8 -v src/ {posargs}


[testenv:build]
description = build and package
basepython = python3
setenv = PYTHONPATH = {toxinidir}/src
deps = 
    build >= 0.5.1, < 1
commands =
    python3 -m build {posargs}


[testenv:publish]
description = publish to pypi repository
passenv =
    #https://twine.readthedocs.io/en/stable/#environment-variables
    TWINE_USERNAME
    TWINE_PASSWORD
    TWINE_REPOSITORY
    TWINE_REPOSITORY_URL
    TWINE_CERT
    TWINE_NON_INTERACTIVE
deps = 
    twine
commands =
    python3 -m twine upload "dist/*"
