Skip to content

feat(finders): add PyPICacheProvider for cache server lookups#1143

Merged
mergify[bot] merged 1 commit into
python-wheel-build:mainfrom
tiran:feat/dedicate-pypi-cache-provider
May 12, 2026
Merged

feat(finders): add PyPICacheProvider for cache server lookups#1143
mergify[bot] merged 1 commit into
python-wheel-build:mainfrom
tiran:feat/dedicate-pypi-cache-provider

Conversation

@tiran
Copy link
Copy Markdown
Collaborator

@tiran tiran commented May 12, 2026

Pull Request Description

What

Add a dedicated PyPICacheProvider that wraps PyPIProvider with a simplified interface for Fromager's local PyPI-compatible cache server. This makes it explicit that packages are coming from a cache server rather than an upstream index, and eliminates cache-irrelevant options like ignore_platform, override_download_url, cooldown, and supports_upload_time.

The provider enforces that include_wheels and include_sdists are mutually exclusive and defaults to wheels only.

Use PyPICacheProvider in _download_wheel_from_cache to replace the direct PyPIProvider instantiation.

Why

Avoid confusion between pre-built, upstream PyPI and internal cache indexes.

@tiran tiran requested a review from a team as a code owner May 12, 2026 11:56
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 12, 2026

Warning

Rate limit exceeded

@tiran has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 33 minutes and 14 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 3f442547-ddba-41e5-b10d-76dd8bb801d1

📥 Commits

Reviewing files that changed from the base of the PR and between 7b10135 and e2ed294.

📒 Files selected for processing (4)
  • src/fromager/bootstrapper.py
  • src/fromager/finders.py
  • tests/test_bootstrapper.py
  • tests/test_finders.py

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 and usage tips.

@mergify mergify Bot added the ci label May 12, 2026
Comment thread src/fromager/finders.py
Add a dedicated PyPICacheProvider that wraps PyPIProvider with a
simplified interface for Fromager's local PyPI-compatible cache server.
This makes it explicit that packages are coming from a cache server
rather than an upstream index, and eliminates cache-irrelevant options
like ignore_platform, override_download_url, cooldown, and
supports_upload_time.

The provider enforces that include_wheels and include_sdists are
mutually exclusive and defaults to wheels only.

Use PyPICacheProvider in _download_wheel_from_cache to replace the
direct PyPIProvider instantiation.

Co-Authored-By: Claude <claude@anthropic.com>
Signed-off-by: Christian Heimes <cheimes@redhat.com>
@tiran tiran force-pushed the feat/dedicate-pypi-cache-provider branch from fbc2cf7 to e2ed294 Compare May 12, 2026 12:01
Copy link
Copy Markdown
Contributor

@rd4398 rd4398 left a comment

Choose a reason for hiding this comment

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

LGTM!

