Skip to content
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

pyproject.toml - "Bug Tracker" example is not best #1183

Closed
CarlFK opened this issue Dec 19, 2022 · 2 comments
Closed

pyproject.toml - "Bug Tracker" example is not best #1183

CarlFK opened this issue Dec 19, 2022 · 2 comments

Comments

@CarlFK
Copy link

CarlFK commented Dec 19, 2022

Root of this: PyPi uses key names as human readable link text. (maybe fine, maybe not, but not what this is about.)

This issue is about:
This example in packaging tutorials is valid but not best:

"Bug Tracker" = "https://github.com/pypa/sampleproject/issues"
https://packaging.python.org/en/latest/tutorials/packaging-projects/#configuring-metadata

Toml spec says:
Quoted keys follow the exact same rules as either basic strings or literal strings and allow you to use a much broader set of key names. Best practice is to use bare keys except when absolutely necessary.
https://toml.io/en/v1.0.0#keys

Packaging docs:

urls
    type: table with keys and values of strings
A table of URLs where the key is the URL label and the value is the URL itself.

https://packaging.python.org/en/latest/specifications/declaring-project-metadata/#urls

The use case for quoted keys is: pretty link text on PyPi.
Here is an example in the wild:
https://pypi.org/project/ddb-cache/

There are 2 ways of making the example better:

  1. Follow toml best practice, remove the spacy key and use "Issues" (without quotes).
  2. Keep the example as is, add a note explaining the violation of toml best practice. (PyPi uses the key...)
@jimustafa
Copy link

I think it may be a good idea to decide on a canonical set of labels for the common Project-URL used and maybe even make recommendations on the site to try and establish a standard. To that end, I have developed a small notebook at https://github.com/jimustafa/py-pkg-info-stats that can be used to determine the relative frequency of different Project-URL labels among the "top" packages on PyPI. Basically, what I find is that the following are the most commonly used labels in their respective class of Project-URL: Homepage, Documentation, Changelog, and Source. For links to the issue tracker, Bug Tracker is actually the most common, not unlikely the result of the guidance on https://packaging.python.org.

@jeanas
Copy link
Contributor

jeanas commented Nov 29, 2023

"Bug tracker" is Issues now; this issue should be closed.

(Standardizing the keys would probably require a PEP and is way beyond the scope of this issue tracker.)

@CarlFK CarlFK closed this as completed Nov 30, 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

No branches or pull requests

3 participants