Skip to content

Conversation

sfc-gh-wzhao
Copy link
Contributor

@sfc-gh-wzhao sfc-gh-wzhao commented Jun 17, 2023

Project-URL is a field available in core metadata since version 1.2, which allows specifying additional URLs and display as Project Links in PyPI package web page.

https://packaging.python.org/en/latest/specifications/core-metadata/#project-url-multiple-use

This change adds the support to specify that.

`Project-URL` is a field available in core metadata since version 1.2, which allows specifying additional URLs.

https://packaging.python.org/en/latest/specifications/core-metadata/#project-url-multiple-use

This change adds the support to specify that.
@sfc-gh-wzhao sfc-gh-wzhao requested a review from rickeylev as a code owner June 17, 2023 00:01
@sfc-gh-wzhao
Copy link
Contributor Author

@sfc-gh-sdas FYI.

Copy link
Contributor

@chrislovecnm chrislovecnm left a comment

Choose a reason for hiding this comment

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

Thanks for the PR! See comments.

if ctx.attr.summary:
metadata_contents.append("Summary: %s" % ctx.attr.summary)

for label, url in sorted(ctx.attr.project_urls.items()):
Copy link
Contributor

Choose a reason for hiding this comment

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

Please check for the max length of the label. The label is limited to 32 characters.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you for pointing out. A check has been added, and will fail out if the length is over limit. Corresponding test is also added.

default = "",
),
"project_urls": attr.string_dict(
doc = ("A string dict specifying additional browsable URLs for the project and corresponding labels. " +
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit pick. Mention the key first and the label second. You have them reversed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated with better explanation about the way to specify.

Add a check to the length of the label and fail when it is oversize, with corresponding tests.

Update docs for better instruction on how to specify the label and url.
Copy link
Contributor

@chrislovecnm chrislovecnm left a comment

Choose a reason for hiding this comment

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

LGTM!

@chrislovecnm chrislovecnm added this pull request to the merge queue Jun 19, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jun 19, 2023
@chrislovecnm chrislovecnm added this pull request to the merge queue Jun 19, 2023
Merged via the queue into bazel-contrib:main with commit 2fb9a2a Jun 19, 2023
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