Skip to content

feat!(pypi): enable bazel downloader by default#3691

Merged
rickeylev merged 7 commits intobazel-contrib:mainfrom
aignas:aignas.feat.enable-bazel-downloader-by-default
Apr 11, 2026
Merged

feat!(pypi): enable bazel downloader by default#3691
rickeylev merged 7 commits intobazel-contrib:mainfrom
aignas:aignas.feat.enable-bazel-downloader-by-default

Conversation

@aignas
Copy link
Copy Markdown
Collaborator

@aignas aignas commented Apr 11, 2026

Summary:

  • change: Set https://pypi.org/simple as the default index.
  • refactor: Leave the code for the legacy behaviour intact in case we
    need to do more work on the configuration to exclude the cases where
    the downloader should be used.
  • add: add index_url configuration option for setting the defaults.
  • add: add a small utility for parsing the arguments.
  • fix: downloader will not be used if there is no url associated with
    the source irrespective of what the index_url setting is.
  • fix: ensure all of the URLs are normalized when used.

Fixes #260
Fixes #1357
Fixes #2241
Fixes #2951

Summary:
- change: Set `https://pypi.org/simple` as the default index.
- refactor: Leave the code for the legacy behaviour in-tact in case we
  need to do more work on the configuration to exclude the cases where
  the downloader should be used.
- add: add `index_url` configuration option for setting the defaults.
- add: add a small utility for parsing the arguments.
- fix: downloader will not be used if there is no url associated with
  the source irrespective of what the index_url setting is.
- fix: ensure all of the URLs are normalized when used.

What we can do later:
- Make the experimental flags noop.
- Add extra APIs for setting defaults, etc.
- Do extra fixes for falling back to previous behaviour.
- Add docs for how to customize things.

Fixes bazel-contrib#260
Fixes bazel-contrib#1357
Fixes bazel-contrib#2241
Fixes bazel-contrib#2951
@aignas aignas requested review from groodt and rickeylev as code owners April 11, 2026 03:21
@aignas aignas mentioned this pull request Apr 11, 2026
5 tasks
@aignas
Copy link
Copy Markdown
Collaborator Author

aignas commented Apr 11, 2026

@dougthor42, FYI, this may be interesting to test, but it can wait until rc0 is released.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request transitions the pip extension from experimental index URL attributes to standard pip arguments like --index-url and --extra-index-url, while introducing a new index_url attribute in pip.default. It includes a new argparse utility for extracting these values from requirement files and updates the hub builder logic to support these changes. Review feedback identified a critical bug in parse_requirements.bzl where the Bazel downloader could be unintentionally disabled due to incorrect argument passing. Additionally, suggestions were made to label experimental attributes as deprecated rather than no-ops to reflect their current fallback behavior and to ensure consistent URL formatting for the default index.

@rickeylev
Copy link
Copy Markdown
Collaborator

is this a breaking change? I see some of the experiemtnal_xxx args are doc'd as no-ops, but it looked like the code used them as a fallback.

If so, that's fine. Lets just document it and add ! to the summary line.

@rickeylev rickeylev enabled auto-merge April 11, 2026 03:34
@aignas aignas changed the title feat(pypi): enable bazel downloader by default feat!(pypi): enable bazel downloader by default Apr 11, 2026
@rickeylev rickeylev added this pull request to the merge queue Apr 11, 2026
Merged via the queue into bazel-contrib:main with commit ad74ef7 Apr 11, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants