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

pythonPackages: enforce python-modules path #33725

Closed
wants to merge 1 commit into from

Conversation

zimbatm
Copy link
Member

@zimbatm zimbatm commented Jan 10, 2018

Motivation for this change

@FRidh wants to only load packages from pkgs/development/python-modules in pkgs/top-level/python-packages.nix.

What do you think of this solution? I guess the other option is, why don't we put this inventory file under pkgs/development/python-modules/default.nix ? Then it would be fairly obvious that it's acting as an inventory.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option build-use-sandbox in nix.conf on non-NixOS)
  • 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 nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

@adisbladis
Copy link
Member

I like pkgs/development/python-modules only for modules (libraries).

awscli and aws_shell are CLI programs that just happen to be written in python so I don't really think they belong in the python-modules directory.

@FRidh
Copy link
Member

FRidh commented Jan 11, 2018

What do you think of this solution?

I like the idea of enforcing it, because not everyone reads the docs or the header of python-packages.nix. I have been thinking of having a bot for making such kinds of checks.

The part that maybe creates more confusion is the ${name} and the omission of a path. Is the name the pname? What if that suddenly does not work because the pname starts with capital letter and the folder does not. And where does it get the expression from?

I guess the other option is, why don't we put this inventory file under pkgs/development/python-modules/default.nix ? Then it would be fairly obvious that it's acting as an inventory.

This would indeed solve the latter issue.

awscli and aws_shell are CLI programs that just happen to be written in python so I don't really think they belong in the python-modules directory.

This is the real issue. I don't think the issue is that people want to import from other locations, I think the issue is that people are not aware of the reason and the difference that is made between applications and libraries.

@FRidh FRidh self-assigned this Jan 11, 2018
@zimbatm
Copy link
Member Author

zimbatm commented Jan 15, 2018

Alright, I reverted the awscli and aws_shell changes so the only remaining thing is that path-enforcing function for python-modules.nix. I don't care a lot of this PR so I might just close it.

The part that maybe creates more confusion is the ${name} and the omission of a path. Is the name the pname? What if that suddenly does not work because the pname starts with capital letter and the folder does not. And where does it get the expression from?

The name is actually a relative path to the python-module. I expect most of the times it will match the pname but it's not necessary.

@zimbatm zimbatm closed this Feb 9, 2018
@zimbatm zimbatm deleted the python-modules-awscli branch February 9, 2018 11:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants