mirror of
https://github.com/enpaul/keyosk.git
synced 2025-01-13 18:43:32 +00:00
Update toxfile with better optimized settings and task dist
Fix pycache cleanup in makefile Update makefile to use tox doc env for building documentation
This commit is contained in:
parent
ce3e2e34ab
commit
ce20868b49
7
Makefile
7
Makefile
@ -23,12 +23,13 @@ clean-tox:
|
|||||||
rm -rf ./.mypy_cache
|
rm -rf ./.mypy_cache
|
||||||
rm -rf ./.tox
|
rm -rf ./.tox
|
||||||
rm -f .coverage
|
rm -f .coverage
|
||||||
|
find ./tests -true -type d -name __pycache__ -prune -exec rm -rf {} \;
|
||||||
|
|
||||||
clean-py:
|
clean-py:
|
||||||
rm -rf ./dist
|
rm -rf ./dist
|
||||||
rm -rf ./build
|
rm -rf ./build
|
||||||
rm -rf ./*/__pycache__
|
|
||||||
rm -rf ./*.egg-info
|
rm -rf ./*.egg-info
|
||||||
|
find ./keyosk -true -type d -name __pycache__ -prune -exec rm -rf {} \;
|
||||||
|
|
||||||
clean-docs:
|
clean-docs:
|
||||||
rm -rf $(DOC_BUILDDIR)
|
rm -rf $(DOC_BUILDDIR)
|
||||||
@ -47,6 +48,4 @@ build: clean-py tox; ## Test and build python distributions
|
|||||||
poetry build
|
poetry build
|
||||||
|
|
||||||
docs: clean-docs ## Generate sphinx documentation, provide `DOC_FORMAT` to override default format of "html"
|
docs: clean-docs ## Generate sphinx documentation, provide `DOC_FORMAT` to override default format of "html"
|
||||||
poetry run sphinx-apidoc -o "${DOC_SOURCEDIR}" "${DOC_PROJECT}"
|
poetry run tox -e docs
|
||||||
rm $(DOC_SOURCEDIR)/modules.rst
|
|
||||||
poetry run sphinx-build -M $(DOC_FORMAT) "$(DOC_SOURCEDIR)" "$(DOC_BUILDDIR)" $(DOC_OPTIONS) $(0)
|
|
||||||
|
31
tox.ini
31
tox.ini
@ -1,9 +1,10 @@
|
|||||||
[tox]
|
[tox]
|
||||||
envlist = py37, py36, lint, typing, security, docs
|
envlist = py36, py37, py38, format, static, docs
|
||||||
|
skip_missing_interpreters = true
|
||||||
isolated_build = true
|
isolated_build = true
|
||||||
|
|
||||||
[testenv]
|
[testenv]
|
||||||
description = Run the unit tests (pytest)
|
description = Run unit tests (pytest+{basepython})
|
||||||
deps =
|
deps =
|
||||||
marshmallow == 3.5.0
|
marshmallow == 3.5.0
|
||||||
passlib == 1.7.2
|
passlib == 1.7.2
|
||||||
@ -14,32 +15,30 @@ deps =
|
|||||||
commands =
|
commands =
|
||||||
pytest --cov={envsitepackagesdir}/keyosk --cov-config .coveragerc tests/ --cov-report term-missing
|
pytest --cov={envsitepackagesdir}/keyosk --cov-config .coveragerc tests/ --cov-report term-missing
|
||||||
|
|
||||||
[testenv:lint]
|
[testenv:format]
|
||||||
description = Check code formatting against black and pylint
|
description = Enforce code formatting (pre-commit)
|
||||||
|
skip_install = true
|
||||||
deps =
|
deps =
|
||||||
pre-commit == 2.1.0
|
pre-commit == 2.1.0
|
||||||
pylint == 2.3.1
|
|
||||||
astroid == 2.2.5
|
|
||||||
commands =
|
commands =
|
||||||
pre-commit run --all-files
|
pre-commit run --all-files
|
||||||
pylint keyosk
|
|
||||||
|
|
||||||
[testenv:typing]
|
[testenv:static]
|
||||||
description = Check type annotations with mypy
|
description = Static code analysis (mypy+pylint+bandit)
|
||||||
|
skip_install = true
|
||||||
|
ignore_errors = true
|
||||||
deps =
|
deps =
|
||||||
|
pylint == 2.3.1
|
||||||
|
astroid == 2.2.5
|
||||||
mypy == 0.761
|
mypy == 0.761
|
||||||
commands =
|
|
||||||
mypy keyosk --ignore-missing-imports --no-strict-optional
|
|
||||||
|
|
||||||
[testenv:security]
|
|
||||||
description = Check security vulnerabilities (bandit)
|
|
||||||
deps =
|
|
||||||
bandit == 1.6.2
|
bandit == 1.6.2
|
||||||
commands =
|
commands =
|
||||||
|
mypy keyosk --ignore-missing-imports --no-strict-optional
|
||||||
|
pylint keyosk --rcfile .pylintrc
|
||||||
bandit --recursive keyosk
|
bandit --recursive keyosk
|
||||||
|
|
||||||
[testenv:docs]
|
[testenv:docs]
|
||||||
description = Build documentation to check RST syntax (sphinx)
|
description = Build documentation (sphinx)
|
||||||
deps =
|
deps =
|
||||||
sphinx == 2.4.2
|
sphinx == 2.4.2
|
||||||
sphinx-autodoc-typehints == 1.10.3
|
sphinx-autodoc-typehints == 1.10.3
|
||||||
|
Loading…
Reference in New Issue
Block a user