Skip to content

fix: extend setuptools<82 retry to pyproject.toml apps#272

Merged
socksy merged 1 commit intodevelopfrom
fixes/setuptools-retry-pyproject
May 5, 2026
Merged

fix: extend setuptools<82 retry to pyproject.toml apps#272
socksy merged 1 commit intodevelopfrom
fixes/setuptools-retry-pyproject

Conversation

@socksy
Copy link
Copy Markdown
Contributor

@socksy socksy commented Apr 28, 2026

Summary

The legacy-setuptools retry added in #270 only kicked in for requirements.txt projects — pyproject.toml apps that needed pkg_resources (setuptools<82) at install time had no recovery path and just failed.

uv sync can't accept a CLI constraint, so the retry now drops out of uv sync into uv pip install with the project source (. for pyproject, -r requirements.txt otherwise) plus a setuptools<82 arg. Both kinds of project get the same fallback.

The call site in tower-runtime is now if res != 0 { retry } — no file-type knowledge — and the file-type branch lives inline in sync_with_legacy_setuptools_pin where the command args are built. should_use_legacy_setuptools_pin and spawn_requirements_install are gone; a small run_setup_child helper dedupes the stdout/stderr drain + wait between the initial install and the retry.

Test plan

  • cargo test -p tower-uv --test sync_test (7 tests, including two new pyproject ones)
  • Verified the new pyproject tests fail when production code is reverted (negative control)

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 28, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: bd1eb532-6c39-4e9e-9c6e-1afc14edad50

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fixes/setuptools-retry-pyproject

Comment @coderabbitai help to get the list of available commands and usage tips.

@socksy socksy requested review from bradhe and konstantinoscs and removed request for bradhe April 28, 2026 12:12
The legacy-setuptools retry only fired for requirements.txt projects, leaving pyproject.toml apps with no recovery path when their builds needed pkg_resources. The retry now drops out of uv sync into uv pip install with the project source (. for pyproject, -r requirements.txt otherwise) plus a setuptools<82 arg, so both kinds of project get the same fallback.

Removes the should_use_legacy_setuptools_pin predicate and the spawn_requirements_install helper — the call site in tower-runtime is now just 'if res != 0 { retry }', and the file-type branch lives inline where the args are built.
@socksy socksy force-pushed the fixes/setuptools-retry-pyproject branch from 3e7358a to 659d756 Compare April 28, 2026 12:21
@socksy socksy requested a review from bradhe April 28, 2026 12:21
@socksy socksy requested a review from sammuti May 5, 2026 13:24
Copy link
Copy Markdown
Contributor

@sammuti sammuti left a comment

Choose a reason for hiding this comment

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

LGTM

@socksy socksy merged commit ae8d2cb into develop May 5, 2026
30 checks passed
@socksy socksy deleted the fixes/setuptools-retry-pyproject branch May 5, 2026 13:35
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