Skip to content

feat: Migrate from Poetry to uv#379

Open
shanyu-strix wants to merge 3 commits intousestrix:mainfrom
shanyu-strix:feat/uv
Open

feat: Migrate from Poetry to uv#379
shanyu-strix wants to merge 3 commits intousestrix:mainfrom
shanyu-strix:feat/uv

Conversation

@shanyu-strix
Copy link

Replace Poetry with uv for dependency management across the entire project: pyproject.toml (PEP 621), Makefile, Dockerfile, CI workflow, build scripts, docs, and entrypoint.

Additional fixes
Fix Textual 6.x Static.renderable removal and missing tool COPY in Dockerfile.

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Mar 20, 2026

Greptile Summary

This PR completes a full dependency-manager migration from Poetry to uv, touching the lockfile, pyproject.toml (now PEP 621), Makefile, Dockerfile, CI workflow, build scripts, docs, and entrypoint. It also bundles two correctness fixes: the Textual 6.x Static.content API rename and a missing COPY strix/tools/ layer in the Dockerfile.

The migration is well-executed and consistent across most surfaces. A few areas worth attention:

  • Makefile install / dev-install targets omit --frozen, the opposite of every other install surface in the project (scripts/build.sh, CI, and the Dockerfile all use --frozen). This is a minor but noticeable inconsistency that could cause a developer running make install to silently mutate uv.lock.
  • uv installer is unpinned in the Dockerfile (curl | sh against the floating latest URL). Pinning a uv version keeps Docker rebuilds fully reproducible, just like pinning the action version in CI.
  • Several previously-identified issues (Textual lower bound, --frozen in CI and Docker, redundant COPY strix/tools/ layers, and backward-compat handling for widget.content) have been addressed or are unchanged and tracked separately.

Confidence Score: 4/5

  • Safe to merge with minor follow-up; no runtime-breaking changes introduced by this PR.
  • The migration is correct and comprehensive — all tool invocations, CI steps, and Docker layers have been updated consistently. The two remaining concerns (unpinned uv installer in the Dockerfile and missing --frozen in Makefile targets) are reproducibility/drift issues rather than functional bugs, and neither will prevent the project from building or running correctly today.
  • Pay close attention to containers/Dockerfile (unpinned uv installer, redundant COPY layers) and Makefile (missing --frozen on install targets).

Important Files Changed

Filename Overview
.github/workflows/build-release.yml Replaced snok/install-poetry@v1 with astral-sh/setup-uv@v5; updated install/run commands to uv sync --frozen and uv run; version now extracted via grep/sed from pyproject.toml.
containers/Dockerfile Replaced Poetry installation with uv via `curl
Makefile All poetry run commands replaced with uv run; poetry install variants replaced with uv sync/uv sync --no-dev, both without --frozen, inconsistent with CI and Docker builds.
pyproject.toml Migrated from Poetry's format to PEP 621; textual lower bound correctly raised to >=6.0.0; dev dependencies moved to [dependency-groups]; build backend changed to hatchling.
scripts/build.sh Replaced poetry install/poetry run with uv sync --frozen/uv run; version extraction uses grep/sed on pyproject.toml; --frozen ensures reproducible local builds consistent with CI.
strix/interface/tui.py Updated helper at line 1075 to defensively check both .content and .renderable; lines 1169 and 1707 updated from .renderable to .content (direct access, no fallback) for Textual 6.x compatibility.

Comments Outside Diff (1)

  1. Makefile, line 78-83 (link)

    P2 --frozen missing from install and dev-install targets

    uv sync and uv sync --no-dev without --frozen will silently update uv.lock if it is out of sync with pyproject.toml. The rest of the project (scripts/build.sh, .github/workflows/build-release.yml, and the Dockerfile) all use --frozen to guarantee a reproducible install from the pinned lock file. Applying the same flag here keeps local installs consistent and surfaces stale-lock problems early instead of quietly regenerating the file.

    Prompt To Fix With AI
    This is a comment left during a code review.
    Path: Makefile
    Line: 78-83
    
    Comment:
    **`--frozen` missing from `install` and `dev-install` targets**
    
    `uv sync` and `uv sync --no-dev` without `--frozen` will silently update `uv.lock` if it is out of sync with `pyproject.toml`. The rest of the project (`scripts/build.sh`, `.github/workflows/build-release.yml`, and the Dockerfile) all use `--frozen` to guarantee a reproducible install from the pinned lock file. Applying the same flag here keeps local installs consistent and surfaces stale-lock problems early instead of quietly regenerating the file.
    
    
    
    How can I resolve this? If you propose a fix, please make it concise.
Prompt To Fix All With AI
This is a comment left during a code review.
Path: Makefile
Line: 78-83

Comment:
**`--frozen` missing from `install` and `dev-install` targets**

`uv sync` and `uv sync --no-dev` without `--frozen` will silently update `uv.lock` if it is out of sync with `pyproject.toml`. The rest of the project (`scripts/build.sh`, `.github/workflows/build-release.yml`, and the Dockerfile) all use `--frozen` to guarantee a reproducible install from the pinned lock file. Applying the same flag here keeps local installs consistent and surfaces stale-lock problems early instead of quietly regenerating the file.

```suggestion
install:
	uv sync --no-dev --frozen

dev-install:
	uv sync --frozen
```

How can I resolve this? If you propose a fix, please make it concise.

---

This is a comment left during a code review.
Path: containers/Dockerfile
Line: 73

Comment:
**Pinning uv installer version for reproducibility**

The current command fetches and executes the latest installer from `astral.sh` without pinning a version, so the installed uv version can change between builds. The `astral-sh/setup-uv` GitHub Action (already used in the CI workflow) supports a `version` input for pinning, but for the Docker layer the equivalent is to append the desired version to the install URL or to use the `UV_VERSION` env variable supported by the script:

```dockerfile
RUN curl -LsSf "https://astral.sh/uv/0.7.x/install.sh" | env UV_INSTALL_DIR=/usr/local/bin sh
```

Pinning ensures Docker image rebuilds produce the same uv binary version and makes any uv upgrade a deliberate, reviewable change.

How can I resolve this? If you propose a fix, please make it concise.

Last reviewed commit: "fix: greptile commen..."

@shanyu-strix
Copy link
Author

@greptileai please review

@shanyu-strix
Copy link
Author

@greptileai please review

shanyu-strix and others added 3 commits March 23, 2026 11:10
Replace Poetry with uv for dependency management across the entire
project: pyproject.toml (PEP 621), Makefile, Dockerfile, CI workflow,
build scripts, docs, and entrypoint. Fix Textual 6.x Static.renderable
removal and missing tool COPY in Dockerfile.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@shanyu-strix
Copy link
Author

Rebased onto main. @0xallam please review

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