Skip to content

Commit 20f8c8d

Browse files
committed
docs: add contribution guidlines for extras
1 parent 237279a commit 20f8c8d

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

CONTRIBUTING.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,10 @@ For specific test markers:
112112
uv run pytest -m "cpu and not slow"
113113
```
114114

115+
#### Adding tests that need optional extras
116+
117+
If a test needs an optional dependency group, add the extra in `pyproject.toml` under `[project.optional-dependencies]`, register a matching `requires_<extra>` marker in `tests/conftest.py`, and mark the tests with it. Add the extra to the test workflow matrix with its install option and marker filter, for example `extras: "--extra my-extra"` and `mark_filter: "requires_my_extra"`. Tests without optional extras are selected with `no_extras`.
118+
115119
#### If you used Option B (pip/conda):
116120

117121
```bash

docs/contributions/how_to_contribute.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,12 @@ For specific test markers:
131131
132132
uv run pytest -m "cpu and not slow"
133133
134+
**Adding tests that need optional extras**
135+
136+
If a test needs an optional dependency group, add the extra in ``pyproject.toml`` under ``[project.optional-dependencies]``, register a matching ``requires_<extra>`` marker in ``tests/conftest.py``, and mark the tests with it.
137+
Add the extra to the test workflow matrix with its install option and marker filter, for example ``extras: "--extra my-extra"`` and ``mark_filter: "requires_my_extra"``.
138+
Tests without optional extras are selected with ``no_extras``.
139+
134140
**If you used Option B (pip/conda):**
135141

136142
.. code-block:: bash

0 commit comments

Comments
 (0)