NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
18.04k stars 14.09k forks source link

Normalize python-modules attribute names and pnames #245383

Closed mweinelt closed 6 months ago

mweinelt commented 1 year ago

Python attribute and pnames should be normalized according to https://packaging.python.org/en/latest/specifications/name-normalization/#normalization.

The following list of names, that need work, was provided by @adisbladis in the nixpkgs python room.

Cc'ing people who are currently doing the work in the python ecosystem. @dotlambda @fabaff @SuperSandro2000 @tjni @natsukium

The workflow would be to

  1. Normalize pname in the derivation
  2. Normalize the directory name
  3. Normalize attribute name and path in pkgs/top-level/python-packages.nix
  4. Update all references to the old attribute name treewide
  5. Create an alias in pkgs/top-level/python-aliases.nix for the old attribute name
  6. Commit python311Packages.newname: rename from oldname

zimbatm commented 12 months ago

Is there more context available to the name normalization reasoning?

As a user, the 1:1 mapping between pypi packages and nixpkgs package name is quite convenient. It allows me to copy-paste things around.

mweinelt commented 12 months ago

We follow PEP 503 normalization rules, according to our python contributing guidelines.

Attribute names in python-packages.nix as well as pnames should match the library's name on PyPI, but be normalized according to PEP 0503. This means that characters should be converted to lowercase and . and _ should be replaced by a single - (foo-bar-baz instead of Foo__Bar.baz). If necessary, pname has to be given a different value within fetchPypi.

Originated in https://github.com/NixOS/nixpkgs/pull/45822

Stunkymonkey commented 10 months ago

for every entry there is now an PR ongoing, except for two package:

any idea what to do with them? they seem perfectly fine.

Stunkymonkey commented 8 months ago

@adisbladis can you please check if all packages are correct? or some new unnormalized sneaked in?

otherwise we can close this issue.

Stunkymonkey commented 8 months ago

I did myself a "quick" check and came up with this list of remaining packages:

dotlambda commented 8 months ago
Stunkymonkey commented 7 months ago

FYI: @dotlambda I just sorted your list. Otherwise documenting the progress is hard. Hope that is ok.

Stunkymonkey commented 7 months ago

@dotlambda can you please verify again. I think we can close this issue. (staging not yet merged)

Stunkymonkey commented 6 months ago

found some more packages:

Stunkymonkey commented 6 months ago

all the lists in this thread are now done. staging is merged into master.

Therefore I consider this done.