Repository navigation
Conversation
There was a problem hiding this comment.
🟡 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_metadataand 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
| ":license", | ||
| ], | ||
| purl = purl.bazel( | ||
| module_name(), |
| name = normalize_name(metadata.name).replace("_", "-") | ||
|
|
||
| qualifiers = {} | ||
| builder = purl.builder().type("pypi").name(name).version(metadata.version) |
5c2446a to
687c853
Compare
687c853 to
b6111d1
Compare
5f4cc5d to
9df18b1
Compare
9df18b1 to
656063a
Compare
aignas
left a comment
There was a problem hiding this comment.
I love the new additions here, but I am concerned that this may break builds for every workspace user. Whilst I don't want this to be always a blocking concern, I'd like to think twice before merging this.
| # Everything below this line is used only for developing rules_python. Users | ||
| # should not copy it to their WORKSPACE. | ||
|
|
||
| # REPO.bazel's default_package_metadata makes every package in this repo depend |
There was a problem hiding this comment.
This is somewhat alarming, that means that WORKSPACE users will face a breaking change.
There was a problem hiding this comment.
We could split it in 2 PRs then, update package_metadata for the PURL builder, and another for the rules_python itself package_metadata tagging (which is the one breaking WORKSPACE)
There was a problem hiding this comment.
That said, many ruleset has already decided to drop support for Bazel 7 and WORKSPACE altogether.
How long is rules_python expected to keep WORKSPACE support ?
There was a problem hiding this comment.
@rickeylev, I think dropping WORKSPACE will happen when the protobuf ruleset drops it? I remember him saying that it is going to be another year?. I personally think that we could do the change separately as a breaking change to WORKSPACE users with migration instructions.
As I said in the main comment, a breaking change to WORKSPACE is not a reason to block this PR merge, but we should have instructions in the CHANGELOG for users to migrate.
If I understood correctly previous change would not have dropped WORKSPACE entirely, right?
Move the REPO.bazel default package metadata and the rules_python package_metadata/license targets out of this change. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
@aignas I removed the change that would drop WORKSPACE support, I'll add it in another PR |
| # Loaded by Starlark files (e.g. purl.bzl) that the loads below pull in, so it | ||
| # must be defined before them. |
There was a problem hiding this comment.
do we still need this comment and change?
There was a problem hiding this comment.
Yes, otherwise it still breaks WORKSPACE based tests because of the wrong order of loads
There was a problem hiding this comment.
If that is the case it may still be a breaking change, let's bring back the other change that got reverted and just mark this as breaking for workspace users and add a snippet for WORKSPACE user that they would need to unbreak their setups.
WORKSPACE setup is best effort afterall.


Following the bazelcon talk on supply chain to track every bytes, this declares the module package metadata and switch to the purl builder which also takes care of encoding the various fields of the purl.