Skip to content

Migrate from rye to uv for dependency management#282

Open
x wants to merge 2 commits intomainfrom
x/rye-to-uv
Open

Migrate from rye to uv for dependency management#282
x wants to merge 2 commits intomainfrom
x/rye-to-uv

Conversation

@x
Copy link
Contributor

@x x commented Mar 7, 2026

Rye is deprecated in favor of uv. Replace all rye usage with uv equivalents:

  • pyproject.toml: [tool.rye][tool.uv], merge dev-dependencies into
    [dependency-groups] dev, remove [tool.rye.scripts]
  • Shell scripts: rye runuv run with inlined commands
  • CI workflows: rye installastral-sh/setup-uv@v5 action
  • Dev container: install uv instead of rye
  • Delete requirements.lock and requirements-dev.lock (replaced by uv.lock)
  • Update bootstrap script
  • Update all docs, AI assistant configs, and cursor rules

This is definitely a more involved change, no rush on the review.

Greptile Summary

This PR completes a clean migration from the deprecated rye tool to uv for dependency management, environment setup, and script execution across the entire repository. The changes are consistent and well-scoped: pyproject.toml consolidates the two separate dev-dependency lists into a single [dependency-groups] dev block, CI workflows swap the manual curl | bash rye bootstrap for the astral-sh/setup-uv@v5 action, shell scripts inline the old rye run <alias> calls as direct uv run invocations, and all documentation/AI assistant configs are updated to match.

Key changes:

  • pyproject.toml: [tool.rye][tool.uv], both dev-dependency lists merged into one [dependency-groups] dev, [tool.rye.scripts] removed (scripts now live in shell files directly)
  • CI workflows: rye install removed; all three jobs now use astral-sh/setup-uv@v5
  • bin/publish-pypi: rye build --clean + rye publish --yesuv build --clean + uv publish --token; the --yes flag is unnecessary for uv publish which is non-interactive by default
  • scripts/bootstrap: simplified to a pre-flight uv availability check + uv sync --all-groups
  • .devcontainer/Dockerfile: uses COPY --from=ghcr.io/astral-sh/uv:latest — the only minor concern is the unpinned latest tag (old rye was pinned to 0.44.0)
  • All docs (CLAUDE.md, CONTRIBUTING.md, cursor rules, README files) updated consistently

Confidence Score: 5/5

  • This PR is safe to merge — it is a mechanical tooling migration with no changes to library code or public API.
  • All rye usages have been replaced with correct uv equivalents, dev-dependency lists are fully preserved, CI and publish pipelines are functionally equivalent, and docs/configs are consistent. The only minor concern is the unpinned uv:latest in the devcontainer Dockerfile, which does not affect CI or production.
  • .devcontainer/Dockerfile — uses unpinned uv:latest image tag; consider pinning to a specific version for reproducible devcontainer builds.

Important Files Changed

Filename Overview
pyproject.toml Moves from [tool.rye] to [tool.uv], merges dev-dependencies from both the old [tool.rye] block and the pre-existing [dependency-groups] dev list into a single [dependency-groups] dev, and removes [tool.rye.scripts] in favour of shell scripts. All dependencies are preserved; [build-system] is simply reordered.
.github/workflows/ci.yml Replaces `curl
.github/workflows/publish-pypi.yml Replaces rye bootstrap with astral-sh/setup-uv@v5; publish logic lives in bin/publish-pypi and is unchanged structurally.
bin/publish-pypi Replaces rye build --clean and rye publish --yes with uv build --clean and uv publish --token $PYPI_TOKEN. Functionally equivalent; uv publish is non-interactive by default so --yes is not needed.
.devcontainer/Dockerfile Switches from `curl
scripts/bootstrap Removes optional Homebrew bundle step and rye config call; simply checks that uv is already installed and runs uv sync --all-groups. Cleaner and correct.
scripts/lint Inlines rye run lint / rye run fix:ruff as direct uv run ruff and uv run pyright calls. Behaviour is equivalent: non-fix path runs ruff + pyright + importability check; fix path only runs ruff check --fix.
scripts/format Inlines the rye run format chain as explicit uv run ruff format, uv run python ruffen-docs.py, uv run ruff check --fix, uv run ruff format steps. Behaviour is identical to the old rye script chain.
scripts/test Single-line change replacing rye run pytest with uv run pytest. No functional change.
.claude/settings.json Updates allowed bash command patterns from rye run * to equivalent uv run * / uv sync / uv build permissions. Also adds a trailing newline.
CLAUDE.md All command references updated from rye to uv equivalents, trailing whitespace cleaned up, and a trailing newline added. Accurate and complete.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Developer / CI] --> B{Environment setup}
    B -->|Local| C["scripts/bootstrap\nuv sync --all-groups"]
    B -->|CI| D["astral-sh/setup-uv@v5\nuv sync --all-groups"]
    B -->|Devcontainer| E["Dockerfile\nCOPY uv from ghcr.io/astral-sh/uv:latest\nuv sync --all-groups"]

    C & D & E --> F[.venv ready]

    F --> G[scripts/test\nuv run pytest]
    F --> H[scripts/lint\nuv run ruff check + uv run pyright]
    F --> I[scripts/format\nuv run ruff format/check]
    F --> J[uv build]
    J --> K[bin/publish-pypi\nuv publish --token]
Loading

Last reviewed commit: 2ca7af4

x added 2 commits March 6, 2026 20:30
Rye is deprecated in favor of uv (its successor from the same maintainers).
Replace all rye usage with uv equivalents:

- pyproject.toml: [tool.rye] → [tool.uv], merge dev-dependencies into
  [dependency-groups] dev, remove [tool.rye.scripts]
- Shell scripts: rye run → uv run with inlined commands
- CI workflows: rye install → astral-sh/setup-uv@v5 action
- Dev container: install uv instead of rye
- Brewfile: brew "uv"
- Delete requirements.lock and requirements-dev.lock (replaced by uv.lock)
- Update all docs, AI assistant configs, and cursor rules
uv should be installed via the standard installer, not Homebrew.
Bootstrap now checks for uv and directs users to the install docs.
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