Skip to content

Commit 5fb034e

Browse files
aepfliclaude
andcommitted
build: add uv.lock for reproducible Python builds
Add uv.lock file and update workflow to use uv's dependency groups for reproducible, locked dependency installation in CI and local dev. Changes: - Add dependency-groups.dev in pyproject.toml (maturin, pytest) - Generate uv.lock with locked dependency versions - Update CI to use 'uv sync --group dev' instead of 'uv pip install' - Update all documentation to use 'uv sync --group dev' Benefits: - Reproducible builds across environments - Faster CI runs with locked dependencies - Automatic venv creation with 'uv sync' - No manual pip install or venv creation needed The lock file ensures all developers and CI use identical dependency versions, preventing "works on my machine" issues. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent 755498e commit 5fb034e

6 files changed

Lines changed: 291 additions & 12 deletions

File tree

.github/workflows/ci.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,7 @@ jobs:
131131
- name: Install dependencies and build package
132132
run: |
133133
cd python
134-
uv venv
135-
uv pip install maturin pytest
134+
uv sync --group dev
136135
source .venv/bin/activate
137136
maturin develop
138137

CLAUDE.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -328,11 +328,10 @@ python/
328328
# Install uv
329329
curl -LsSf https://astral.sh/uv/install.sh | sh
330330

331-
# Set up development environment
331+
# Set up development environment (installs deps and creates venv)
332332
cd python
333-
uv venv
333+
uv sync --group dev
334334
source .venv/bin/activate
335-
uv pip install maturin pytest
336335

337336
# Build and install locally
338337
maturin develop

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,9 +194,8 @@ curl -LsSf https://astral.sh/uv/install.sh | sh
194194

195195
# Set up development environment
196196
cd python
197-
uv venv
197+
uv sync --group dev
198198
source .venv/bin/activate
199-
uv pip install maturin pytest
200199
maturin develop
201200
pytest tests/ -v
202201
```

python/README.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -166,17 +166,14 @@ See [benchmarks/bench_vs_wasm.py](benchmarks/bench_vs_wasm.py) for detailed comp
166166
# Install uv (if not already installed)
167167
curl -LsSf https://astral.sh/uv/install.sh | sh
168168

169-
# Create virtual environment
169+
# Install dependencies (creates venv automatically)
170170
cd python
171-
uv venv
171+
uv sync --group dev
172172

173173
# Activate virtual environment
174174
source .venv/bin/activate # On Unix/macOS
175175
# .venv\Scripts\activate # On Windows
176176

177-
# Install dependencies and build package
178-
uv pip install maturin pytest
179-
180177
# Build and install the package in development mode
181178
maturin develop
182179

python/pyproject.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,9 @@ classifiers = [
2222

2323
[tool.maturin]
2424
features = ["pyo3/extension-module"]
25+
26+
[dependency-groups]
27+
dev = [
28+
"maturin>=1.0,<2.0",
29+
"pytest>=7.0",
30+
]

0 commit comments

Comments
 (0)