Skip to content

Migrate from poetry to uv with a 7-day dependency cooldown - #380

Merged
CodexVeritas merged 2 commits into
mainfrom
claude/migrate-poetry-to-uv-5bf16b
Oct 23, 2026
Merged

CodexVeritas merged 2 commits into
mainfrom
claude/migrate-poetry-to-uv-5bf16b

Conversation

@CodexVeritas

@CodexVeritas CodexVeritas commented Oct 23, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Switches the project's package manager from poetry to uv, and adds a 7-day supply-chain cooldown for dependency resolution.

  • Same resolved versions, no dependency upgrades. uv.lock was seeded from poetry.lock, so every package is at the same version poetry installed on Python < 3.14 (the versions CI uses). Upgrades can come in a separate PR with uv lock --upgrade.
  • 7-day cooldown. [tool.uv] exclude-newer = "7 days" makes uv only resolve package files uploaded at least a week ago. The lock records the span (exclude-newer-span = "P7D"), not a fixed date, so uv sync --locked stays valid from day to day.
  • pyproject.toml is now PEP 621. Caret constraints became explicit ranges with the same bounds. Extras moved to [project.optional-dependencies], the dev group to [dependency-groups], and scripts to [project.scripts].
  • Build backend is now hatchling. The wheel contains exactly the same package files as before (JSON/JSONL data included) and the source-archive entry point is unchanged. Small metadata differences:
    • The license is declared as License-Expression: MIT instead of a license classifier.
    • Requires-Python is >=3.11 (the <4.0 cap is dropped).
    • The sdist now also includes .gitignore.
    • The Python version classifiers that poetry used to add automatically (3, 3.11–3.14) are now listed explicitly.

CI

  • setup-uv is pinned to v10.3.0. The action publishes no floating major tag. This is the newest release that is at least 7 days old.
  • One astral-sh/setup-uv step replaces the old poetry install. That removes the install, the sleep, the two retry steps and the .venv cache. The retry steps were added because the poetry installer sometimes failed. setup-uv downloads uv from GitHub releases and caches uv's package cache, keyed on uv.lock.
  • The setup-python version is passed to setup-uv (python-version, which sets UV_PYTHON). This makes uv use that interpreter and never pick a different one.
  • Workflows install without the project, as before. They run uv sync --locked --no-install-project, which matches the old poetry install --no-root. Unit tests add --all-extras. Commands run via uv run --no-sync.

Other

  • One test file is reformatted. Black now reads requires-python from [project] and targets 3.11+, so test_file_manipulation.py now uses parenthesized context managers.
  • The devcontainer postinstall.sh now installs uv instead of poetry and runs uv sync --all-extras.
  • README / README.ipynb setup instructions, the optional-extra error message, the AskNews install hint and the bot-failure skill docs now give uv commands.
  • Publishing is now uv build + uv publish, and version bumps use uv version --bump patch.

Testing

  • Unit tests on a fresh Python 3.12.3 environment with all extras: 1022 passed, 141 skipped.
  • A fresh base-only install (the same one the bot workflows use) imports run_bots correctly.
  • uv build output was diffed against a poetry build of the previous commit: the wheel's package files are identical.
  • uv run source-archive --help works.
  • Pre-commit hooks pass.

🤖 Generated with Claude Code

CodexVeritas and others added 2 commits October 23, 2026 15:01
Convert pyproject.toml to PEP 621 metadata with a hatchling build backend,
replace poetry.lock with uv.lock (same resolved versions), and add a 7-day
exclude-newer cooldown so uv only resolves package files that are at least
a week old. CI, the devcontainer, docs, and install hints now use uv.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
setup-uv publishes no floating major tag, so `@v10` failed to resolve.
Black now reads requires-python from [project] and targets 3.11+, which
reformats one test into parenthesized context managers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@CodexVeritas
CodexVeritas merged commit 352921c into main Oct 23, 2026
2 checks passed
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.

1 participant