alunduil / alunduil/zfs-replicate

uv replaces Poetry as the package manager, lockfile, and build backend

Ouverte
#619 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
enhancement python
Langage dominant
Python
Étoiles
24
Forks
6
Merge moyen
3 h 11 min
PR mergées (30 j)
49

Description

## Summary

Replace Poetry with `uv` throughout: `uv.lock` for `poetry.lock`, `uv sync` for
`poetry install`, `[project.dependencies]` for `[tool.poetry.dependencies]`, and
a `uv`-native build backend for `poetry-core`. Leave no Poetry behind.

## Motivation

Found while resolving #430.

This project already runs `uv` in CI. `ci.yml:25` uses
`tox-dev/action-pre-commit-uv`, so every pull request installs `uv` and then
separately installs Poetry through `.github/actions/setup-poetry`. Two Python
tool stacks cover one job.

The cost is concentrated in CI time. `python-tests` and `cli-entry-point` are
four-leg matrices apiece, so a pull request pays for eight `poetry install` runs
(`ci.yml:52`, `ci.yml:89`) before any test executes. Resolution and installation
are the slowest part of those jobs and the part `uv` improves most. #616 covers
folding those matrices together and reduces but does not remove the duplication.

Metadata gets simpler rather than harder. `pyproject.toml:10` currently declares
`dynamic = ["classifiers", "dependencies"]` so Poetry can generate classifiers
and keep its own dependency syntax. Under `uv`, dependencies become static
`[project.dependencies]` and the test group becomes a PEP 735
`[dependency-groups]` table, which drops the indirection and the comment
explaining it.

Set against that, the current setup works, and this touches CI, the
devcontainer, the release path, and the docs at once. It is worth doing when
there is appetite for the churn, not urgently.

## Scope

- `pyproject.toml`: static `[project.dependencies]`, `[dependency-groups]` for
the test group, drop `dynamic`, move `packages` (`pyproject.toml:43`) to the
chosen backend's equivalent so the sdist keeps carrying `zfs_test`.
- Generate `uv.lock`; delete `poetry.lock` and `poetry.toml`.
- Pick a build backend (`uv_build` or `hatchling`) and retire `poetry-core`.
- CI: replace `.github/actions/setup-poetry` with `astral-sh/setup-uv`, and
every `poetry install` / `poetry run` call in `ci.yml` and `release.yml`.
- `.devcontainer/devcontainer.json` and `.devcontainer/post-create.sh`: swap the
Poetry feature for `uv`.
- Docs: `README.md:62-63`, `CONTRIBUTING.md`, `CLAUDE.md`'s tool inventory, and
the Poetry reference in `.github/ISSUE_TEMPLATE/bug-report.yml`.
- `.claude/settings.json`: the pre-approved `poetry run pytest` permission.

## Acceptance criteria

- [ ] No file outside `CHANGELOG.md` mentions Poetry
- [ ] `uv sync` and `uv run pytest` reproduce the current suite result
- [ ] `uv build` produces an sdist containing both `zfs/` and `zfs_test/`, which
#498 checks
- [ ] Release publishing still works end to end

## Additional context

#618 tracks the nixpkgs derivation, which sets `build-system = [poetry-core]`
and needs updating with the backend change.

#616 and #558 both restructure the CI jobs this touches, so sequencing matters.

Dropping this project's Nix expressions in #617 removed the other argument for
moving, namely that `poetry2nix` is unmaintained while `uv2nix` is the maintained
path. That reasoning no longer applies; the case here is tooling count and CI
time.

Guide de contribution

Ouvrir le guide de contribution

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.