Skip to content

feat(pypi): add pip.dep to declare abstract pypi dependencies#3850

Open
rickeylev wants to merge 4 commits into
bazel-contrib:mainfrom
rickeylev:add-pip-dep-tag-class
Open

feat(pypi): add pip.dep to declare abstract pypi dependencies#3850
rickeylev wants to merge 4 commits into
bazel-contrib:mainfrom
rickeylev:add-pip-dep-tag-class

Conversation

@rickeylev

Copy link
Copy Markdown
Collaborator

Introduce the pip.dep tag class to allow modules to declare abstract
PyPI dependencies. These declarations ensure the target structure for
a PyPI package is created, but provide a no-op implementation that
passes analysis time, but fails at execution time.

Along the way, create an agent rule for *.bzl files to help guide it
in creating better bzl files.

Introduce the pip.dep tag class to allow modules to declare abstract PyPI dependencies. These dependencies are fed directly into the unified hub repository, ensuring their target structures exist and automatically routing any unimplemented declarations to analysis-time errors.
@rickeylev rickeylev requested a review from aignas as a code owner June 26, 2026 06:54

@gemini-code-assist gemini-code-assist Bot 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.

Code Review

This pull request introduces a new dep tag class to the pip bzlmod extension, enabling modules to declare abstract PyPI dependencies. This ensures that target structures exist in the unified hub without forcing a specific version or lock file on consumers, with downstream modules providing the concrete implementation via pip.parse. The feedback suggests a minor optimization in python/private/pypi/extension.bzl to remove a redundant normalize_name call since the keys of declared_deps are already normalized.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread python/private/pypi/extension.bzl Outdated
Comment thread tests/pypi/extension/extension_tests.bzl
Simplify the declared_deps loop by removing a redundant normalization call. Add a unit test to verify that when a package is declared via pip.dep and also provided by a concrete hub, the concrete hub implementation coexists correctly and takes precedence.
Add the missing H1 title to the Starlark rules file to ensure it conforms to the workspace rule formatting guidelines.
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