Skip to content

Commit ff61505

Browse files
committed
second rev on dev docs
1 parent 89128c4 commit ff61505

File tree

1 file changed

+37
-36
lines changed

1 file changed

+37
-36
lines changed

docs/developers/contributing.rst

Lines changed: 37 additions & 36 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 behavior is wrong/not desired, and what you
36+
2. An explanation of why the current behaviour 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
@@ -72,7 +72,8 @@ The Zarr source code is hosted on GitHub at the following location:
7272
* `https://github.com/zarr-developers/zarr-python <https://github.com/zarr-developers/zarr-python>`_
7373

7474
You will need your own fork to work on the code. Go to the link above and hit
75-
the "Fork" button. Then clone your fork to your local machine::
75+
the `"Fork" <https://github.com/zarr-developers/zarr-python/fork>`_ button.
76+
Then clone your fork to your local machine::
7677

7778
$ git clone [email protected]:your-user-name/zarr-python.git
7879
$ cd zarr-python
@@ -81,13 +82,13 @@ the "Fork" button. Then clone your fork to your local machine::
8182
Creating a development environment
8283
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
8384

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
87-
the core developers and continuous integration services. Assuming you have a Python
88-
3 interpreter already installed, and you have cloned the Zarr source code and your
89-
current working directory is the root of the repository, you can do something like
90-
the following::
85+
To work with the Zarr source code, it is recommended to use
86+
`hatch <https://hatch.pypa.io/latest/index.html>`_ to create and manage development
87+
environments. Hatch will automatically install all Zarr dependencies using the same
88+
versions as are used by the core developers and continuous integration services.
89+
Assuming you have a Python 3 interpreter already installed, and you have cloned the
90+
Zarr source code and your current working directory is the root of the repository,
91+
you can do something like the following::
9192

9293
$ pip install hatch
9394
$ hatch env show # list all available environments
@@ -108,9 +109,7 @@ new, separate branch for each piece of work you want to do. E.g.::
108109

109110
git checkout main
110111
git fetch upstream
111-
git rebase upstream/main
112-
git push
113-
git checkout -b shiny-new-feature
112+
git checkout -b shiny-new-feature upstream/main
114113
git push -u origin shiny-new-feature
115114

116115
This changes your working directory to the 'shiny-new-feature' branch. Keep any changes in
@@ -128,26 +127,27 @@ merge conflicts, these need to be resolved before submitting a pull request.
128127
Alternatively, you can merge the changes in from upstream/main instead of rebasing,
129128
which can be simpler::
130129

131-
git fetch upstream
132-
git merge upstream/main
130+
git pull upstream main
133131

134132
Again, any conflicts need to be resolved before submitting a pull request.
135133

136134
Running the test suite
137135
~~~~~~~~~~~~~~~~~~~~~~
138136

139-
Zarr includes a suite of unit tests, as well as doctests included in
140-
function and class docstrings and in the tutorial and storage
141-
spec. The simplest way to run the unit tests is to activate your
142-
development environment (see `creating a development environment`_ above)
143-
and invoke::
137+
Zarr includes a suite of unit tests. The simplest way to run the unit tests
138+
is to activate your development environment
139+
(see `creating a development environment`_ above) and invoke::
144140

145141
$ hatch env run --env test.py3.12-2.1-optional run
146142

147143
All tests are automatically run via GitHub Actions for every pull
148144
request and must pass before code can be accepted. Test coverage is
149145
also collected automatically via the Codecov service.
150146

147+
.. note::
148+
Previous versions of Zarr-Python made extensive use of doctests. These tests were
149+
not maintained during the 3.0 refactor but may be brought back in the future.
150+
151151
Code standards - using pre-commit
152152
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
153153

@@ -175,13 +175,15 @@ If you would like to skip the failing checks and push the code for further discu
175175
the ``--no-verify`` option with ``git commit``.
176176

177177

178-
179178
Test coverage
180179
~~~~~~~~~~~~~
181180

181+
.. note::
182+
Test coverage for Zarr-Python 3 is currently not at 100%. This is a known issue and help
183+
is welcome to bring test coverage back to 100%.
184+
182185
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
184-
coverage. Running::
186+
Both unit tests and docstring doctests are included when computing coverage. Running::
185187

186188
$ hatch env run --env test.py3.12-2.1-optional run-coverage
187189

@@ -199,22 +201,28 @@ Docstrings for user-facing classes and functions should follow the
199201
`numpydoc
200202
<https://numpydoc.readthedocs.io/en/stable/format.html#docstring-standard>`_
201203
standard, including sections for Parameters and Examples. All examples
202-
should run and pass as doctests under Python 3.10.
204+
should run and pass as doctests under Python 3.11.
203205

204206
Zarr uses Sphinx for documentation, hosted on readthedocs.org. Documentation is
205207
written in the RestructuredText markup language (.rst files) in the ``docs`` folder.
206208
The documentation consists both of prose and API documentation. All user-facing classes
207-
and functions should be included in the API documentation, under the ``docs/api``
208-
folder. Any new features or important usage information should be included in the
209-
tutorial (``docs/tutorial.rst``). Any changes should also be included in the release
210-
notes (``docs/release.rst``).
209+
and functions are included in the API documentation, under the ``docs/api`` folder
210+
using the `autodoc <https://www.sphinx-doc.org/en/master/usage/extensions/autodoc.html>`_
211+
extension to sphinx. Any new features or important usage information should be included in the
212+
user-guide (``docs/user-guide``). Any changes should also be included in the release
213+
notes (``docs/developers/release.rst``).
211214

212215
The documentation can be built locally by running::
213216

214217
$ hatch --env docs run build
215218

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

221+
Hatch can also be used to serve continuously updating version of the documentation
222+
during development at `http://0.0.0.0:8000/ <http://0.0.0.0:8000/>`_. This can be done by running::
223+
224+
$ hatch --env docs run serve
225+
218226
Development best practices, policies and procedures
219227
---------------------------------------------------
220228

@@ -293,14 +301,7 @@ implements storage spec version 3, then the next library release should have ver
293301
number 3.0.0. Note however that the major version number of the Zarr library may not
294302
always correspond to the spec version number. For example, Zarr versions 2.x, 3.x, and
295303
4.x might all implement the same version of the storage spec and thus maintain data
296-
format compatibility, although they will not maintain API compatibility. The version number
297-
of the storage specification that is currently implemented is stored under the
298-
``zarr.meta.ZARR_FORMAT`` variable.
299-
300-
Note that the Zarr test suite includes a data fixture and tests to try and ensure that
301-
data format compatibility is not accidentally broken. See the
302-
:func:`test_format_compatibility` function in the :mod:`tests.test_storage` module
303-
for details.
304+
format compatibility, although they will not maintain API compatibility.
304305

305306
When to make a release
306307
~~~~~~~~~~~~~~~~~~~~~~
@@ -322,7 +323,7 @@ Release procedure
322323

323324
.. note::
324325

325-
Most of the release process is now handled by github workflow which should
326+
Most of the release process is now handled by GitHub workflow which should
326327
automatically push a release to PyPI if a tag is pushed.
327328

328329
Before releasing, make sure that all pull requests which will be

0 commit comments

Comments
 (0)