Skip to content

Commit 8ae7ff1

Browse files
committed
Use uv, not hatch, CLI for build
Keep hatch build backend because uv's backend doesn't support vcs-based dynamic version. But remove hatch envs and use GitHub Actions matrix instead. (Assisted by Claude Code; any errors are mine.)
1 parent a560976 commit 8ae7ff1

File tree

5 files changed

+2589
-46
lines changed

5 files changed

+2589
-46
lines changed

.github/workflows/ci.yml

Lines changed: 27 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,36 @@ jobs:
2727
strategy:
2828
fail-fast: false
2929
matrix:
30-
runner: [ubuntu-latest, macos-latest, windows-latest]
31-
name: test-${{ matrix.runner }}
30+
include:
31+
# All Python versions on Ubuntu
32+
- runner: ubuntu-latest
33+
python: "3.10"
34+
- runner: ubuntu-latest
35+
python: "3.11"
36+
- runner: ubuntu-latest
37+
python: "3.12"
38+
- runner: ubuntu-latest
39+
python: "3.13"
40+
- runner: ubuntu-latest
41+
python: "3.14"
42+
# Oldest and newest Python on other platforms
43+
- runner: macos-latest
44+
python: "3.10"
45+
- runner: macos-latest
46+
python: "3.14"
47+
- runner: windows-latest
48+
python: "3.10"
49+
- runner: windows-latest
50+
python: "3.14"
51+
name: test-${{ matrix.runner }}-py${{ matrix.python }}
3252
runs-on: ${{ matrix.runner }}
3353
steps:
3454
- uses: actions/checkout@v3
3555
with:
3656
fetch-depth: 0 # Full history needed for hatch-vcs
3757
- uses: astral-sh/setup-uv@v5
38-
- name: Install hatch
39-
run: uv tool install hatch
4058
- name: Run tests
41-
run: hatch test --all
59+
run: uv run --python ${{ matrix.python }} --group test pytest
4260

4361
docs:
4462
needs:
@@ -54,10 +72,10 @@ jobs:
5472
with:
5573
fetch-depth: 0 # Full history needed for hatch-vcs
5674
- uses: astral-sh/setup-uv@v5
57-
- name: Install hatch
58-
run: uv tool install hatch
5975
- name: Build docs
60-
run: hatch run docs:build
76+
run: uv run --group docs jb build docs/
77+
env:
78+
CJDK_HIDE_PROGRESS_BARS: "1"
6179
- name: Publish to gh-pages (latest)
6280
if: >-
6381
github.repository == 'cachedjdk/cjdk' &&
@@ -101,10 +119,8 @@ jobs:
101119
with:
102120
fetch-depth: 0 # Full history needed for hatch-vcs
103121
- uses: astral-sh/setup-uv@v5
104-
- name: Install hatch
105-
run: uv tool install hatch
106122
- name: Build sdist and wheel
107-
run: hatch build
123+
run: uv build
108124
- name: Publish on PyPI
109125
if: >-
110126
github.repository == 'cachedjdk/cjdk' &&

docs/development.md

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,6 @@ git clone https://github.com/cachedjdk/cjdk.git
1313
cd cjdk
1414
```
1515

16-
Install [Hatch](https://hatch.pypa.io/):
17-
18-
```sh
19-
uv tool install hatch
20-
# Or: pipx install hatch
21-
```
22-
2316
Make sure to enable the [pre-commit](https://pre-commit.com/) Git hooks:
2417

2518
```sh
@@ -31,19 +24,13 @@ pre-commit install
3124
To run the tests:
3225

3326
```sh
34-
hatch test
35-
```
36-
37-
To run the tests as they are run by CI (all supported Python versions):
38-
39-
```sh
40-
hatch test --all
27+
uv run test pytest
4128
```
4229

4330
To build the documentation with [Jupyter Book](https://jupyterbook.org/):
4431

4532
```sh
46-
hatch run docs:build
33+
CJDK_HIDE_PROGRESS_BARS=1 uv run --group docs jb build docs/
4734
# Now view docs/_build/html/index.html
4835
```
4936

pyproject.toml

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -65,26 +65,6 @@ source = "vcs"
6565
[tool.hatch.build.hooks.vcs]
6666
version-file = "src/cjdk/_version.py"
6767

68-
[tool.hatch.envs.default]
69-
installer = "uv"
70-
71-
[tool.hatch.envs.hatch-test]
72-
installer = "uv"
73-
dependency-groups = ["test"]
74-
75-
[[tool.hatch.envs.hatch-test.matrix]]
76-
python = ["3.10", "3.11", "3.12", "3.13", "3.14"]
77-
78-
[tool.hatch.envs.docs]
79-
installer = "uv"
80-
dependency-groups = ["docs"]
81-
82-
[tool.hatch.envs.docs.scripts]
83-
build = "jb build docs/"
84-
85-
[tool.hatch.envs.docs.env-vars]
86-
CJDK_HIDE_PROGRESS_BARS = "1"
87-
8868
[tool.pytest.ini_options]
8969
testpaths = ["tests"]
9070

0 commit comments

Comments
 (0)