chore: add build environment

This commit is contained in:
Rodweil, Theodor 2023-08-07 02:23:41 +02:00
parent 93fdf8c789
commit d6112ccb2c
No known key found for this signature in database
GPG key ID: F8BC1B0EB1F9CCF5
3 changed files with 54 additions and 17 deletions

1
.gitignore vendored
View file

@ -4,6 +4,7 @@
__pycache__
/.tox
*.egg-info
/dist/
# FAT stuff, in a filesystem sense
._*

16
pyproject.toml Normal file
View file

@ -0,0 +1,16 @@
[build-system]
requires = [
"setuptools",
"wheel",
"setuptools-scm[toml]"
]
build-backend = "setuptools.build_meta"
[tool.autopep8]
max_line_length = 80
aggressive = 3
recursive = true
in-place = true
[tool.setuptools_scm]

54
tox.ini
View file

@ -4,26 +4,46 @@ maxversion = 3.7.0
isolated_build = True
[testenv:docgen]
description = HTML documentation
basepython = python3
allowlist_externals =
tox
[testenv:lint]
description = lint with pylint
setenv = PYTHONPATH = {toxinidir}/src
deps =
{toxinidir}
pylint >= 2.12.2, < 3
commands =
tox -e docgen-html
tox -e docgen-md
tox -e docgen-pdf
python3 -m pylint {toxinidir}/src {posargs}
[testenv:docgen-html]
description = HTML documentation
[testenv:format]
description = format code
basepython = python3
allowlist_externals =
sphinx-build
doxygen
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 =
sphinx-git
sphinx >= 4.3.2, < 5
urllib3 >=1.26.6, < 2
build >= 0.5.1, < 1
commands =
sphinx-build -d "{toxinidir}/build/docs/_tree/html" docs "build/docs/html" --color -W -bhtml {posargs}
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/*"