Skip to content

Commit 89128c4

Browse files
committed
docs: consolidate developer docs + update contributing page for v3
1 parent 01bc352 commit 89128c4

File tree

6 files changed

+31
-56
lines changed

6 files changed

+31
-56
lines changed

docs/conf.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,8 @@
9191
"spec/v3": "https://zarr-specs.readthedocs.io/en/latest/v3/core/v3.0.html",
9292
"license": "https://github.com/zarr-developers/zarr-python/blob/main/LICENSE.txt",
9393
"tutorial": "user-guide",
94+
"release": "developers/release.html",
95+
"roadmap": "developers/roadmap.html",
9496
}
9597

9698
# The language for content autogenerated by Sphinx. Refer to documentation

docs/contributing.rst renamed to docs/developers/contributing.rst

Lines changed: 17 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ a bug report:
3333
# etc.
3434
```
3535

36-
2. An explanation of why the current behaviour is wrong/not desired, and what you
36+
2. An explanation of why the current behavior is wrong/not desired, and what you
3737
expect instead.
3838

3939
3. Information about the version of Zarr, along with versions of dependencies and the
@@ -46,8 +46,7 @@ a bug report:
4646
interpreter can be obtained by running a Python interactive session, e.g.::
4747

4848
$ python
49-
Python 3.6.1 (default, Mar 22 2017, 06:17:05)
50-
[GCC 6.3.0 20170321] on linux
49+
Python 3.12.7 | packaged by conda-forge | (main, Oct 4 2024, 15:57:01) [Clang 17.0.6 ] on darwin
5150

5251
Enhancement proposals
5352
---------------------
@@ -82,21 +81,21 @@ the "Fork" button. Then clone your fork to your local machine::
8281
Creating a development environment
8382
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
8483

85-
To work with the Zarr source code, it is recommended to set up a Python virtual
86-
environment and install all Zarr dependencies using the same versions as are used by
84+
To work with the Zarr source code, it is recommended to use `hatch
85+
<https://hatch.pypa.io/latest/index.html>`_ to create a virtual environment and
86+
install all Zarr dependencies using the same versions as are used by
8787
the core developers and continuous integration services. Assuming you have a Python
8888
3 interpreter already installed, and you have cloned the Zarr source code and your
8989
current working directory is the root of the repository, you can do something like
9090
the following::
9191

92-
$ mkdir -p ~/pyenv/zarr-dev
93-
$ python -m venv ~/pyenv/zarr-dev
94-
$ source ~/pyenv/zarr-dev/bin/activate
95-
$ pip install -e .[test,docs]
92+
$ pip install hatch
93+
$ hatch env show # list all available environments
9694

97-
To verify that your development environment is working, you can run the unit tests::
95+
To verify that your development environment is working, you can run the unit tests
96+
for one of the test environments, e.g.::
9897

99-
$ python -m pytest -v tests
98+
$ hatch env run --env test.py3.12-2.1-optional run
10099

101100
Creating a branch
102101
~~~~~~~~~~~~~~~~~
@@ -143,40 +142,11 @@ spec. The simplest way to run the unit tests is to activate your
143142
development environment (see `creating a development environment`_ above)
144143
and invoke::
145144

146-
$ python -m pytest -v zarr
147-
148-
Some tests require optional dependencies to be installed, otherwise
149-
the tests will be skipped. To install all optional dependencies, run::
150-
151-
$ pip install pytest-doctestplus
152-
153-
To also run the doctests within docstrings (requires optional
154-
dependencies to be installed), run::
155-
156-
$ python -m pytest -v --doctest-plus zarr
157-
158-
To run the doctests within the tutorial and storage spec (requires
159-
optional dependencies to be installed), run::
160-
161-
$ python -m doctest -o NORMALIZE_WHITESPACE -o ELLIPSIS docs/tutorial.rst docs/spec/v2.rst
162-
163-
Note that some tests also require storage services to be running
164-
locally. To run the Azure Blob Service storage tests, run an Azure
165-
storage emulator (e.g., azurite) and set the environment variable
166-
``ZARR_TEST_ABS=1``. If you're using Docker to run azurite, start the service with::
167-
168-
docker run --rm -p 10000:10000 mcr.microsoft.com/azure-storage/azurite azurite-blob --loose --blobHost 0.0.0.0
169-
170-
To run the Mongo DB storage tests, run a Mongo
171-
server locally and set the environment variable ``ZARR_TEST_MONGO=1``.
172-
To run the Redis storage tests, run a Redis server locally on port
173-
6379 and set the environment variable ``ZARR_TEST_REDIS=1``.
145+
$ hatch env run --env test.py3.12-2.1-optional run
174146

175147
All tests are automatically run via GitHub Actions for every pull
176148
request and must pass before code can be accepted. Test coverage is
177-
also collected automatically via the Codecov service, and total
178-
coverage over all builds must be 100% (although individual builds
179-
may be lower due to Python 2/3 or other differences).
149+
also collected automatically via the Codecov service.
180150

181151
Code standards - using pre-commit
182152
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -209,11 +179,11 @@ the ``--no-verify`` option with ``git commit``.
209179
Test coverage
210180
~~~~~~~~~~~~~
211181

212-
Zarr maintains 100% test coverage under the latest Python stable release (currently
213-
Python 3.8). Both unit tests and docstring doctests are included when computing
182+
Zarr strives to maintain 100% test coverage under the latest Python stable release
183+
(currently Python 3.12). Both unit tests and docstring doctests are included when computing
214184
coverage. Running::
215185

216-
$ python -m pytest -v --cov=zarr --cov-config=pyproject.toml zarr
186+
$ hatch env run --env test.py3.12-2.1-optional run-coverage
217187

218188
will automatically run the test suite with coverage and produce a coverage report.
219189
This should be 100% before code can be accepted into the main code base.
@@ -229,11 +199,7 @@ Docstrings for user-facing classes and functions should follow the
229199
`numpydoc
230200
<https://numpydoc.readthedocs.io/en/stable/format.html#docstring-standard>`_
231201
standard, including sections for Parameters and Examples. All examples
232-
should run and pass as doctests under Python 3.8. To run doctests,
233-
activate your development environment, install optional requirements,
234-
and run::
235-
236-
$ python -m pytest -v --doctest-plus tests
202+
should run and pass as doctests under Python 3.10.
237203

238204
Zarr uses Sphinx for documentation, hosted on readthedocs.org. Documentation is
239205
written in the RestructuredText markup language (.rst files) in the ``docs`` folder.
@@ -245,9 +211,7 @@ notes (``docs/release.rst``).
245211

246212
The documentation can be built locally by running::
247213

248-
$ cd docs
249-
$ make clean; make html
250-
$ open _build/html/index.html
214+
$ hatch --env docs run build
251215

252216
The resulting built documentation will be available in the ``docs/_build/html`` folder.
253217

docs/developers/index.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
2+
Developer's Guide
3+
-----------------
4+
5+
.. toctree::
6+
:maxdepth: 1
7+
8+
contributing
9+
release
10+
roadmap
File renamed without changes.
File renamed without changes.

docs/index.rst

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,8 @@ Zarr-Python
1111
getting_started
1212
user-guide/index
1313
api/index
14-
release
15-
contributing
16-
roadmap
14+
developers/index
15+
developers/release
1716

1817
**Version**: |version|
1918

0 commit comments

Comments
 (0)