TL;DR: I'd like to propose naming dev-python/* packages following PyPI
names whenever possible, case-preserving, with modifications only when necessary to match PN rules.
Hi, everyone.
TL;DR: I'd like to propose naming dev-python/* packages following PyPI
names whenever possible, case-preserving, with modifications only when necessary to match PN rules.
So far the naming in dev-python/* hasn't been exactly consistent.
Myself I've been mostly following "whatever's the easiest" policy which generally meant following GitHub project names whenever we fetched from there.
This mostly made sense so far, as I've been thinking of dev-python/
primarily in terms of dependencies of other packages. However, it's
been pointed out that this makes it hard for people to find packages
they're looking for.
The vast majority of packages in dev-python/ are also published on PyPI
[1]. They can afterwards be installed using tools such as pip, or
specified as dependencies of other projects — using their PyPI names
in every case.
On top of that, it is not unknown for multiple packages with very
similar names to coexis, say "foo", "pyfoo" and "python-foo". When GH project names come into the picture, this can get even more ambiguous.
Don't even get me started about developers pushing duplicate packages
because they didn't find the existing instance.
To improve consistency and make packages easier to find, I'd like to
propose going forward that when packages are published on PyPI, we use
their official PyPI names. This also means preserving the case for
the few packages that use CamelCase names and similar.
Some modifications will be necessary. For example, it is legal for PyPI package names to include dot (".") — we normally translate that to a
hyphen ("-"). We may also have use cases for creating multiple Gentoo packages from the same PyPI package (see e.g. dev-python/ensurepip-*).
Then, there are of course Python packages that aren't published on PyPI.
Still, I think as a general rule of thumb this would make sense. WDYT?
[1] https://pypi.org/
On Sat, 28 Jan 2023, Michał Górny wrote:
Based on existing remote-id entries, the following package names are mismatched (PN on left, PyPI name on right). Note that some of the IDs
could be wrong, particularly because PyPI "autocorrects" - vs _.
However, it's been pointed out that this makes it hard for people to
find packages they're looking for.
However, it's been pointed out that this makes it hard for people toOn Sat, 28 Jan 2023, Michał Górny wrote:
find packages they're looking for.
I don't understand this argument. Why would all-lowercase make finding a package harder?
However, it's been pointed out that this makes it hard for people toOn Sat, 28 Jan 2023, Michał Górny wrote:
find packages they're looking for.
I don't understand this argument. Why would all-lowercase make finding a package harder?
I'd prefer if PyPI names are guidelines, not a strict policy. I don't
like CamelCase and separators other than dash ("-") :P
Also I don't like when packages are named "dev-python/python-foo"
instead of just "dev-python/foo".
To improve consistency and make packages easier to find, I'd like to
propose going forward that when packages are published on PyPI, we use
their official PyPI names. This also means preserving the case for
the few packages that use CamelCase names and similar.
On Sat, 28 Jan 2023, Andrew Ammerlaan wrote:
Each of these is a different package. The package you usually want is GitPython, but if we would name it gitpython or git-python, things
would get very confusing very quickly. In fact, this package was
renamed precisely to avoid this confusion in [1]. This is not the only
case where there are very similarly named packages on pypi. By having
a 1 to 1 mapping between names in pypi and names in ::gentoo we avoid
this confusion.
As for replacing dot (".") with hyphen ("-") I have PyPi package
"FoBiS.py" that is packaged in ::guru just as "FoBiS" as I wasn't sure
is it worth to store ".py" suffix while github repo of this project is
just "FoBiS". So there could be a problem if package named "fobis"
will appear in PyPi.
<div>The similar names in PyPi is a real problem for users when trying to find associated packages. It's also could be a security issue for them with malicious packages named like popular packages. </div><div><br /></div><div>So in ::guru I try tosave package naming even if it's too CamelCase.</div><div><br /></div><div>As for replacing dot (".") with hyphen ("-") I have PyPi package "FoBiS.py" that is packaged in ::guru just as "FoBiS" as I wasn't sure is it worth to store ".py" suffix while
On Sat, 28 Jan 2023, Andrew Ammerlaan wrote:
Each of these is a different package. The package you usually want is GitPython, but if we would name it gitpython or git-python, things
would get very confusing very quickly. In fact, this package was
renamed precisely to avoid this confusion in [1]. This is not the only
case where there are very similarly named packages on pypi. By having
a 1 to 1 mapping between names in pypi and names in ::gentoo we avoid
this confusion.
Looking at mgorny's list, you cannot have an 1 to 1 mapping anyway,
because that would result in invalid PN names.
I'd prefer if PyPI names are guidelines, not a strict policy. I don't
like CamelCase and separators other than dash ("-") :P
Also I don't like when packages are named "dev-python/python-foo"
instead of just "dev-python/foo".
To improve consistency and make packages easier to find, I'd like to
propose going forward that when packages are published on PyPI, we use
their official PyPI names. This also means preserving the case for
the few packages that use CamelCase names and similar.
Some modifications will be necessary. For example, it is legal for PyPI package names to include dot (".") — we normally translate that to a
hyphen ("-"). We may also have use cases for creating multiple Gentoo packages from the same PyPI package (see e.g. dev-python/ensurepip-*).
Then, there are of course Python packages that aren't published on PyPI.
Still, I think as a general rule of thumb this would make sense. WDYT?
On 28/01/2023 19:02, Ulrich Mueller wrote:
I don't understand this argument. Why would all-lowercase make finding aHowever, it's been pointed out that this makes it hard for people toOn Sat, 28 Jan 2023, Michał Górny wrote:
find packages they're looking for.
package harder?
Here's an example, on pypi we have packages:
- git-python
- python-git
- GitPython
- git-py
Each of these is a different package. The package you usually want is GitPython, but if we would name it gitpython or git-python, things would get very confusing very quickly. In fact, this package was renamed precisely to avoid this confusion in [1]. This is not the only case where there are very similarly named packages on pypi. By having a 1 to 1 mapping between names in pypi and names in ::gentoo we avoid this confusion.
Best regards,
Andrew
[1] https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0dec450a90c7490f11df7e69cd9c6709c099285c
On 2023-01-30 12:00, Michał Górny wrote:
However, there's a can of worms around the corner -- should we also
allow normalizing "-" and "_" across different packages (see dev- python/sphinx*)?
PyPI treats "-" and "_" separators as the same, so I'd not use
underscores for in-repo consistency.
However, there's a can of worms around the corner -- should we also
allow normalizing "-" and "_" across different packages (see dev- python/sphinx*)?
Hi, everyone.
TL;DR: I'd like to propose naming dev-python/* packages following PyPI
names whenever possible, case-preserving, with modifications only when necessary to match PN rules.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 475 |
Nodes: | 16 (2 / 14) |
Uptime: | 18:18:50 |
Calls: | 9,487 |
Calls today: | 6 |
Files: | 13,617 |
Messages: | 6,121,091 |