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
Poetry is outdated and PEP621 un-compliant.
Note, `uv sync` will fail currently, due to the lower Python 3.8 requirement. This will be updated in a follow-up
To run testing and documentation building, `tox <https://tox.readthedocs.io/>`__ is used:
50
49
51
-
.. code-block:: bash
50
+
.. code-block:: bash
52
51
53
-
pre-commit install
52
+
tox -av # to see all environments
54
53
54
+
Note, it is recommended to also install the `tox-uv <https://github.com/tox-dev/tox-uv>`__ plugin, which will use `uv` to create isolated environments faster, and to use `pyenv <https://github.com/pyenv/pyenv>`__ to manage multiple Python versions.
55
55
56
56
Build docs
57
57
----------
58
-
To build the **Sphinx-Needs** documentation stored under ``/docs``, run:
59
-
60
-
.. code-block:: bash
61
58
62
-
# Build HTML pages
63
-
make docs-html
64
-
65
-
or
59
+
To build the **Sphinx-Needs** documentation stored under ``/docs``, run:
66
60
67
61
.. code-block:: bash
68
62
69
-
# Build PDF pages
70
-
make docs-pdf
71
-
72
-
It will always perform a **clean** build (calls ``make clean`` before the build).
73
-
If you want to avoid this, run the related sphinx-commands directly under ``/docs`` (e.g. ``make docs``).
63
+
# Build HTML pages with the furo theme,
64
+
# and first remove all old build files
65
+
CLEAN=true tox -e docs-furo
74
66
75
-
Check links in docs
76
-
~~~~~~~~~~~~~~~~~~~~
77
-
To check if all used links in the documentation are still valid, run:
67
+
or to build with a different builder:
78
68
79
69
.. code-block:: bash
80
70
81
-
make docs-linkcheck
71
+
# Check links in the documentation
72
+
CLEAN=true BUILDER=linkcheck tox -e docs-furo
82
73
83
74
84
75
Running Tests
@@ -90,11 +81,11 @@ You can either run the tests directly using ``pytest``, in an existing environme
90
81
91
82
pytest tests/
92
83
93
-
Or you can use the provided Makefile:
84
+
Or use tox (recommended):
94
85
95
86
.. code-block:: bash
96
87
97
-
make test
88
+
tox -e py38
98
89
99
90
Note some tests use `syrupy <https://github.com/tophat/syrupy>`__ to perform snapshot testing.
100
91
These snapshots can be updated by running:
@@ -208,99 +199,28 @@ You can run the ``make test-js`` command to check all JS testcases.
208
199
The ``http_server`` process invoked by the ``make test-js`` command may not terminate properly in some instances.
209
200
Kindly check your system's monitoring app to end the process if not terminated automatically.
210
201
211
-
Linting & Formatting
212
-
--------------------
213
-
214
-
**Sphinx-Needs** uses `pre-commit <https://pre-commit.com/>`__ to run formatting and checking of source code.
215
-
This can be run directly using:
216
-
217
-
.. code-block:: bash
218
-
219
-
pre-commit run --all-files
220
-
221
-
or via the provided Makefile:
222
-
223
-
.. code-block:: bash
224
-
225
-
make lint
226
-
227
202
Benchmarks
228
203
----------
204
+
229
205
**Sphinx-Needs** own documentation is used for creating a benchmark for each PR.
230
206
If the runtime takes 10% longer as the previous ones, the benchmark test will fail.
231
207
232
208
Benchmark test cases are available under ``tests/benchmarks``.
233
-
And they can be locally executed via ``make benchmark``.
234
209
235
210
The results for each PR/commit get added to a chart, which is available under
0 commit comments