chore: migrate dependency management from Poetry to uv - #132
Conversation
- Move dev/docs tooling to PEP 735 [dependency-groups]; drop demo extras and all Poetry groups (demo lives in the ellphi-demo repo) - Replace poetry.lock with uv.lock; constrain numpy<2.5 in the dev lockfile until stubtest supports numpy's PEP 695 NDArray alias - Keep the poetry-core build backend so pip/uv installs still compile the C++ tangency backend; bump setuptools floor to >=78.1.1 (CVE-2025-47273, subsumes PR #126) and poetry-core to >=2.0 - Switch all four workflows to astral-sh/setup-uv with caching, uv sync/run/build; add a `uv lock --check` freshness step - Repurpose the demo-install job to smoke-test a plain sdist install - Bump codecov-action to v5 and make the upload non-blocking (#117) - Update README, CONTRIBUTING, AGENTS and docs to uv commands - Drop the ellphi.solver.MethodName stubtest allowlist entry, unused since mypy 1.20 Closes #121 Closes #117 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Pull request overview
Migrates the project’s development/dependency management workflow from Poetry to uv, updating CI and contributor docs accordingly while keeping poetry-core as the PEP 517 build backend to preserve the C++ extension build behavior.
Changes:
- Move dev/docs dependencies to PEP 735
[dependency-groups]and add uv-specific configuration inpyproject.toml. - Update GitHub Actions workflows to use
astral-sh/setup-uv@v6,uv sync,uv run, anduv build, including lockfile freshness checks. - Refresh docs/tooling guidance (README/CONTRIBUTING/AGENTS) and adjust stubtest allowlist entries.
Reviewed changes
Copilot reviewed 13 out of 15 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| stubtest-allowlist.txt | Removes an unused stubtest allowlist entry. |
| src/ellphi/_tangency_cpp.py | Updates rebuild guidance text for the C++ backend version mismatch error. |
| scripts/update_version.py | Updates usage instructions from Poetry to uv. |
| README.md | Removes demo extra install instructions and points to the external demo repo; updates source-build guidance to uv. |
| pyproject.toml | Replaces Poetry dependency groups with PEP 735 dependency-groups and adds [tool.uv] constraints; bumps build requirements. |
| docs/hybrid_tuning.md | Updates example command to use uv run. |
| docs/eigen_backend_plan.md | Updates Eigen rebuild instructions to use uv. |
| CONTRIBUTING.md | Updates contributor workflow commands from Poetry to uv (including docs group install). |
| AGENTS.md | Rewrites the local-check checklist and dependency instructions to use uv + uv.lock. |
| .github/workflows/release.yml | Switches release builds from Poetry to uv build. |
| .github/workflows/python-app.yml | Updates CI jobs to use uv for sync/run/build; adds uv lock --check; repurposes demo-install to sdist install smoke test. |
| .github/workflows/docs.yml | Switches docs build/deploy from Poetry to uv (docs dependency group). |
| .github/workflows/build-windows-wheels.yml | Switches wheel build from Poetry to uv build --wheel. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 47468c3efd
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
- scripts/hybrid_tuning.sh: migrate `poetry run` to `uv run` - docs/eigen_backend_plan.md: include ELLPHI_USE_EIGEN=1 in the rebuild command so the extension is rebuilt in Eigen mode - src/ellphi/_tangency_cpp.py: rebuild hint now covers both uv and pip (`pip install --force-reinstall .`) and uses the correct scripts/build_tangency_cpp.py path - .github/workflows/python-app.yml: fix "explicitely" typo - README.md: clarify that maintained demo notebooks live in ellphi-demo while in-repo notebooks/ examples remain but their extra dependencies are no longer declared by this package Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Summary
Migrates dependency management from Poetry to uv, per issue #121.
demooptional-dependencies extra and all[tool.poetry.group.*]groups; demo handling now lives in the separate ellphi-demo repository.[dependency-groups](devinstalled byuv syncby default,docsvia--group docs). Runtime deps stay in PEP 621[project.dependencies]; matplotlib remains a mandatory runtime dependency.[tool.poetry.build].script = "scripts/build_tangency_cpp.py"is what makes any PEP 517 install (pip, uv) compile the C++ tangency backend, so[tool.poetry]/[tool.poetry.build]and the poetry-core backend are retained (floor bumped topoetry-core>=2.0since the metadata is PEP 621). Verified empirically:uv syncand a plain sdist install both build_tangency_cpp_impl.so.setuptools>=78.1.1in[build-system]and the dev group (CVE-2025-47273) — this subsumes PR Bump setuptools minimum version to 78.1.1 #126, which can be closed once this merges.[tool.uv] constraint-dependencies = ["numpy<2.5"]: numpy 2.5 exposesNDArrayas a PEP 695 type alias that stubtest cannot verify on Python ≥ 3.12 (ellphi.FloatArray is inconsistent, runtime is not a type). This constrains only the dev lockfile; the published package keepsnumpy>=1.26. Follow-up when stubtest/numpy catch up.poetry.lockdeleted;uv.lockcommitted. CI now verifies freshness withuv lock --check(lesson from poetry.lock: demo-only transitive dependencies incorrectly listed in main group #124), and installs useuv sync --locked.astral-sh/setup-uv@v6with caching,uv sync/uv run/uv build. Job ids and check names (test (3.10..3.12),typecheck,package-test,demo-install,docs,build-windows (...),build-sdist,build-linux) are preserved for branch protection.demo-install: the demo dependency set no longer exists, so the job (name kept) is repurposed to build the sdist withuv build --sdistand smoke-test a plainpip installfrom it, verifying the C++ backend compiles from source — a path no other job covered (package-test installs the wheel).python-app.yml:codecov/codecov-actionbumpedv4.0.1 → v5and the upload step is nowcontinue-on-error: true, so a Codecov outage cannot fail CI.uv run ...),docs/hybrid_tuning.md,docs/eigen_backend_plan.md, plusscripts/update_version.pyusage text and the rebuild hint insrc/ellphi/_tangency_cpp.pyerror message.ellphi.solver.MethodNameremoved — mypy 1.20 (now locked) reports it as an unused allowlist entry, which stubtest treats as an error.ellphi._solver_python.MethodNameis still required. AGENTS.md justification section updated accordingly.Closes #121
Closes #117
Verification (local, macOS arm64, uv 0.11.8)
All commands run on this branch; every one passed:
uv sync(builds C++ backend)uv run python -m ellphi --build-info→cpp_backend_available=Trueuv run black src tests scriptsuv run black --check src tests scriptsuv run flake8 src tests scriptsuv run mypy src testsMYPYPATH=src uv run stubtest ellphi --allowlist stubtest-allowlist.txtuv run pytestuv run mkdocs builduv lock --checkuv build(sdist + wheel; sdist contains.cpp, no binaries; wheel contains.so,.pyi,py.typed)Poetry itself is not installed on this machine; per the migration's premise, no Poetry backwards compatibility was verified or intended.
Deviations / reviewer notes
flake8>=7.3.0,<8); exact pins (mkdocstrings==0.25.0,mkdocs-autorefs==1.3.1) kept as-is.numpy<2.5dev-lock constraint and the removedellphi.solver.MethodNameallowlist entry are consequences of the fresh resolution (numpy 2.5, mypy 1.20) — flagging them explicitly since they go slightly beyond a pure tooling swap.uv buildcarries the same interpreter-specific tag scheme (cp312-cp312-<platform>) poetry-core produced before, so the per-Python matrix inrelease.ymlis unchanged.🤖 Generated with Claude Code