Skip to content

Migrate from Poetry to uv#274

Merged
BrianPugh merged 1 commit into
mainfrom
poetry-to-uv
Jul 6, 2026
Merged

Migrate from Poetry to uv#274
BrianPugh merged 1 commit into
mainfrom
poetry-to-uv

Conversation

@BrianPugh

Copy link
Copy Markdown
Owner

Replace Poetry/poetry-dynamic-versioning with uv as the package manager and setuptools + setuptools-scm + Cython as the build backend:

  • pyproject.toml: PEP 621 [project] metadata, PEP 735 [dependency-groups], and [tool.uv] cache-keys so uv sync rebuilds the Cython extension whenever its sources change.
  • build.py -> setup.py (same extension config); add MANIFEST.in for sdists.
  • Version derived from git tags via setuptools-scm, exposed at runtime through importlib.metadata.
  • bootstrap installs uv instead of Poetry; Cython support is now wired by default and stripped when declined.
  • CI: astral-sh/setup-uv with locked syncs; lint/docs split out of the test matrix with cancel-in-progress concurrency; PyPI Trusted Publishing (OIDC) replaces PYPI_TOKEN; wheel builds gated to compiled-code changes on PRs; native ubuntu-24.04-arm runners replace QEMU for aarch64 wheels; lightweight pre-commit hooks move to pre-commit.ci.
  • Support window bumped to Python 3.10-3.14 (cibuildwheel v3.2).
  • Dependabot: uv + github-actions ecosystems with grouped minor/patch PRs.
  • Dockerfile/ReadTheDocs converted to uv; .dockerignore no longer ships the local venv and build artifacts.

Claude-Session: https://claude.ai/code/session_01UarJmE1ctKM1J5U8oSMVEY

Replace Poetry/poetry-dynamic-versioning with uv as the package manager
and setuptools + setuptools-scm + Cython as the build backend:

- pyproject.toml: PEP 621 [project] metadata, PEP 735 [dependency-groups],
  and [tool.uv] cache-keys so `uv sync` rebuilds the Cython extension
  whenever its sources change.
- build.py -> setup.py (same extension config); add MANIFEST.in for sdists.
- Version derived from git tags via setuptools-scm, exposed at runtime
  through importlib.metadata.
- bootstrap installs uv instead of Poetry; Cython support is now wired by
  default and stripped when declined.
- CI: astral-sh/setup-uv with locked syncs; lint/docs split out of the test
  matrix with cancel-in-progress concurrency; PyPI Trusted Publishing (OIDC)
  replaces PYPI_TOKEN; wheel builds gated to compiled-code changes on PRs;
  native ubuntu-24.04-arm runners replace QEMU for aarch64 wheels;
  lightweight pre-commit hooks move to pre-commit.ci.
- Support window bumped to Python 3.10-3.14 (cibuildwheel v3.2).
- Dependabot: uv + github-actions ecosystems with grouped minor/patch PRs.
- Dockerfile/ReadTheDocs converted to uv; .dockerignore no longer ships
  the local venv and build artifacts.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UarJmE1ctKM1J5U8oSMVEY
@BrianPugh BrianPugh marked this pull request as ready for review July 6, 2026 14:25
@BrianPugh BrianPugh requested a review from Copilot July 6, 2026 14:25
@BrianPugh BrianPugh merged commit d91cfdf into main Jul 6, 2026
17 checks passed
@BrianPugh BrianPugh deleted the poetry-to-uv branch July 6, 2026 14:29

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR migrates the template from Poetry/poetry-dynamic-versioning to uv for dependency management and to a setuptools + setuptools-scm + Cython build backend, updating developer workflows and CI/CD to match.

Changes:

  • Replace Poetry-based packaging with PEP 621/735 metadata in pyproject.toml, setup.py for the Cython extension, and versioning via setuptools-scm + importlib.metadata.
  • Update automation (GitHub Actions, Dependabot, pre-commit, bootstrap, Docker, ReadTheDocs) to use uv and modernize release publishing (OIDC / trusted publishing).
  • Remove Poetry artifacts and adjust docs/readme for the new workflow and updated Python support window.

Reviewed changes

Copilot reviewed 17 out of 20 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
setup.py Adds setuptools-based Cython extension build configuration.
README.rst Updates template documentation to reference uv, setuptools-scm, and trusted publishing.
pythontemplate/init.py Switches runtime version lookup to importlib.metadata.
pyproject.toml Migrates to PEP 621/735 metadata; switches build backend to setuptools + setuptools-scm + Cython and configures uv.
poetry.lock Removes Poetry lockfile.
MANIFEST.in Ensures Cython/C sources are included in sdists.
docs/source/Installation.rst Updates installation/dev instructions for uv and Python >=3.10.
Dockerfile Switches container build to use uv and a newer Ubuntu base image.
build.py Removes Poetry-era build script.
bootstrap Updates bootstrap flow to install/use uv and adjusts Cython opt-in/out behavior.
.readthedocs.yaml Updates RTD build to use uv and newer build image/tooling.
.pre-commit-config.yaml Adds uv lock hook and configures pre-commit.ci behavior.
.gitignore Updates ignored files for uv and wheelhouse artifacts.
.github/workflows/tests.yaml Reworks CI to use uv (locked sync), splits lint/docs from test matrix, adds concurrency control.
.github/workflows/deploy.yaml Switches deploy workflow to uv build/publish and OIDC permissions.
.github/workflows/build_wheels.yaml Updates cibuildwheel config, adds concurrency and PR-path gating, modernizes build matrix.
.github/dependabot.yml Migrates Dependabot to uv + github-actions ecosystems with grouping.
.github/contributing.md Updates contributor docs to use uv commands.
.dockerignore Stops shipping local venv/build artifacts into Docker context and ignores common caches/artifacts.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread pyproject.toml
description = ""
authors = ["YOUR_NAME_HERE"]
authors = [{name = "YOUR_NAME_HERE"}]
license = "Apache-2.0"
python -m pip install git+https://github.com/GIT_USERNAME/GIT_REPONAME.git

For development, its recommended to use Poetry:
For development, its recommended to use uv:
Comment thread .github/contributing.md
To confirm docstrings are valid, build the docs by running `poetry run make html` in the `docs/` folder.
To confirm docstrings are valid, build the docs by running `uv run make html` in the `docs/` folder.

I typically write dosctrings first, it will act as a guide to limit scope and encourage unit-testable code.
Comment thread .readthedocs.yaml
Comment on lines +13 to +16
pre_create_environment:
- asdf plugin add uv
- asdf install uv latest
- asdf global uv latest
BrianPugh added a commit that referenced this pull request Jul 6, 2026
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UarJmE1ctKM1J5U8oSMVEY
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants