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

WIP: pythonPackages: normalize attribute names, fixes #49691 #96586

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

FRidh
Copy link
Member

@FRidh FRidh commented Aug 29, 2020

Motivation for this change
Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

To do

  • check attribute names against regex
  • fix all attribute names (sigh...) Normalize python-modules attribute names and pnames #245383
  • 0 rebuilds
  • document this requirement (backwards incompatible!)
  • optional: check also the pname attribute. That requires careful checking of hashes because pname is typically inherited by the fetchers.

@jonringer
Copy link
Contributor

also, it's common to prefix with "_" if the package name starts with a number.

maybe we could do builtins.match and have a regex check the format, and allow for version suffixes e.g. ( (_\d+)?)

@FRidh
Copy link
Member Author

FRidh commented Nov 12, 2020

Got a working regex now. I am by no means a regexpert so I welcome any improvements.

Right now, the following names are allowed:

  • numpy
  • numpy_1
  • numpy_1_2_30
  • _2to3
  • numpy-foo-bar_1_2_30

Not allowed are:

  • numpy_foo
  • numpy_foo_bar
  • numpy_foo_bar_1

It means variants need to be moved away from the top-level, to the passthru of the original package. That also means they typically will not be built by Hydra.

@FRidh FRidh requested a review from zimbatm November 12, 2020 19:17
@FRidh FRidh changed the title pythonPackages: normalize attribute names, fixes #49691 WIP: pythonPackages: normalize attribute names, fixes #49691 Nov 12, 2020
We prefer to have normalized attribute names as these are predictable.
This is also useful for generators such as mach-nix and the home-manager
plugins generator.
@stale
Copy link

stale bot commented Jul 21, 2021

I marked this as stale due to inactivity. → More info

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jul 21, 2021
@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Aug 1, 2023
@wegank wegank added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Mar 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.status: merge conflict 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md 2.status: work-in-progress 6.topic: python
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants