You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/topics/02_dependency-management.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -118,7 +118,7 @@ We evaluated the most prominent options for managing Python project dependencies
118
118
## Chosen Tool(s)
119
119
120
120
-**{uv}`uv-documentation`** as the primary **Dependency Manager**.
121
-
-**{virtualenv-documentation}`virtualenv` / {venv-tutorial}`venv`** (orchestrated by uv) for environment management.
121
+
-**[:py{virtualenv}`class`](virtualenv-documentation) / [venv](python:venv-tutorial)** (orchestrated by uv) for environment management.
122
122
123
123
## Justification for the Choice
124
124
@@ -139,7 +139,7 @@ By choosing {uv}`uv-documentation`, the template makes a deliberate, opinionated
139
139
## Interactions with Other Topics
140
140
141
141
-**pyproject.toml (01):** {uv}`uv-documentation` is the primary consumer and editor of the `[project]`, `[build-system]`, and `[project.optional-dependencies]` tables in `pyproject.toml`, acting as the interpreter for packaging standards. Its own configuration goes in `[tool.uv]`.
142
-
-**Packaging Build (09):** {uv}`uv-documentation` acts as a PEP 517 build frontend (`uv build`), calling the appropriate backend ({setuptools-documentation}`setuptools` or {maturin-documentation}`maturin`) configured in `pyproject.toml`.
142
+
-**Packaging Build (09):** {uv}`uv-documentation` acts as a PEP 517 build frontend (`uv build`), calling the appropriate backend ([`setuptools`](setuptools-documentation) or [`maturin`](maturin-documentation)) configured in `pyproject.toml`.
143
143
-**Packaging Publish (10):** {uv}`uv-documentation` provides a command to publish packages (`uv publish`) as an alternative to using {twine}`twine-documentation` directly. The Task Automation layer (12) might call `uv publish`.
144
144
-**Task Automation (12):** {Nox}`nox-documentation` will orchestrate workflows by calling {uv}`uv-documentation` commands (e.g., `uv run ruff check`, `uv run pytest`, `uv build`, `uv publish`). {uv}`uv-documentation` is also configured as the backend for Nox's virtual environments (`nox.options.default_venv_backend = "uv"`), ensuring all session environments are created and managed with {uv}`uv-documentation`'s performance.
145
145
-**Container Build (11):** {uv}`uv-documentation` is the recommended tool for installing dependencies _inside_ the `Dockerfile` (`RUN uv sync`).
-**Description:**{unittest-documentation}`unittest` is Python's built-in testing framework, inspired by JUnit. Tests are written in classes inheriting from `unittest.TestCase`. {coverage.py}`coveragepy-documentation` is the standard standalone tool for measuring code coverage.
31
+
-**Description:**[unittest](python:unittest) is Python's built-in testing framework, inspired by JUnit. Tests are written in classes inheriting from `unittest.TestCase`. {coverage.py}`coveragepy-documentation` is the standard standalone tool for measuring code coverage.
32
32
-**Evaluation:**
33
33
34
34
-**Ease of Use:** Moderate. Requires significant boilerplate (class definitions, inheritance, specific method names, explicit `setUp`/`tearDown` methods). Writing simple tests is more verbose than alternatives.
35
35
-**Feature-Rich:** Moderate. Provides core testing features but lacks the advanced features and extensive plugin ecosystem of {pytest}`pytest-documentation` (e.g., simple functional fixtures, powerful parametrization decorators built-in).
36
36
-**Performance:** Moderate. Test execution can be slower than {pytest}`pytest-documentation` for large test suites due to its architecture (creating a class instance per test method). {coverage.py}`coveragepy-documentation` performance is generally good.
37
-
-**OS Interoperability:** Excellent. Both are foundational Python tools, highly robust across OSs. {unittest-documentation}`unittest` is standard library, {coverage.py}`coveragepy-documentation` is pure Python.
38
-
-**Integration:** High (Individual). Both have CLIs easily called from Task Automation/CI. Integrating them _together_ requires explicitly wrapping `unittest` execution with `coverage run -m unittest` or using less standardized plugins compared to the {pytest}`pytest-pytest-cov-documentation` ecosystem. Generating standard reports like JUnit XML also often requires extra steps or third-party runners for {unittest-documentation}`unittest`.
-**OS Interoperability:** Excellent. Both are foundational Python tools, highly robust across OSs. [unittest](python:unittest) is standard library, {coverage.py}`coveragepy-documentation` is pure Python.
38
+
-**Integration:** High (Individual). Both have CLIs easily called from Task Automation/CI. Integrating them _together_ requires explicitly wrapping `unittest` execution with `coverage run -m unittest` or using less standardized plugins compared to the {pytest}`pytest-pytest-cov-documentation` ecosystem. Generating standard reports like JUnit XML also often requires extra steps or third-party runners for [unittest](python:unittest).
-**Maturity & Stability:** Very High. Both are extremely mature, stable, battle-tested.
41
41
-**Community & Documentation:** Very High. Widely adopted, vast documentation.
42
42
@@ -47,9 +47,9 @@ We evaluated the primary testing framework and coverage tools:
47
47
-**Description:** A popular, feature-rich testing framework that allows writing tests using standard Python functions or methods, greatly reducing boilerplate.
48
48
-**Evaluation:**
49
49
50
-
-**Ease of Use:** Very High. Simple function-based tests (`def test_something(): assert ...`). Intuitive organization. Powerful built-in parametrization (`@pytest.mark.parametrize`). Much less boilerplate than {unittest-documentation}`unittest`.
50
+
-**Ease of Use:** Very High. Simple function-based tests (`def test_something(): assert ...`). Intuitive organization. Powerful built-in parametrization (`@pytest.mark.parametrize`). Much less boilerplate than [unittest](python:unittest).
51
51
-**Feature-Rich:** Excellent. Sophisticated fixture system, powerful parametrization, extensive plugin ecosystem for various testing needs (mocking, async, specific frameworks), robust hook system.
52
-
-**Performance:** High. Generally faster execution on large test suites than {unittest-documentation}`unittest`. Efficient test discovery.
52
+
-**Performance:** High. Generally faster execution on large test suites than [unittest](python:unittest). Efficient test discovery.
53
53
-**OS Interoperability:** Excellent. Pure Python package, works reliably across OSs.
54
54
-**Integration:** Excellent. Widely supported, integrates seamlessly into editors/IDEs, {pre-commit}`pre-commit-documentation`, Task Automation, CI/CD. Designed for external execution via CLI.
55
55
-**Reporting:** Excellent. Provides clear terminal output. Standard support for generating JUnit XML reports (`--junitxml=...`), which is essential for CI platform integration.
@@ -93,7 +93,7 @@ We evaluated the primary testing framework and coverage tools:
93
93
94
94
-**Description:** A generic virtual environment and test automation tool. Primarily used for running tests against multiple Python interpreters and dependency matrixes. Often configured via `tox.ini`. (Note: Already evaluated conceptually in Task Automation as a potential tool invoked by Nox for specific matrix needs).
95
95
-**Evaluation:**
96
-
-**Testing Framework:** Moderate. It's not a testing _framework_ like {pytest}`pytest-pytest-cov-documentation` or {unittest-documentation}`unittest`, but an _orchestrator_ that runs other tools (like `pytest`) within isolated environments. Requires learning Tox config (`tox.ini`).
96
+
-**Testing Framework:** Moderate. It's not a testing _framework_ like {pytest}`pytest-pytest-cov-documentation` or [unittest](python:unittest), but an _orchestrator_ that runs other tools (like `pytest`) within isolated environments. Requires learning Tox config (`tox.ini`).
97
97
-**Matrix Testing:** Excellent. Historically one of the best tools for defining and running tests across complex Python version and dependency variations.
98
98
-**Integration with Test Tools:** Excellent. Designed to run commands like `pytest` or `python -m unittest` within its managed environments.
99
99
-**OS Interoperability:** High. Designed for cross-platform matrix testing. Can have nuances depending on underlying shell commands in `tox.ini`.
@@ -112,13 +112,13 @@ We evaluated the primary testing framework and coverage tools:
112
112
113
113
The combination of **{pytest}`pytest-documentation`**, **{coverage.py}`coveragepy-coverage-documentation`**, and **{pytest-cov}`pytest-pytest-cov-documentation`** is the best fit for providing robust testing and coverage capabilities in this template, complemented by **{Nox}`nox-documentation`** for matrix execution:
114
114
115
-
1.**Developer Experience:** {pytest}`pytest-pytest-cov-documentation` offers significantly **easier test writing and organization** compared to {unittest-documentation}`unittest`, with powerful features like fixtures and parametrization that improve test maintainability and expressiveness (addressing **Ease of Use** and **Feature-Rich**). This aligns with the **"Obvious way to do it"** for writing tests.
115
+
1.**Developer Experience:** {pytest}`pytest-pytest-cov-documentation` offers significantly **easier test writing and organization** compared to [unittest](python:unittest), with powerful features like fixtures and parametrization that improve test maintainability and expressiveness (addressing **Ease of Use** and **Feature-Rich**). This aligns with the **"Obvious way to do it"** for writing tests.
116
116
2.**Standards and Integration:** {pytest}`pytest-pytest-cov-documentation` is the de facto standard modern Python testing framework, and {coverage.py}`coveragepy-coverage-documentation` is the universal coverage engine. **{pytest-cov}`pytest-pytest-cov-documentation`** provides **seamless, standard integration** between them via a simple command-line flag (`--cov`), making combined testing and coverage easy to run and automate (addressing **Integration**).
117
117
3.**Reporting:** This combination provides **excellent standard reporting**, including JUnit XML from {pytest}`pytest-pytest-cov-documentation` and Cobertura XML/HTML from {coverage.py}`coveragepy-coverage-documentation`, which are essential for integration into CI/CD platforms (Area 13, 14) (addressing **Reporting**).
118
118
4.**Performance & OS Interoperability:** All chosen tools are **performant** for their tasks and **highly OS-interoperable**, working reliably across development and CI environments (addressing **Performance** and **OS Interoperability**).
119
119
5.**Matrix Testing:** While {pytest}`pytest-pytest-cov-documentation` itself isn't a matrix orchestrator, **{Nox}`nox-documentation`** (Area 12) is explicitly designed to run sessions (like our test session) across different Python versions and environments using `uv`, effectively providing the necessary matrix testing capability within the template's primary automation layer. For complex scenarios or community conventions, {Nox}`nox-documentation` can easily **invoke {Tox}`tox-documentation`**.
120
120
121
-
{unittest-documentation}`unittest` was discounted due to its comparative verbosity, lack of features, and less streamlined integration for testing+coverage. {Tox}`tox-documentation` is better suited as a matrix _runner_ called by {Nox}`nox-documentation` than the primary testing _framework_ itself.
121
+
[unittest](python:unittest) was discounted due to its comparative verbosity, lack of features, and less streamlined integration for testing+coverage. {Tox}`tox-documentation` is better suited as a matrix _runner_ called by {Nox}`nox-documentation` than the primary testing _framework_ itself.
122
122
123
123
By choosing this combination, the template leverages the strengths of each tool – {pytest}`pytest-pytest-cov-documentation` for writing tests, {coverage.py}`coveragepy-coverage-documentation` for coverage, {pytest-cov}`pytest-pytest-cov-documentation` for integration, and {Nox}`nox-documentation` for orchestration – to provide a robust, modern, and well-integrated testing and coverage solution.
0 commit comments