From 160261b72d75dfd0d0254f33f431f670acaed044 Mon Sep 17 00:00:00 2001 From: adisbladis Date: Wed, 8 May 2019 12:56:53 +0100 Subject: [PATCH] python-packages: Set pythonPackages attr in pythonPackages scope MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If we don't set this we are mixing python versions in the same package. Any package called from `python-packages.nix` using `pythonPackages` directly as an argument is currently wrong. Before: ``` nix-repl> python3Packages.bugseverywhere.buildInputs [ «derivation /nix/store/csd0d2j3vgl5dnag6afi5q92xb64rv7z-python2.7-Jinja2-2.10.1.drv» «derivation /nix/store/gsj389hprxlr8a39b0ccszagirirf1lv-python2.7-cherrypy-17.4.1.drv» «derivation /nix/store/ysmd4wdkbi9gd6bw2ha92hwrd2k2xlnh-python2.7-bootstrapped-pip-19.0.3.drv» ] ``` After: ``` nix-repl> python3Packages.bugseverywhere.buildInputs [ «derivation /nix/store/m0mfx1i98ciby8mx8xjva98kinhqkj6r-python3.7-Jinja2-2.10.1.drv» «derivation /nix/store/2gqd0sbiwqmin2814ja83pnyal8pq86a-python3.7-cherrypy-18.1.1.drv» «derivation /nix/store/0rq8n7xq2ksxiq2y2d844i9516p0rd41-python3.7-bootstrapped-pip-19.0.3.drv» ] ``` --- pkgs/top-level/python-packages.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 38d82984c488..851ca54abc79 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -130,6 +130,9 @@ in { wrapPython = callPackage ../development/interpreters/python/wrap-python.nix {inherit python; inherit (pkgs) makeSetupHook makeWrapper; }; + # Dont take pythonPackages from "global" pkgs scope to avoid mixing python versions + pythonPackages = self; + # specials recursivePthLoader = callPackage ../development/python-modules/recursive-pth-loader { };