Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 26 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,19 +55,39 @@ dynamic = ["version"]
[project.optional-dependencies]
htmx = [] # for outdated install procedures
docs = ["sphinx>=2.2.0"]

[dependency-groups]
dev = [
"django-debug-toolbar",
"coverage",
"django-extensions",
"ruff",
"djlint",
"ipython",
"pre-commit",
"python-dotenv",
"towncrier",
"werkzeug",
"tox>=4",
{include-group = "build"},
{include-group = "docs"},
{include-group = "test"},
{include-group = "lint"},
]
lint = [
"pre-commit",
"ruff",
"djlint",
]
coverage = [
"coverage",
"unittest-xml-reporting",
]
test = [
"tox>=4.22",
{include-group = "coverage"},
]
build = [
"towncrier", # for generating changelog
"build", # for debugging builds/installs
"pip-tools", # for creating frozen requirements files
]
docs = [
"sphinx>=2.2.0",
]

[tool.hatch.version]
Expand Down
47 changes: 27 additions & 20 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
[tox]
requires =
tox>=4.22
min_version = 4.22
envlist =
clean
py{310,311,312,313}-django{52}
Expand All @@ -15,39 +18,45 @@ python =
3.13: py313

[testenv:clean]
dependency_group = coverage
allowlist_externals = coverage
deps =
coverage
setenv =
commands =
-coverage erase

[testenv:coverage-html]
dependency_group = coverage
allowlist_externals = coverage
deps =
coverage
setenv =
commands =
-coverage combine --append
coverage html --include="./src/*" --omit="*/admin.py,*/test*,*/migrations/*"

[testenv:ruff-critical]
setenv =
dependency_group = lint
allowlist_externals = ruff
deps =
ruff
setenv =
commands =
# stop the build if there are Python syntax errors or undefined names
ruff check --output-format=full --select=E9,F63,F7,F82 --statistics src/

[testenv:ruff-reformat]
setenv =
dependency_group = lint
allowlist_externals = ruff
deps =
ruff
setenv =
commands =
ruff format

[testenv:upgrade-deps]
allowlist_externals = cp
dependency_group = build
allowlist_externals =
cp
pip-compile
deps =
pip-tools
setenv =
PIP_CONSTRAINT=constraints.txt

Expand All @@ -66,15 +75,15 @@ commands =

[testenv:generate-er-model]
setenv =
deps =
-r requirements-django52.txt
-r requirements/dev.txt
dependency_group = dev
deps = -r requirements-django52.txt
commands =
python manage.py graph_models argus_auth argus_incident argus_notificationprofile --group-models -X AbstractUser,AbstractBaseUser,Permission,PermissionsMixin -o docs/reference/img/ER_model.png

[testenv:coverage-xml]
dependency_group = coverage
allowlist_externals = coverage
deps =
coverage
setenv =
commands_pre =
commands =
Expand All @@ -83,9 +92,9 @@ commands =

[testenv:docs]
description = Build the Sphinx documentation
deps =
-r requirements/dev.txt
-r requirements-django52.txt
allowlist_externals = sphinx-build
dependency_group = docs
deps = -r requirements-django52.txt

package = editable
setenv =
Expand All @@ -99,11 +108,9 @@ commands =

[testenv]
passenv = DATABASE_URL

deps =
coverage
unittest-xml-reporting
-r requirements-django{env:DJANGO_VER}.txt
dependency_group = test
allowlist_externals = coverage
deps = -r requirements-django{env:DJANGO_VER}.txt

setenv =
PIP_CONSTRAINT=constraints.txt
Expand Down
Loading