Skip to content

Commit

Permalink
python-packages: Set pythonPackages attr in pythonPackages scope
Browse files Browse the repository at this point in the history
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» ]
```
  • Loading branch information
adisbladis committed May 8, 2019
1 parent 84a5165 commit 160261b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkgs/top-level/python-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 { };
Expand Down

0 comments on commit 160261b

Please sign in to comment.