Skip to content

Python: use fixed-point combinator, add pkgs to interpreter#20893

Merged
FRidh merged 3 commits intoNixOS:masterfrom
FRidh:fixed3
Dec 5, 2016
Merged

Python: use fixed-point combinator, add pkgs to interpreter#20893
FRidh merged 3 commits intoNixOS:masterfrom
FRidh:fixed3

Conversation

@FRidh
Copy link
Member

@FRidh FRidh commented Dec 4, 2016

Motivation for this change

Use a fixed-point combinator for the Python package set to allow easier overriding of its contents.
Earlier implementations were proposed in #16784 and #17428. This commit is by comparison much smaller and changes only what is needed.

A package set is constructed for a specific interpreter. Therefore, we add the
possibility to override the package set to the interpreter. This should make it
easier to override the interpreter and the package set at the same time.

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
    • Linux
  • 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.

@FRidh FRidh added 2.status: work-in-progress 6.topic: python Python is a high-level, general-purpose programming language. labels Dec 4, 2016
@mention-bot
Copy link

@FRidh, thanks for your PR! By analyzing the history of the files in this pull request, we identified @bennofs, @chaoflow, @edolstra and @FRidh to be potential reviewers.

@FRidh
Copy link
Member Author

FRidh commented Dec 4, 2016

This is a smaller change than I proposed in #16784.

All packages work just fine with this change. With this change I don't think it will be possible anymore to have overrides of self inside the package set. This was done in the past to make chains of packages use a different version. While that sounds useful it is also very fragile since Python can handle only one version of a package at a time.

@FRidh FRidh added the 0.kind: enhancement Add something new or improve an existing system. label Dec 4, 2016
@FRidh FRidh force-pushed the fixed3 branch 2 times, most recently from 13a28a1 to 1509533 Compare December 5, 2016 08:39
FRidh added 3 commits December 5, 2016 09:39
Use a fixed-point combinator for the Python package set to allow easier overriding of its contents.
Earlier implementations were proposed in NixOS#16784 and NixOS#17428. This commit is by comparison much smaller
and changes only what is needed.
A package set is constructed for a specific interpreter. Therefore, we add the
possibility to override the package set to the interpreter. This should make it
easier to override the interpreter and the package set at the same time.
@domenkozar
Copy link
Member

You rock :)

johbo added a commit to nix-community/pip2nix that referenced this pull request Dec 23, 2016
Since NixOS/nixpkgs#20893
the python packages are based on a fix point combinator and they don't support
the attribute override anymore.

This commit adjusts the template for default.nix so that it works with the
upcoming change and still supports the old variant.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

0.kind: enhancement Add something new or improve an existing system. 6.topic: python Python is a high-level, general-purpose programming language.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants