[tox] skipsdist = true minversion = 3.7.0 isolated_build = True envlist = lint, test, build, docs [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:test] description = test suite with pytest setenv = PYTHONPATH = {toxinidir}/src deps = {toxinidir} pytest pytest-cov commands = pytest --junitxml=test-reports/full.xml --cov-report term --cov-report html:test-reports/coverage --cov=taskdog {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:docs] description = build documentation basepython = python3 setenv = PYTHONPATH = {toxinidir}/src allowlist_externals = sphinx-build plantuml deps = {toxinidir} sphinx >= 4.3.2, < 5 sphinx-rtd-theme >= 1.0.0, < 2 sphinx-markdown-builder >= 0.5.4, < 1 sphinxcontrib-plantuml >= 0.22, < 1 sphinx-autodoc-typehints >= 1.17.0, < 2 sphinx-argparse commands = sphinx-build -d "{toxinidir}/docs/_tree/html" docs "build/docs" --color -W -bhtml {posargs} sphinx-build -d "{toxinidir}/docs/_tree/_" docs . --color -W -bmarkdown -treadme {posargs} [testenv:format] description = format code basepython = python3 deps = autopep8 >= 1.6.0, < 2 commands = python3 -m autopep8 -v src/ {posargs} [testenv:publish-testpypi] description = publish to pypi test 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 --repository testpypi "dist/taskdog*" [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/*" [testenv:publish-docs] description = publish documentation setenv = tmppath = {envdir}/git/vicytorykit.bitbucket.io passenv = #https://support.atlassian.com/bitbucket-cloud/docs/variables-and-secrets/ BITBUCKET_REPO_SLUG allowlist_externals = /bin/sh /bin/rm /bin/cp /bin/mkdir /usr/bin/git commands = python3 -c "exec('import os\nif \'BITBUCKET_REPO_SLUG\' not in os.environ.keys(): exit(1)')" rm -rf {env:tmppath} git clone git@bitbucket.org:victorykit/victorykit.bitbucket.io.git {env:tmppath} mkdir -p "{env:tmppath}/{env:BITBUCKET_REPO_SLUG}" cp -r build/docs/ "{env:tmppath}/{env:BITBUCKET_REPO_SLUG}" sh -c "cd {env:tmppath}; git add {env:BITBUCKET_REPO_SLUG}" sh -c "cd {env:tmppath}; git -c 'user.name=victoryk.it Bot' -c 'user.email=commits-noreply@victoryk.it' commit -m 'updated {env:BITBUCKET_REPO_SLUG}'" sh -c "cd {env:tmppath}; git push"