summary refs log tree commit diff
diff options
context:
space:
mode:
authorFrederik Rietdijk <fridh@fridh.nl>2019-01-04 12:31:42 +0100
committerFrederik Rietdijk <fridh@fridh.nl>2019-01-04 12:31:42 +0100
commit63bcd0788883dc45fb5bcd68c6f4e89c1c2087ae (patch)
tree3d0dc65a4b544174d24c7485d43bb26fa7e4e656
parent29ee864e93fe0c031423ed323c25b6367d0e72c6 (diff)
downloadnixpkgs-63bcd0788883dc45fb5bcd68c6f4e89c1c2087ae.tar
nixpkgs-63bcd0788883dc45fb5bcd68c6f4e89c1c2087ae.tar.gz
nixpkgs-63bcd0788883dc45fb5bcd68c6f4e89c1c2087ae.tar.bz2
nixpkgs-63bcd0788883dc45fb5bcd68c6f4e89c1c2087ae.tar.lz
nixpkgs-63bcd0788883dc45fb5bcd68c6f4e89c1c2087ae.tar.xz
nixpkgs-63bcd0788883dc45fb5bcd68c6f4e89c1c2087ae.tar.zst
nixpkgs-63bcd0788883dc45fb5bcd68c6f4e89c1c2087ae.zip
python: add isPy2 attribute to passthru
Some packages relied on it. For consistency, also introduce isPy3 (which
is the same as isPy3k).
-rw-r--r--pkgs/development/interpreters/python/default.nix4
-rw-r--r--pkgs/development/python-modules/matplotlib/2.nix2
-rw-r--r--pkgs/servers/uwsgi/default.nix2
3 files changed, 5 insertions, 3 deletions
diff --git a/pkgs/development/interpreters/python/default.nix b/pkgs/development/interpreters/python/default.nix
index bb5c3b3a97f..f1461d784be 100644
--- a/pkgs/development/interpreters/python/default.nix
+++ b/pkgs/development/interpreters/python/default.nix
@@ -27,7 +27,9 @@ with pkgs;
         isPy35 = pythonVersion == "3.5";
         isPy36 = pythonVersion == "3.6";
         isPy37 = pythonVersion == "3.7";
-        isPy3k = lib.strings.substring 0 1 pythonVersion == "3";
+        isPy2 = lib.strings.substring 0 1 pythonVersion == "2";
+        isPy3 = lib.strings.substring 0 1 pythonVersion == "3";
+        isPy3k = isPy3;
         isPyPy = interpreter == "pypy";
 
         buildEnv = callPackage ./wrapper.nix { python = self; inherit (pythonPackages) requiredPythonModules; };
diff --git a/pkgs/development/python-modules/matplotlib/2.nix b/pkgs/development/python-modules/matplotlib/2.nix
index dec34c64f0a..129b864a241 100644
--- a/pkgs/development/python-modules/matplotlib/2.nix
+++ b/pkgs/development/python-modules/matplotlib/2.nix
@@ -45,7 +45,7 @@ buildPythonPackage rec {
     ++ stdenv.lib.optionals enableGtk3 [ cairo pycairo gtk3 gobject-introspection pygobject3 ]
     ++ stdenv.lib.optionals enableTk [ tcl tk tkinter libX11 ]
     ++ stdenv.lib.optionals enableQt [ pyqt4 ]
-    ++ stdenv.lib.optionals (builtins.hasAttr "isPy2" python) [ functools32 subprocess32 ];
+    ++ stdenv.lib.optionals python.isPy2 [ functools32 subprocess32 ];
 
   patches =
     [ ./basedirlist.patch ] ++
diff --git a/pkgs/servers/uwsgi/default.nix b/pkgs/servers/uwsgi/default.nix
index 074b19724d2..91053019ac1 100644
--- a/pkgs/servers/uwsgi/default.nix
+++ b/pkgs/servers/uwsgi/default.nix
@@ -7,7 +7,7 @@
 , ruby, php-embed, mysql
 }:
 
-let pythonPlugin = pkg : lib.nameValuePair "python${if pkg ? isPy2 then "2" else "3"}" {
+let pythonPlugin = pkg : lib.nameValuePair "python${if pkg.isPy2 then "2" else "3"}" {
                            interpreter = pkg.interpreter;
                            path = "plugins/python";
                            inputs = [ pkg ncurses ];