client_python
client_python copied to clipboard
should the project/package name be `prometheus-client` rather than `prometheus_client`
Hey.
I stumbled over the question what to use when one specifies the Prometheus Client as a dependency= in pyproject.toml?
- you guys seem to use
prometheus_client(underscore) https://github.com/prometheus/client_python/blob/46eae7bae88f76951f7246d9f359f2dd5eeff110/pyproject.toml#L6C9-L6C26 - PyPi seems to use
prometheus-client(i.e. when one enters the URL with underscore, it forwards to the one with hyphen)
The actual package build/installation seems to work with both names.
For me the whole Python packaging standard are like big mess ^^... but, if I understand correctly the following possibly means:
The name should be lowercased with all runs of the characters
.,-, or_replaced with a single-character.
that the name should be with hypen.
So maybe that should be changed in pyproject.toml and many other places like e.g.:
- https://github.com/prometheus/client_python/blob/46eae7bae88f76951f7246d9f359f2dd5eeff110/README.md?plain=1#L8
- https://github.com/prometheus/client_python/blob/46eae7bae88f76951f7246d9f359f2dd5eeff110/pyproject.toml#L49
- https://github.com/prometheus/client_python/blob/46eae7bae88f76951f7246d9f359f2dd5eeff110/README.md?plain=1#L20
and perhaps more in tox.ini and mypy.ini?
Cheers, Chris.
As mentioned in Names and normalization:
This means that the following names are all equivalent:
friendly-bard(normalized form)Friendly-BardFRIENDLY-BARDfriendly.bardfriendly_bardfriendly--bardFrIeNdLy-._.-bArD(a terrible way to write a name, but it is valid)
Whether the project name is prometheus_client or even PrOmEtHeUs-._.-ClIeNt(a terrible way to write a name, but it is valid), it will be normalized as prometheus-client when built into a pypi package.
Yes, but since it's anyway normalised and since the recommendation is to use -, I figured maybe it should be changed for clarity. :-)
Yeah, as mentioned they are equivalent. I would be ok with updating pyproject.toml and other locations to use the normalized form if that helps reduce any confusion.