From 38690355d54154f5f1f99a77db216bdd09df250e Mon Sep 17 00:00:00 2001 From: Simon van Lierde Date: Thu, 8 Oct 2026 05:32:50 +0200 Subject: [PATCH 1/2] fix(template): make tox run the tests in generated packages --- CHANGELOG.md | 4 ++++ template/pyproject.toml.jinja | 3 +-- tests/test_project.py | 1 + 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e0c4b9b5..1c162ec4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,10 @@ * Removed Python 3.10 and 3.11 support +### Fixed + +* `tox` in a generated package now runs the tests: its table was misspelled `tool.box.testenv` + ## [0.6.1] ### Added diff --git a/template/pyproject.toml.jinja b/template/pyproject.toml.jinja index c2a1e0ee..98c56082 100644 --- a/template/pyproject.toml.jinja +++ b/template/pyproject.toml.jinja @@ -111,10 +111,9 @@ requires = ["tox>=4.22"] env_list = [ "py312", "py313", "py314" ] skip_missing_interpreters = true {% if AddLocalTests -%} -[tool.box.testenv] +[tool.tox.env_run_base] description = "Run test under {base_python}" commands = [["pytest"]] -[tool.tox.env_run_base] dependency_groups = [ "dev" ] {%- endif %} diff --git a/tests/test_project.py b/tests/test_project.py index 7caa7e1d..a75bc8c7 100644 --- a/tests/test_project.py +++ b/tests/test_project.py @@ -92,6 +92,7 @@ def test_tox(baked_with_development_dependencies, project_env_bin_dir): result = run([f'{bin_dir}tox'], project_dir) assert result.returncode == 0 assert 'congratulations :)' in result.stdout + assert '== 3 passed in' in result.stdout # assert (project_dir / '.tox' / 'dist' / 'my_python_package-0.1.0.zip').exists() assert (project_dir / '.tox' / '.pkg' / 'dist'/ 'my_python_package-0.1.0.tar.gz').exists() From 1445df4bbfd3172fb7576cbc82247b46af054aed Mon Sep 17 00:00:00 2001 From: Simon van Lierde <90462640+simonvanlierde@users.noreply.github.com> Date: Mon, 26 Oct 2026 19:01:27 +0000 Subject: [PATCH 2/2] docs: link the PR in the changelog entry --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1c162ec4..b5e0cd3d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,7 +20,7 @@ ### Fixed -* `tox` in a generated package now runs the tests: its table was misspelled `tool.box.testenv` +* `tox` in a generated package now runs the tests: its table was misspelled `tool.box.testenv` [#716](https://github.com/NLeSC/python-template/pull/716) ## [0.6.1]