Skip to content

refactor: remove deprecated req.url (build-from-URL) code paths#1260

Open
rd4398 wants to merge 1 commit into
python-wheel-build:mainfrom
rd4398:depricate-req-url
Open

refactor: remove deprecated req.url (build-from-URL) code paths#1260
rd4398 wants to merge 1 commit into
python-wheel-build:mainfrom
rd4398:depricate-req-url

Conversation

@rd4398

@rd4398 rd4398 commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

Remove PEP 508 direct reference URL support (pkg @ git+https://...) which was deprecated in proposal #1225. The source provider config system covers all use cases declaratively without special-casing.

This removes:

  • 19 if req.url: branches across 6 source files
  • _resolve_version_from_git_url(), _get_version_from_package_metadata(), _prepare_build_dependencies(), _handle_build_requirements() methods
  • SourceType.GIT enum value and get_top_level_requirement() method
  • extend_known_versions() public method and git URL guard in resolver
  • 6 e2e test scripts, 11 unit tests, and all git URL documentation

Retained: gitutils.py and downloads.download_git_source() which are used by git-clone source providers (pypi-git, github-tag-git, etc.).

Closes: #1220
Closes: #1225

@rd4398
rd4398 requested a review from a team as a code owner July 19, 2026 22:03
@coderabbitai

coderabbitai Bot commented Jul 19, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@rd4398, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 58 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 9b2bbb7b-0916-483d-ab2e-a633b2846f67

📥 Commits

Reviewing files that changed from the base of the PR and between 1131caf and ecede64.

📒 Files selected for processing (28)
  • docs/customization.md
  • docs/example/git-submodules-example.yaml
  • docs/example/requirements-git-example.txt
  • docs/how-tos/build-from-git-repo.rst
  • docs/how-tos/index.rst
  • e2e/ci_bootstrap_parallel_suite.sh
  • e2e/ci_bootstrap_suite.sh
  • e2e/ci_build_suite.sh
  • e2e/test_bootstrap_git_url.sh
  • e2e/test_bootstrap_git_url_tag.sh
  • e2e/test_bootstrap_parallel_git_url.sh
  • e2e/test_bootstrap_parallel_git_url_tag.sh
  • e2e/test_build_sequence_git_url.sh
  • e2e/test_mode_build.sh
  • e2e/test_version_env_git_url.sh
  • src/fromager/bootstrap_requirement_resolver.py
  • src/fromager/bootstrapper/_bootstrapper.py
  • src/fromager/commands/build.py
  • src/fromager/constraints.py
  • src/fromager/dependency_graph.py
  • src/fromager/requirements_file.py
  • src/fromager/sources.py
  • tests/test_bootstrap.py
  • tests/test_bootstrap_requirement_resolver.py
  • tests/test_bootstrapper.py
  • tests/test_constraints.py
  • tests/test_packagesettings.py
  • tests/test_sources.py
📝 Walkthrough

Walkthrough

The change removes dedicated direct Git URL resolution and build-dependency preparation from bootstrapping. Source download, preparation, source typing, and sdist building now use provider and override mechanisms. Build commands use pinned package versions instead of URL-bearing top-level requirements, and Git source types and graph helpers are removed. Resolver cache behavior and provider routing receive updated tests. Git URL end-to-end tests and related documentation are removed or revised.

Estimated code review effort: 4 (Complex) | ~45 minutes

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The PR removes the git URL special-casing and related docs/tests, which addresses both the duplicate extraction bug and direct-reference deprecation.
Out of Scope Changes check ✅ Passed The changes stay focused on removing req.url support and related cleanup; no unrelated code paths stand out.
Title check ✅ Passed The title clearly summarizes the main change: removing deprecated req.url build-from-URL code paths.
Description check ✅ Passed The description is directly aligned with the changeset and accurately summarizes the removed URL-specific support.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@mergify mergify Bot added the ci label Jul 19, 2026

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
src/fromager/bootstrap_requirement_resolver.py (1)

27-39: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Stale docstring: Git URL resolution no longer "stays in Bootstrapper."

This docstring still claims git URL resolution is handled by Bootstrapper, but per this PR's own objective, Bootstrapper-specific Git URL version discovery and build-dependency preparation are removed entirely, not relocated. Leaves a misleading breadcrumb for future readers.

📝 Proposed docstring fix
-    Git URL resolution is NOT handled here - that stays in Bootstrapper
-    because it requires BuildEnvironment and build dependencies.
+    Direct Git URL (PEP 508) resolution is no longer supported; use a
+    declarative ``source`` provider (e.g. ``pypi-git``) instead.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/fromager/bootstrap_requirement_resolver.py` around lines 27 - 39, Update
the BootstrapRequirementResolver class docstring to remove the claim that Git
URL resolution stays in Bootstrapper. State only the currently supported
resolution responsibilities and strategies, without implying that removed
Bootstrapper-specific Git URL handling was relocated.
src/fromager/sources.py (1)

68-105: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Missing docstrings on public functions.

get_source_type and download_source are public functions with no docstrings. As per coding guidelines, **/*.py: "Add docstrings to all public functions and classes."

📝 Proposed docstrings
 def get_source_type(ctx: context.WorkContext, req: Requirement) -> SourceType:
+    """Determine how this requirement's source should be provided (sdist vs. override)."""
     source_type = SourceType.SDIST
 def download_source(
     *,
     ctx: context.WorkContext,
     req: Requirement,
     version: Version,
     download_url: str,
 ) -> pathlib.Path:
+    """Download the source distribution for ``req``, delegating to any package override."""
     logger.info(f"downloading source for {req}")
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/fromager/sources.py` around lines 68 - 105, Add docstrings to the public
functions get_source_type and download_source in src/fromager/sources.py,
describing their purpose, parameters, and return values. Keep their existing
behavior and implementation unchanged.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/customization.md`:
- Around line 246-247: Update the customization documentation example near the
resolve-phase note to remove “git-URL bootstrapping” terminology. Reword it
around provider-based bootstrapping and replace the example host with a reserved
.example domain, while preserving the surrounding explanation that the version
is unavailable during resolve.

---

Outside diff comments:
In `@src/fromager/bootstrap_requirement_resolver.py`:
- Around line 27-39: Update the BootstrapRequirementResolver class docstring to
remove the claim that Git URL resolution stays in Bootstrapper. State only the
currently supported resolution responsibilities and strategies, without implying
that removed Bootstrapper-specific Git URL handling was relocated.

In `@src/fromager/sources.py`:
- Around line 68-105: Add docstrings to the public functions get_source_type and
download_source in src/fromager/sources.py, describing their purpose,
parameters, and return values. Keep their existing behavior and implementation
unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 9519e03e-79d3-4fcd-aa0f-f167c7f073ea

📥 Commits

Reviewing files that changed from the base of the PR and between 6e4e93a and 1131caf.

📒 Files selected for processing (26)
  • docs/customization.md
  • docs/example/git-submodules-example.yaml
  • docs/example/requirements-git-example.txt
  • docs/how-tos/build-from-git-repo.rst
  • docs/how-tos/index.rst
  • e2e/ci_bootstrap_parallel_suite.sh
  • e2e/ci_bootstrap_suite.sh
  • e2e/ci_build_suite.sh
  • e2e/test_bootstrap_git_url.sh
  • e2e/test_bootstrap_git_url_tag.sh
  • e2e/test_bootstrap_parallel_git_url.sh
  • e2e/test_bootstrap_parallel_git_url_tag.sh
  • e2e/test_build_sequence_git_url.sh
  • e2e/test_version_env_git_url.sh
  • src/fromager/bootstrap_requirement_resolver.py
  • src/fromager/bootstrapper/_bootstrapper.py
  • src/fromager/commands/build.py
  • src/fromager/constraints.py
  • src/fromager/dependency_graph.py
  • src/fromager/requirements_file.py
  • src/fromager/sources.py
  • tests/test_bootstrap.py
  • tests/test_bootstrap_requirement_resolver.py
  • tests/test_constraints.py
  • tests/test_packagesettings.py
  • tests/test_sources.py
💤 Files with no reviewable changes (18)
  • docs/example/requirements-git-example.txt
  • docs/example/git-submodules-example.yaml
  • e2e/test_bootstrap_git_url_tag.sh
  • e2e/test_bootstrap_parallel_git_url_tag.sh
  • e2e/test_bootstrap_git_url.sh
  • docs/how-tos/index.rst
  • e2e/test_bootstrap_parallel_git_url.sh
  • docs/how-tos/build-from-git-repo.rst
  • e2e/ci_build_suite.sh
  • e2e/test_version_env_git_url.sh
  • e2e/test_build_sequence_git_url.sh
  • e2e/ci_bootstrap_parallel_suite.sh
  • src/fromager/requirements_file.py
  • src/fromager/dependency_graph.py
  • e2e/ci_bootstrap_suite.sh
  • tests/test_sources.py
  • tests/test_bootstrap_requirement_resolver.py
  • src/fromager/bootstrapper/_bootstrapper.py

Comment thread docs/customization.md
@rd4398
rd4398 force-pushed the depricate-req-url branch from 7095d4b to 4aa3efe Compare July 19, 2026 22:41

@dhellmann dhellmann left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is making the code so much simpler, thank you. I had a couple of small questions inline.

Comment thread src/fromager/bootstrap_requirement_resolver.py
Comment thread src/fromager/constraints.py
@rd4398
rd4398 force-pushed the depricate-req-url branch from c32c6f6 to f46742c Compare July 20, 2026 13:54
@dhellmann

Copy link
Copy Markdown
Member

I'm happy with this version, but I'll leave it open for the rest of the team to review.

Comment thread src/fromager/constraints.py
Comment thread src/fromager/bootstrapper/_bootstrapper.py
Remove PEP 508 direct reference URL support (`pkg @ git+https://...`)
which was deprecated in proposal python-wheel-build#1225. The `source` provider config
system covers all use cases declaratively without special-casing.

This removes:
- 19 `if req.url:` branches across 6 source files
- `_resolve_version_from_git_url()`, `_get_version_from_package_metadata()`,
  `_prepare_build_dependencies()`, `_handle_build_requirements()` methods
- `SourceType.GIT` enum value and `get_top_level_requirement()` method
- `extend_known_versions()` public method and git URL guard in resolver
- 6 e2e test scripts, 11 unit tests, and all git URL documentation

Retained: `gitutils.py` and `downloads.download_git_source()` which are
used by git-clone source providers (`pypi-git`, `github-tag-git`, etc.).

Closes: python-wheel-build#1220
Closes: python-wheel-build#1225

Co-Authored-By: Claude <claude@anthropic.com>
Signed-off-by: Rohan Devasthale <rdevasth@redhat.com>

Co-Authored-By: Claude <claude@anthropic.com>
Signed-off-by: Rohan Devasthale <rdevasth@redhat.com>
@rd4398
rd4398 force-pushed the depricate-req-url branch from 27a94b4 to ecede64 Compare July 20, 2026 17:21

@smoparth smoparth left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Refactor]: Git URL path duplicates build dependency extraction with iterative phase machine

3 participants