Skip to content

Commit b895af1

Browse files
committed
Add a build target for the docs
Generate the documentation with `hatch run docs:build $TYPE`
1 parent af9b6ff commit b895af1

File tree

2 files changed

+17
-13
lines changed

2 files changed

+17
-13
lines changed

doc/hacking/contributing.rst

+8-13
Original file line numberDiff line numberDiff line change
@@ -30,26 +30,22 @@ Python sources
3030
The code base follows `pep8 <https://www.python.org/dev/peps/pep-0008/>`_ guidelines with lines
3131
wrapping at the 79th character. You can verify that the code follows the conventions with::
3232

33-
$ pycodestyle --ignore=E252,W503,W504 spinach tests
33+
$ hatch run pep8
3434

3535
Running tests is an invaluable help when adding a new feature or when refactoring. Try to add the
36-
proper test cases in ``tests/`` together with your patch. The test suite can be run with pytest::
36+
proper test cases in ``tests/`` together with your patch. Because the Redis broker tests require
37+
a running Redis server, there is a convenience `pyproject.toml` that runs all the tests and pep8
38+
checks for you after starting Redis in a container via docker-compose. Simply running::
3739

38-
$ pytest tests
39-
40-
Because the Redis broker tests require a running Redis server, there is also a convenience
41-
`tox.ini` that runs all the tests and pep8 checks for you after starting Redis in a container via
42-
docker-compose. Simply running::
43-
44-
$ tox
40+
$ hatch run py3
4541

4642
will build a virtualenv, install Spinach and its dependencies into it, start the Redis server in
47-
the container, and run tests and pycodestyle, tearing down the Redis server container when done.
43+
the container, and run tests and pep8, tearing down the Redis server container when done.
4844

4945
Compatibility
5046
-------------
5147

52-
Spinach runs on all versions of Python starting from 3.6. Tests are run via GitHub actions to
48+
Spinach runs on all versions of Python starting from 3.8. Tests are run via GitHub actions to
5349
ensure that.
5450

5551
Documentation sources
@@ -61,7 +57,6 @@ with `Sphinx <http://www.sphinx-doc.org/en/stable/index.html>`_.
6157

6258
If you modify the docs, make sure it builds without errors::
6359

64-
$ cd doc/
65-
$ make html
60+
$ hatch run docs:build html
6661

6762
The generated HTML pages should land in ``doc/_build/html``.

pyproject.toml

+9
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,15 @@ scripts.py3 = [
8686
# A minimalist pytest runner for Github to use
8787
scripts.ci = ["pytest -v --cov=spinach tests {args}"]
8888

89+
[tool.hatch.envs.docs]
90+
detatched = true
91+
dependencies = [
92+
"sphinx",
93+
"blinker"
94+
]
95+
path = ".hatch"
96+
scripts.build = ["cd doc && make {args}"]
97+
8998
[tool.ruff.lint]
9099
select = ["B", "C9", "D", "E", "F", "S", "W"]
91100
ignore = [

0 commit comments

Comments
 (0)