feat: init

[skip ci]
This commit is contained in:
Tiara Rodney 2022-04-01 01:02:09 +02:00
commit 0d6c010cce
55 changed files with 4216 additions and 0 deletions

151
tox.ini Normal file
View file

@ -0,0 +1,151 @@
[tox]
skipsdist = true
minversion = 3.7.0
isolated_build = True
envlist = lint, test, build, docs
[testenv:shell]
description = launch python shell
setenv = PYTHONPATH = {toxinidir}/src
deps =
{toxinidir}
commands =
python3
[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:diff]
description = diff
allowlist_externals =
git
commands =
git diff --exit-code {posargs}
[testenv:format]
description = format code
basepython = python3
deps =
autopep8 >= 1.6.0, < 2
commands =
python3 -m autopep8 -v src/ {posargs}
[testenv:graph]
description = build documentation
basepython = python3
allowlist_externals =
graphviz
/bin/sh
pyan
deps =
{toxinidir}
pyan3
commands =
pyan --root {toxinidir}/src --uses --no-defines --colored --grouped --annotated --html
[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 dist/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"