tox pre-commit formatter

This commit is contained in:
Joel Falknau 2025-03-06 09:59:08 +10:00
parent 826198e5a7
commit c7db4f0bd3
No known key found for this signature in database
2 changed files with 19 additions and 16 deletions

View File

@ -85,18 +85,18 @@ repos:
- --disable=MD013
# Infrastructure
- repo: https://github.com/tox-dev/pyproject-fmt
rev: v2.5.0
rev: v2.5.1
hooks:
- id: pyproject-fmt
name: pyproject.toml formatter
description: "Format the pyproject.toml file."
args:
- --indent=4
additional_dependencies:
- tox==4.24.1 # https://github.com/tox-dev/tox/releases/latest
- repo: https://github.com/tox-dev/tox-ini-fmt
rev: 1.5.0
hooks:
- id: tox-ini-fmt
- repo: https://github.com/abravalheri/validate-pyproject
rev: v0.23
hooks:
- id: validate-pyproject
name: Validate pyproject.toml
description: "Validate the pyproject.toml file."

25
tox.ini
View File

@ -1,30 +1,33 @@
[tox]
isolated_build = true
skipsdist = true
requires =
tox>=4.2
env_list =
docs
py{313, 312, 311, 310}-{all, core}
no_package = true
usedevelop = true
envlist = py{310,311,312,313}-{all,core}, docs
[testenv]
setenv =
all: DJANGO_SETTINGS_MODULE = tests.settings_all
core: DJANGO_SETTINGS_MODULE = tests.settings_core
basepython =
base_python =
py310: python3.10
py311: python3.11
py312: python3.12
py313: python3.13
deps=
deps =
coverage
install_command = pip install -e ".[test]" -U {opts} {packages}
set_env =
all: DJANGO_SETTINGS_MODULE = tests.settings_all
core: DJANGO_SETTINGS_MODULE = tests.settings_core
commands =
all: coverage run runtests.py -v 2 --debug-mode
core: coverage run runtests.py allianceauth.authentication.tests.test_app_settings -v 2 --debug-mode
all: coverage report -m
all: coverage xml
install_command = pip install -e ".[test]" -U {opts} {packages}
[testenv:docs]
description = invoke sphinx-build to build the HTML docs
basepython = python3.12
install_command = pip install -e ".[docs]" -U {opts} {packages}
base_python = python3.12
commands =
sphinx-build -T -E -b html -d "{toxworkdir}/docs_doctree" -D language=en docs "{toxworkdir}/docs_out" {posargs}
install_command = pip install -e ".[docs]" -U {opts} {packages}