@mergify mergify Bot merged commit c97ac64 into python-wheel-build:main May 12, 2026
40 checks passed
smoparth added a commit that referenced this pull request May 12, 2026
Use PyPICacheProvider (introduced in #1143) for local and cache wheel
server lookups in the build and download-sequence paths.  This separates
trusted internal sources (no cooldown, no upload-time checks) from
upstream pre-built sources.

- Add resolve_cached_wheel() using PyPICacheProvider
- Add resolve_existing_wheel() to probe cache servers first, then
  pre-built servers, preserving the per-package server exclusivity
- Restructure _is_wheel_built() to use resolve_existing_wheel()
- Route download_sequence local server through resolve_cached_wheel
- Remove supports_upload_time workaround from resolve_all_prebuilt_wheels
- Add tests for cache/local cooldown bypass and upstream cooldown retention

Follows up on #1143

Co-Authored-By: Claude <claude@anthropic.com>
Signed-off-by: Shanmukh Pawan <smoparth@redhat.com>
smoparth added a commit that referenced this pull request May 13, 2026
Use PyPICacheProvider (introduced in #1143) for local and cache wheel
server lookups in the build and download-sequence paths.  This separates
trusted internal sources (no cooldown, no upload-time checks) from
upstream pre-built sources.

- Add resolve_cached_wheel() using PyPICacheProvider
- Add resolve_existing_wheel() to probe cache servers first, then
  pre-built servers, preserving the per-package server exclusivity
- Restructure _is_wheel_built() to use resolve_existing_wheel()
- Route download_sequence local server through resolve_cached_wheel
- Remove supports_upload_time workaround from resolve_all_prebuilt_wheels
- Add tests for cache/local cooldown bypass and upstream cooldown retention

Follows up on #1143

Co-Authored-By: Claude <claude@anthropic.com>
Signed-off-by: Shanmukh Pawan <smoparth@redhat.com>
smoparth added a commit that referenced this pull request May 13, 2026
Use PyPICacheProvider (introduced in #1143) for local and cache wheel
server lookups in the build and download-sequence paths.  This separates
trusted internal sources (no cooldown, no upload-time checks) from
upstream pre-built sources.

- Add resolve_cached_wheel() using PyPICacheProvider
- Add resolve_existing_wheel() to probe cache servers first, then
  pre-built servers, preserving the per-package server exclusivity
- Restructure _is_wheel_built() to use resolve_existing_wheel()
- Route download_sequence local server through resolve_cached_wheel
- Remove supports_upload_time workaround from resolve_all_prebuilt_wheels
- Add tests for cache/local cooldown bypass and upstream cooldown retention

Follows up on #1143

Co-Authored-By: Claude <claude@anthropic.com>
Signed-off-by: Shanmukh Pawan <smoparth@redhat.com>
smoparth added a commit that referenced this pull request May 13, 2026
Use PyPICacheProvider (introduced in #1143) for local and cache wheel
server lookups in the build and download-sequence paths.  This separates
trusted internal sources (no cooldown, no upload-time checks) from
upstream pre-built sources.

- Add resolve_cached_wheel() using PyPICacheProvider
- Add resolve_existing_wheel() to probe cache servers first, then
  pre-built servers, preserving the per-package server exclusivity
- Restructure _is_wheel_built() to use resolve_existing_wheel()
- Route download_sequence local server through resolve_cached_wheel
- Remove supports_upload_time workaround from resolve_all_prebuilt_wheels
- Add tests for cache/local cooldown bypass and upstream cooldown retention

Follows up on #1143

Co-Authored-By: Claude <claude@anthropic.com>
Signed-off-by: Shanmukh Pawan <smoparth@redhat.com>
smoparth added a commit that referenced this pull request May 13, 2026
Use PyPICacheProvider (introduced in #1143) for local and cache wheel
server lookups in the build and download-sequence paths.  This separates
trusted internal sources (no cooldown, no upload-time checks) from
upstream pre-built sources.

- Add resolve_cached_wheel() using PyPICacheProvider
- Add resolve_existing_wheel() to probe cache servers first, then
  pre-built servers, preserving the per-package server exclusivity
- Restructure _is_wheel_built() to use resolve_existing_wheel()
- Route download_sequence local server through resolve_cached_wheel
- Remove supports_upload_time workaround from resolve_all_prebuilt_wheels
- Add tests for cache/local cooldown bypass and upstream cooldown retention

Follows up on #1143

Co-Authored-By: Claude <claude@anthropic.com>
Signed-off-by: Shanmukh Pawan <smoparth@redhat.com>
smoparth added a commit that referenced this pull request May 13, 2026
Use PyPICacheProvider (introduced in #1143) for local and cache wheel
server lookups in the build and download-sequence paths.  This separates
trusted internal sources (no cooldown, no upload-time checks) from
upstream pre-built sources.

- Add resolve_cached_wheel() using PyPICacheProvider
- Simplify _is_wheel_built() to only check cache servers (local +
  cache_wheel_server) via resolve_cached_wheel
- Route download_sequence local server through resolve_cached_wheel
- Remove supports_upload_time workaround from resolve_all_prebuilt_wheels
- Add tests for cache/local cooldown bypass and upstream cooldown retention

Follows up on #1143 and addresses maintainer feedback from #1141.

Co-Authored-By: Claude <claude@anthropic.com>
Signed-off-by: Shanmukh Pawan <smoparth@redhat.com>
smoparth added a commit that referenced this pull request May 13, 2026
Use PyPICacheProvider (introduced in #1143) for local and cache wheel
server lookups in the build and download-sequence paths.  This separates
trusted internal sources (no cooldown, no upload-time checks) from
upstream pre-built sources.

- Add resolve_cached_wheel() using PyPICacheProvider
- Simplify _is_wheel_built() to only check cache servers (local +
  cache_wheel_server) via resolve_cached_wheel
- Route download_sequence local server through resolve_cached_wheel
- Remove supports_upload_time workaround from resolve_all_prebuilt_wheels
- Add tests for cache/local cooldown bypass and upstream cooldown retention

Follows up on #1143 and closes #1140.

Co-Authored-By: Claude <claude@anthropic.com>
Signed-off-by: Shanmukh Pawan <smoparth@redhat.com>
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.

5 participants