@@ -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
39393. 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
5251Enhancement proposals
5352---------------------
@@ -82,21 +81,21 @@ the "Fork" button. Then clone your fork to your local machine::
8281Creating 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
8787the core developers and continuous integration services. Assuming you have a Python
88883 interpreter already installed, and you have cloned the Zarr source code and your
8989current working directory is the root of the repository, you can do something like
9090the 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
101100Creating a branch
102101~~~~~~~~~~~~~~~~~
@@ -143,40 +142,11 @@ spec. The simplest way to run the unit tests is to activate your
143142development environment (see `creating a development environment `_ above)
144143and 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
175147All tests are automatically run via GitHub Actions for every pull
176148request 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
181151Code standards - using pre-commit
182152~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -209,11 +179,11 @@ the ``--no-verify`` option with ``git commit``.
209179Test 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
214184coverage. 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
218188will automatically run the test suite with coverage and produce a coverage report.
219189This 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> `_
231201standard, 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
238204Zarr uses Sphinx for documentation, hosted on readthedocs.org. Documentation is
239205written in the RestructuredText markup language (.rst files) in the ``docs `` folder.
@@ -245,9 +211,7 @@ notes (``docs/release.rst``).
245211
246212The 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
252216The resulting built documentation will be available in the ``docs/_build/html `` folder.
253217
0 commit comments