@@ -90,10 +90,9 @@ you have cloned the Zarr source code and your current working directory is the r
90
90
the repository, you can do something like the following::
91
91
92
92
$ mkdir -p ~/pyenv/zarr-dev
93
- $ virtualenv --no-site-packages --python=/usr/bin/python3.6 ~/pyenv/zarr-dev
93
+ $ virtualenv --no-site-packages --python=/usr/bin/python3.7 ~/pyenv/zarr-dev
94
94
$ source ~/pyenv/zarr-dev/bin/activate
95
- $ pip install -r requirements_dev.txt
96
- $ pip install -r requirements_dev_optional.txt
95
+ $ pip install -r requirements_dev_minimal.txt -r requirements_dev_numpy.txt
97
96
$ pip install -e .
98
97
99
98
To verify that your development environment is working, you can run the unit tests::
@@ -139,34 +138,44 @@ Again, any conflicts need to be resolved before submitting a pull request.
139
138
Running the test suite
140
139
~~~~~~~~~~~~~~~~~~~~~~
141
140
142
- Zarr includes a suite of unit tests, as well as doctests included in function and class
143
- docstrings and in the tutorial and storage spec. The simplest way to run the unit tests
144
- is to invoke::
141
+ Zarr includes a suite of unit tests, as well as doctests included in
142
+ function and class docstrings and in the tutorial and storage
143
+ spec. The simplest way to run the unit tests is to activate your
144
+ development environment (see `creating a development environment `_ above)
145
+ and invoke::
145
146
146
147
$ pytest -v zarr
147
148
148
- To also run the doctests within docstrings, run::
149
-
150
- $ pytest -v --doctest-modules zarr
149
+ Some tests require optional dependencies to be installed, otherwise
150
+ the tests will be skipped. To install all optional dependencies, run::
151
151
152
- To run the doctests within the tutorial and storage spec, run::
152
+ $ pip install -r requirements_dev_optional.txt
153
153
154
- $ python -m doctest -o NORMALIZE_WHITESPACE -o ELLIPSIS docs/tutorial.rst docs/spec/v2.rst
154
+ To also run the doctests within docstrings (requires optional
155
+ depencies to be installed), run::
155
156
156
- Tests can be run under different Python versions using tox. E.g. (assuming you have the
157
- corresponding Python interpreters installed on your system)::
157
+ $ pytest -v --doctest-plus zarr
158
158
159
- $ tox -e py27,py34,py35,py36
159
+ To run the doctests within the tutorial and storage spec (requires
160
+ optional dependencies to be installed), run::
160
161
161
- Zarr currently supports Python 2.7 and Python 3.4-3.6, so the above command must
162
- succeed before code can be accepted into the main code base. Note that only the py36
163
- tox environment runs the doctests, i.e., doctests only need to succeed under Python 3.6.
162
+ $ python -m doctest -o NORMALIZE_WHITESPACE -o ELLIPSIS docs/tutorial.rst docs/spec/v2.rst
164
163
165
- All tests are automatically run via Travis (Linux) and AppVeyor (Windows) continuous
166
- integration services for every pull request. Tests must pass under both services before
167
- code can be accepted. Test coverage is also collected automatically via the Coveralls
168
- service, and total coverage over all builds must be 100% (although individual builds
169
- may be lower due to Python 2/3 or other differences).
164
+ Note that some tests also require storage services to be running
165
+ locally. To run the Azure Blob Service storage tests, run an Azure
166
+ storage emulator (e.g., azurite) and set the environment variable
167
+ ``ZARR_TEST_ABS=1 ``. To run the Mongo DB storage tests, run a Mongo
168
+ server locally and set the environment variable ``ZARR_TEST_MONGO=1 ``.
169
+ To run the Redis storage tests, run a Redis server locally on port
170
+ 6379 and set the environment variable ``ZARR_TEST_REDIS=1 ``.
171
+
172
+ All tests are automatically run via Travis (Linux) and AppVeyor
173
+ (Windows) continuous integration services for every pull
174
+ request. Tests must pass under both Travis and Appveyor before code
175
+ can be accepted. Test coverage is also collected automatically via the
176
+ Coveralls service, and total coverage over all builds must be 100%
177
+ (although individual builds may be lower due to Python 2/3 or other
178
+ differences).
170
179
171
180
Code standards
172
181
~~~~~~~~~~~~~~
@@ -177,8 +186,6 @@ Conformance can be checked by running::
177
186
178
187
$ flake8 --max-line-length=100 zarr
179
188
180
- This is automatically run when invoking ``tox -e py36 ``.
181
-
182
189
Test coverage
183
190
~~~~~~~~~~~~~
184
191
@@ -195,10 +202,15 @@ request. Coveralls coverage must also be 100% before code can be accepted.
195
202
Documentation
196
203
~~~~~~~~~~~~~
197
204
198
- Docstrings for user-facing classes and functions should follow the `numpydoc
199
- <https://github.com/numpy/numpy/blob/master/doc/HOWTO_DOCUMENT.rst.txt> `_ standard,
200
- including sections for Parameters and Examples. All examples should run and pass as doctests
201
- under Python 3.6 only.
205
+ Docstrings for user-facing classes and functions should follow the
206
+ `numpydoc
207
+ <https://github.com/numpy/numpy/blob/master/doc/HOWTO_DOCUMENT.rst.txt> `_
208
+ standard, including sections for Parameters and Examples. All examples
209
+ should run and pass as doctests under Python 3.7. To run doctests,
210
+ activate your development environment, install optional requirements,
211
+ and run::
212
+
213
+ $ pytest -v --doctest-plus zarr
202
214
203
215
Zarr uses Sphinx for documentation, hosted on readthedocs.org. Documentation is
204
216
written in the RestructuredText markup language (.rst files) in the ``docs `` folder.
@@ -208,7 +220,7 @@ folder. Any new features or important usage information should be included in th
208
220
tutorial (``docs/tutorial.rst ``). Any changes should also be included in the release
209
221
notes (``docs/release.rst ``).
210
222
211
- The documentation can be built by running::
223
+ The documentation can be built locally by running::
212
224
213
225
$ tox -e docs
214
226
0 commit comments