-
-
Notifications
You must be signed in to change notification settings - Fork 5
[metadata] Implement encoder for purls (part 1) #38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
This will make it easier for users (esp. bzlmod extensions integrating with package managers) to generate `package_metadata` targets.
Instead of having to write `purl = "pkg:bazel/{}@{}".format(module_name(), module_version()) if module_version() else "pkg:bazel/{}".format(module_name())` everywhere to construct a `purl`, users can now write `purl = purl.bazel(module_name(), module_version())` and it'll automatically do the right thing.
Co-authored-by: Yannic <[email protected]>
|
@Yannic By just writing the strings I eliminated the need for the json encoding. Now it passes in bazel7 and 8. |
| "//purl/...", | ||
| ]) | ||
|
|
||
| encode_byte = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I might argue that this should be a list, indexed by byte
|
Friengly ping |
|
Friendly ping |
|
Anyone there? |
would it be ok if I reviewed it early next week? |
|
Yes. You might also look at Yannic's version. That was failing on Bazel7 because of the difference in the way Bazel 7 and 8 handle JSON. This PR makes it work by not wrapping the test data as JSON. |
This will make it easier for users (esp. bzlmod extensions integrating with package managers) to generate package_metadata targets.
Based on #14