Skip to content

Commit 974c06c

Browse files
authored
chore/update hatch + use dependency groups (#3728)
1 parent 879e1ce commit 974c06c

File tree

11 files changed

+100
-106
lines changed

11 files changed

+100
-106
lines changed

.github/workflows/codspeed.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ jobs:
3131
with:
3232
python-version: "3.11"
3333
- name: Install Hatch
34-
run: |
35-
python -m pip install --upgrade pip
36-
pip install hatch
34+
uses: pypa/hatch@257e27e51a6a5616ed08a39a408a21c35c9931bc
35+
with:
36+
version: '1.16.5'
3737
- name: Run the benchmarks
3838
uses: CodSpeedHQ/action@v4
3939
with:

.github/workflows/gpu_test.yml

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,12 @@ concurrency:
1919

2020
jobs:
2121
test:
22-
name: py=${{ matrix.python-version }}, deps=${{ matrix.dependency-set }}
22+
name: py=${{ matrix.python-version }}
2323

2424
runs-on: gpu-runner
2525
strategy:
2626
matrix:
2727
python-version: ['3.11']
28-
dependency-set: ["minimal"]
2928

3029
steps:
3130
- uses: actions/checkout@v6
@@ -54,17 +53,17 @@ jobs:
5453
with:
5554
python-version: ${{ matrix.python-version }}
5655
cache: 'pip'
57-
- name: Install Hatch and CuPy
58-
run: |
59-
python -m pip install --upgrade pip
60-
pip install hatch
56+
- name: Install Hatch
57+
uses: pypa/hatch@257e27e51a6a5616ed08a39a408a21c35c9931bc
58+
with:
59+
version: '1.16.5'
6160
- name: Set Up Hatch Env
6261
run: |
63-
hatch env create gputest.py${{ matrix.python-version }}-${{ matrix.dependency-set }}
64-
hatch env run -e gputest.py${{ matrix.python-version }}-${{ matrix.dependency-set }} list-env
62+
hatch env create gputest.py${{ matrix.python-version }}
63+
hatch env run -e gputest.py${{ matrix.python-version }} list-env
6564
- name: Run Tests
6665
run: |
67-
hatch env run --env gputest.py${{ matrix.python-version }}-${{ matrix.dependency-set }} run-coverage-gpu
66+
hatch env run --env gputest.py${{ matrix.python-version }} run-coverage
6867
6968
- name: Upload coverage
7069
uses: codecov/codecov-action@13ce06bfc6bbe3ecf90edbbf1bc32fe5978ca1d3 # v5.3.1

.github/workflows/hypothesis.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ jobs:
4141
python-version: ${{ matrix.python-version }}
4242
cache: 'pip'
4343
- name: Install Hatch
44-
run: |
45-
python -m pip install --upgrade pip
46-
pip install hatch
44+
uses: pypa/hatch@257e27e51a6a5616ed08a39a408a21c35c9931bc
45+
with:
46+
version: '1.16.5'
4747
- name: Set Up Hatch Env
4848
run: |
4949
hatch env create test.py${{ matrix.python-version }}-${{ matrix.dependency-set }}

.github/workflows/nightly_wheels.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ jobs:
2222
with:
2323
python-version: '3.13'
2424

25-
- name: Install build dependencies
26-
run: |
27-
python -m pip install --upgrade pip
28-
pip install hatch
25+
- name: Install Hatch
26+
uses: pypa/hatch@257e27e51a6a5616ed08a39a408a21c35c9931bc
27+
with:
28+
version: '1.16.5'
2929

3030
- name: Build wheel and sdist
3131
run: hatch build

.github/workflows/releases.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ jobs:
2121
with:
2222
python-version: '3.11'
2323

24-
- name: Install PyBuild
25-
run: |
26-
python -m pip install --upgrade pip
27-
pip install hatch
24+
- name: Install Hatch
25+
uses: pypa/hatch@257e27e51a6a5616ed08a39a408a21c35c9931bc
26+
with:
27+
version: '1.16.5'
2828
- name: Build wheel and sdist
2929
run: hatch build
3030
- uses: actions/upload-artifact@v6

.github/workflows/test.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,9 @@ jobs:
5151
python-version: ${{ matrix.python-version }}
5252
cache: 'pip'
5353
- name: Install Hatch
54-
run: |
55-
python -m pip install --upgrade pip
56-
pip install hatch
54+
uses: pypa/hatch@257e27e51a6a5616ed08a39a408a21c35c9931bc
55+
with:
56+
version: '1.16.5'
5757
- name: Set Up Hatch Env
5858
run: |
5959
hatch env create test.py${{ matrix.python-version }}-${{ matrix.dependency-set }}
@@ -93,9 +93,9 @@ jobs:
9393
python-version: ${{ matrix.python-version }}
9494
cache: 'pip'
9595
- name: Install Hatch
96-
run: |
97-
python -m pip install --upgrade pip
98-
pip install hatch
96+
uses: pypa/hatch@257e27e51a6a5616ed08a39a408a21c35c9931bc
97+
with:
98+
version: '1.16.5'
9999
- name: Set Up Hatch Env
100100
run: |
101101
hatch env create ${{ matrix.dependency-set }}
@@ -122,9 +122,9 @@ jobs:
122122
python-version: '3.13'
123123
cache: 'pip'
124124
- name: Install Hatch
125-
run: |
126-
python -m pip install --upgrade pip
127-
pip install hatch
125+
uses: pypa/hatch@257e27e51a6a5616ed08a39a408a21c35c9931bc
126+
with:
127+
version: '1.16.5'
128128
- name: Set Up Hatch Env
129129
run: |
130130
hatch run doctest:pip list

.readthedocs.yaml

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ build:
55
tools:
66
python: "3.12"
77
jobs:
8+
install:
9+
- pip install --upgrade pip
10+
- pip install .[remote] --group docs
811
pre_build:
912
- |
1013
if [ "$READTHEDOCS_VERSION_TYPE" != "tag" ];
@@ -16,11 +19,3 @@ build:
1619
- mkdocs build --strict --site-dir $READTHEDOCS_OUTPUT/html
1720
mkdocs:
1821
configuration: mkdocs.yml
19-
20-
python:
21-
install:
22-
- method: pip
23-
path: .
24-
extra_requirements:
25-
- docs
26-
- remote

changes/3728.misc.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Move development dependencies (`test`, `remote_tests`, `docs`, `dev`) from optional dependencies to [dependency groups](https://packaging.python.org/en/latest/specifications/dependency-groups/). This may cause breakage for anyone who used e.g. `pip install zarr[test]` to get access to test dependencies. To install these dependency groups from a local checkout, use `pip install --group <name>` (pip 25.1+) or `uv run --group <name>`.

docs/contributing.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ hatch env show # list all available environments
6464
To verify that your development environment is working, you can run the unit tests for one of the test environments, e.g.:
6565

6666
```bash
67-
hatch env run --env test.py3.12-2.2-optional run-pytest
67+
hatch env run --env test.py3.12-optional run
6868
```
6969

7070
### Creating a branch
@@ -102,7 +102,7 @@ Again, any conflicts need to be resolved before submitting a pull request.
102102
Zarr includes a suite of unit tests. The simplest way to run the unit tests is to activate your development environment (see [creating a development environment](#creating-a-development-environment) above) and invoke:
103103

104104
```bash
105-
hatch env run --env test.py3.12-2.2-optional run-pytest
105+
hatch env run --env test.py3.12-optional run
106106
```
107107

108108
All tests are automatically run via GitHub Actions for every pull request and must pass before code can be accepted. Test coverage is also collected automatically via the Codecov service.
@@ -164,15 +164,15 @@ If you would like to skip the failing checks and push the code for further discu
164164
Zarr strives to maintain 100% test coverage under the latest Python stable release. Both unit tests and docstring doctests are included when computing coverage. Running:
165165

166166
```bash
167-
hatch env run --env test.py3.12-2.2-optional run-coverage
167+
hatch env run --env test.py3.12-optional run-coverage
168168
```
169169

170170
will automatically run the test suite with coverage and produce an XML coverage report. This should be 100% before code can be accepted into the main code base.
171171

172172
You can also generate an HTML coverage report by running:
173173

174174
```bash
175-
hatch env run --env test.py3.12-2.2-optional run-coverage-html
175+
hatch env run --env test.py3.12-optional run-coverage-html
176176
```
177177

178178
When submitting a pull request, coverage will also be collected across all supported Python versions via the Codecov service, and will be reported back within the pull request. Codecov coverage must also be 100% before code can be accepted.

0 commit comments

Comments
 (0)