Skip to content

Commit

Permalink
Add tox for local development testing
Browse files Browse the repository at this point in the history
This tox setup is mostly intended to execute python3.9 and python3.12 in
our local setup without the need of waiting for CI to run the specific
test.
  • Loading branch information
r0x0d committed Nov 7, 2024
1 parent 3a155ed commit a2f8945
Show file tree
Hide file tree
Showing 4 changed files with 143 additions and 13 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,5 @@ clean: ## Clean project files
@find . -name '__pycache__' -exec rm -fr {} +
@find . -name '*.pyc' -exec rm -f {} +
@find . -name '*.pyo' -exec rm -f {} +
@rm -rf .pdm-build .ruff_cache .coverage .pdm-python dist
@rm -rf .pdm-build .ruff_cache .coverage .pdm-python dist .tox
@coverage erase
128 changes: 126 additions & 2 deletions pdm.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 3 additions & 10 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,6 @@ lint.ignore = [
[tool.pdm]
distribution = true

[tool.pdm.dev-dependencies]
dev = [
"pytest==8.3.3",
"pytest-cov==6.0.0",
"pytest-randomly==3.16.0",
"coverage==7.6.4",
"pytest-sugar==1.0.0",
"pytest-clarity==1.0.1",
]

[tool.pdm.scripts]
unit-test = "pdm run make unit-test"
coverage = "pdm run make coverage"
Expand All @@ -79,3 +69,6 @@ skip_empty = true
[tool.coverage.run]
branch = true
source = ["command_line_assistant"]

[dependency-groups]
dev = ["pytest==8.3.3", "pytest-cov==6.0.0", "pytest-randomly==3.16.0", "coverage==7.6.4", "pytest-sugar==1.0.0", "pytest-clarity==1.0.1", "tox>=4.23.2", "tox-pdm>=0.7.2"]
13 changes: 13 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[tox]
envlist = py3{9,12}
isolated_build = true

[testenv]
setenv =
# Ignore the python version defined in .pdm-python
PDM_IGNORE_SAVED_PYTHON='1'
groups =
dev
allowlist_externals = pdm
# Execute pdm run unit-test
commands = unit-test {posargs}

0 comments on commit a2f8945

Please sign in to comment.