pythonPackages: use fixed-point combinator

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.
This commit is contained in:
Frederik Rietdijk 2016-10-28 13:31:07 +02:00
parent 374ac13a6e
commit 8dadb44196
2 changed files with 12 additions and 9 deletions

View File

@ -9897,37 +9897,30 @@ in
# regardless.
python26Packages = callPackage ./python-packages.nix {
python = python26;
self = python26Packages;
};
python27Packages = lib.hiPrioSet (recurseIntoAttrs (callPackage ./python-packages.nix {
python = python27;
self = python27Packages;
}));
python33Packages = callPackage ./python-packages.nix {
python = python33;
self = python33Packages;
};
python34Packages = callPackage ./python-packages.nix {
python = python34;
self = python34Packages;
};
python35Packages = recurseIntoAttrs (callPackage ./python-packages.nix {
python = python35;
self = python35Packages;
});
python36Packages = (callPackage ./python-packages.nix {
python = python36;
self = python36Packages;
});
pypyPackages = callPackage ./python-packages.nix {
python = pypy;
self = pypyPackages;
};
### DEVELOPMENT / R MODULES

View File

@ -1,7 +1,14 @@
{ pkgs, stdenv, python, self }:
{ pkgs
, stdenv
, python
, overrides ? (self: super: {})
}:
with pkgs.lib;
let
packages = ( self:
let
pythonAtLeast = versionAtLeast python.pythonVersion;
pythonOlder = versionOlder python.pythonVersion;
@ -31323,4 +31330,7 @@ in {
zeitgeist = if isPy3k then throw "zeitgeist not supported for interpreter ${python.executable}" else
(pkgs.zeitgeist.override{python2Packages=self;}).py;
}
});
in fix' (extends overrides packages)