mirror of
https://github.com/craigerl/aprsd.git
synced 2026-01-20 04:25:30 -05:00
116 lines
2.7 KiB
INI
116 lines
2.7 KiB
INI
[tox]
|
|
minversion = 4.30.0
|
|
skipdist = True
|
|
skip_missing_interpreters = true
|
|
envlist = lint,py{311,312,313,314}
|
|
requires = tox-uv
|
|
|
|
# Activate isolated build environment. tox will use a virtual environment
|
|
# to build a source distribution from the source tree. For build tools and
|
|
# arguments use the pyproject.toml file as specified in PEP-517 and PEP-518.
|
|
isolated_build = true
|
|
|
|
[testenv]
|
|
description = Run unit-testing
|
|
setenv =
|
|
_PYTEST_SETUP_SKIP_APRSD_DEP=1
|
|
PYTHONDONTWRITEBYTECODE=1
|
|
PYTHONUNBUFFERED=1
|
|
package = editable
|
|
deps =
|
|
pytest
|
|
pytest-cov
|
|
commands =
|
|
uv run pytest -v --cov-report term-missing --cov=aprsd tests {posargs}
|
|
coverage: coverage report -m
|
|
coverage: coverage xml
|
|
|
|
[testenv:docs]
|
|
skip_install = true
|
|
deps =
|
|
-r{toxinidir}/requirements.txt
|
|
-r docs/requirements.txt
|
|
{toxinidir}/.
|
|
changedir = {toxinidir}/docs
|
|
commands =
|
|
{envpython} clean_docs.py
|
|
m2r2 --overwrite {toxinidir}/README.md
|
|
{envpython} -c "import shutil, os; os.chdir('{toxinidir}'); shutil.move('README.rst', 'docs/source/readme.rst')"
|
|
{envpython} fix_readme_rst.py
|
|
sphinx-apidoc --force --output-dir source/apidoc {toxinidir}/aprsd
|
|
#sphinx-build -a -W . _build
|
|
sphinx-build -M html source build
|
|
|
|
[testenv:lint]
|
|
skip_install = true
|
|
deps =
|
|
ruff
|
|
commands =
|
|
ruff check aprsd tests {posargs}
|
|
ruff format --check aprsd tests
|
|
|
|
[testenv:fast8]
|
|
basepython = python3
|
|
# Use same environment directory as lint env to save space and install time
|
|
envdir = {toxworkdir}/lint
|
|
commands =
|
|
{toxinidir}/tools/fast8.sh
|
|
passenv = FAST8_NUM_COMMITS
|
|
|
|
# This is the configuration for the tox-gh-actions plugin for GitHub Actions
|
|
# https://github.com/ymyzk/tox-gh-actions
|
|
# This section is not needed if not using GitHub Actions for CI.
|
|
[gh-actions]
|
|
python =
|
|
3.10: py39, lint, type-check, docs
|
|
3.11: py311, lint, type-check, docs
|
|
|
|
[testenv:fmt]
|
|
# This will reformat your code using ruff
|
|
skip_install = true
|
|
deps =
|
|
ruff
|
|
commands =
|
|
ruff format aprsd tests
|
|
ruff check --fix aprsd tests
|
|
|
|
[testenv:type-check]
|
|
skip_install = true
|
|
deps =
|
|
mypy
|
|
types-pytz
|
|
types-requests
|
|
types-tzlocal
|
|
commands =
|
|
mypy --ignore-missing-imports --install-types aprsd
|
|
|
|
[testenv:pre-commit]
|
|
skip_install = true
|
|
basepython = python3
|
|
deps = pre-commit
|
|
commands = pre-commit run --all-files --show-diff-on-failure
|
|
|
|
[testenv:fix]
|
|
description = run code formatter and linter (auto-fix)
|
|
skip_install = true
|
|
deps =
|
|
pre-commit-uv>=4.1.1
|
|
commands =
|
|
pre-commit run --all-files --show-diff-on-failure
|
|
|
|
[testenv:type]
|
|
runner = uv-venv-lock-runner
|
|
description = run type checker via mypy
|
|
commands =
|
|
mypy {posargs:aprsd}
|
|
|
|
[testenv:dev]
|
|
runner = uv-venv-lock-runner
|
|
description = dev environment
|
|
extras =
|
|
dev
|
|
tests
|
|
type
|
|
commands =
|
|
uv pip tree
|