Skip to content

Commit 1865042

Browse files
weiji14negin513
andauthored
Move test extras to PEP 735 dependency groups (#88)
* Move test requirements to dependency-groups Xref https://peps.python.org/pep-0735 and https://packaging.python.org/en/latest/specifications/dependency-groups/#dependency-groups. Added missing netcdf4 and pooch dependencies, and updated contributing guide's testing section. * Rename conda environment name to just cupy-xarray Consolidate to just a single ci/doc.yml conda environment file. Not sure where ci/requirements/environment.yml came from. * Apply suggestion from @negin513 --------- Co-authored-by: Negin Sobhani <negins@ucar.edu>
1 parent bc4df72 commit 1865042

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

ci/doc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: cupy-xarray-doc
1+
name: cupy-xarray
22
channels:
33
- conda-forge
44
dependencies:

docs/source/contributing.rst

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ First we'll create and activate the build environment:
6868

6969
.. code-block:: sh
7070
71-
conda env create --file ci/requirements/environment.yml
72-
conda activate cupy-xarray-tests
71+
conda env create --file ci/doc.yml
72+
conda activate cupy-xarray
7373
7474
At this point you should be able to import *cupy-xarray* from your locally
7575
built version.
@@ -130,8 +130,10 @@ Running the test suite
130130
----------------------
131131

132132
*cupy-xarray* uses the `pytest <https://docs.pytest.org/en/latest/contents.html>`_
133-
framework for testing. You can run the test suite using::
133+
framework for testing. You'll need to install some dependencies and then run the test
134+
suite like so::
134135

136+
pip install --group test
135137
pytest --doctest-modules cupy_xarray
136138

137139
Contributing documentation
@@ -140,11 +142,11 @@ Contributing documentation
140142
We greatly appreciate documentation improvements. The docs are built from the docstrings
141143
in the code and the docs in the ``docs`` directory.
142144

143-
To build the documentation, you will need to requirements listed in ``ci/doc.yml``.
145+
To build the docs, you will need to install the requirements listed in ``ci/doc.yml``.
144146
You can create an environment for building the documentation using::
145147

146148
conda env create --file ci/doc.yml
147-
conda activate cupy-xarray-doc
149+
conda activate cupy-xarray
148150

149151
You can then build the documentation using::
150152

pyproject.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,12 @@ dependencies = [
2020
]
2121

2222
[project.optional-dependencies]
23+
24+
[dependency-groups]
2325
test = [
2426
"dask",
27+
"netcdf4",
28+
"pooch",
2529
"pytest",
2630
]
2731

0 commit comments

Comments
 (0)