Skip to content

fix: Use purl.bzl for a better api, add module package_metadata - #4276

Open
darkrift wants to merge 1 commit into
bazel-contrib:mainfrom
darkrift:use_purl_builder
Open

darkrift wants to merge 1 commit into
bazel-contrib:mainfrom
darkrift:use_purl_builder

Conversation

@darkrift

Copy link
Copy Markdown

This declares the module package metadata and switch to the purl builder which takes care of encoding the various fields of the purl.

Copilot AI balanced review requested due to automatic review settings October 17, 2026 03:50

Copilot AI 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.

🟡 Changes recommended

WORKSPACE compatibility regressions and the outdated integration lockfile need to be fixed.

3 open issues
What changed in this PR

Adds module-wide package metadata to rules_python and uses the PURL builder to encode wheel package URLs correctly.

Changes:

  • Declares module identity and Apache-2.0 license metadata.
  • Replaces manual wheel PURL formatting with the builder API.
  • Upgrades package_metadata and adds the builder dependency.
File Description
REPO.bazel Applies package metadata module-wide.
python/​private/​pypi/​patch_and_extract_whl.bzl Builds wheel PURLs with encoded fields.
python/​private/​pypi/​BUILD.bazel Declares the PURL library dependency.
MODULE.bazel Upgrades package_metadata to 0.0.13.
BUILD.bazel Defines module and license metadata.

Review effort: Balanced

Comment thread BUILD.bazel Outdated
":license",
],
purl = purl.bazel(
module_name(),
name = normalize_name(metadata.name).replace("_", "-")

qualifiers = {}
builder = purl.builder().type("pypi").name(name).version(metadata.version)
Comment thread MODULE.bazel
bazel_dep(name = "bazel_features", version = "1.21.0")
bazel_dep(name = "bazel_skylib", version = "1.8.2")
bazel_dep(name = "package_metadata", version = "0.0.7")
bazel_dep(name = "package_metadata", version = "0.0.13")
@darkrift
darkrift force-pushed the use_purl_builder branch 2 times, most recently from 5c2446a to 687c853 Compare October 17, 2026 12:14

Copilot AI 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.

🟡 Changes recommended

Integration fixtures omit the new repository configuration and license file, leaving the metadata defaults untested.

4 open issues

Review effort: Balanced

Comment thread REPO.bazel
Comment on lines +3 to +5
repo(
default_package_metadata = [
"//:package_metadata",

This branch has not been deployed

No deployments
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