aboutsummaryrefslogtreecommitdiff
path: root/pkgs/development/interpreters/python/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/interpreters/python/default.nix')
-rw-r--r--pkgs/development/interpreters/python/default.nix80
1 files changed, 69 insertions, 11 deletions
diff --git a/pkgs/development/interpreters/python/default.nix b/pkgs/development/interpreters/python/default.nix
index a8db9bc92576..7c3f94dcd16e 100644
--- a/pkgs/development/interpreters/python/default.nix
+++ b/pkgs/development/interpreters/python/default.nix
@@ -14,13 +14,70 @@ with pkgs;
, packageOverrides
, sitePackages
, hasDistutilsCxxPatch
- , pythonForBuild
- , self
+ , pythonOnBuildForBuild
+ , pythonOnBuildForHost
+ , pythonOnBuildForTarget
+ , pythonOnHostForHost
+ , pythonOnTargetForTarget
+ , self # is pythonOnHostForTarget
}: let
- pythonPackages = callPackage ../../../top-level/python-packages.nix {
- python = self;
- overrides = packageOverrides;
- };
+ pythonPackages = callPackage
+ ({ pkgs, stdenv, python, overrides }: let
+ pythonPackagesFun = import ../../../top-level/python-packages.nix {
+ inherit stdenv pkgs;
+ python = self;
+ };
+ otherSplices = {
+ selfBuildBuild = pythonOnBuildForBuild.pkgs;
+ selfBuildHost = pythonOnBuildForHost.pkgs;
+ selfBuildTarget = pythonOnBuildForTarget.pkgs;
+ selfHostHost = pythonOnHostForHost.pkgs;
+ selfTargetTarget = pythonOnTargetForTarget.pkgs or {}; # There is no Python TargetTarget.
+ };
+ keep = self: {
+ # TODO maybe only define these here so nothing is needed to be kept in sync.
+ inherit (self)
+ isPy27 isPy35 isPy36 isPy37 isPy38 isPy39 isPy3k isPyPy pythonAtLeast pythonOlder
+ python bootstrapped-pip buildPythonPackage buildPythonApplication
+ fetchPypi
+ hasPythonModule requiredPythonModules makePythonPath disabledIf
+ toPythonModule toPythonApplication
+ buildSetupcfg
+
+ eggUnpackHook
+ eggBuildHook
+ eggInstallHook
+ flitBuildHook
+ pipBuildHook
+ pipInstallHook
+ pytestCheckHook
+ pythonCatchConflictsHook
+ pythonImportsCheckHook
+ pythonNamespacesHook
+ pythonRecompileBytecodeHook
+ pythonRemoveBinBytecodeHook
+ pythonRemoveTestsDirHook
+ setuptoolsBuildHook
+ setuptoolsCheckHook
+ venvShellHook
+ wheelUnpackHook
+
+ wrapPython
+
+ pythonPackages
+
+ recursivePthLoader
+ ;
+ };
+ in lib.makeScopeWithSplicing
+ pkgs.splicePackages
+ pkgs.newScope
+ otherSplices
+ keep
+ (lib.extends overrides pythonPackagesFun))
+ {
+ overrides = packageOverrides;
+ };
in rec {
isPy27 = pythonVersion == "2.7";
isPy35 = pythonVersion == "3.5";
@@ -42,13 +99,15 @@ with pkgs;
inherit sourceVersion;
pythonAtLeast = lib.versionAtLeast pythonVersion;
pythonOlder = lib.versionOlder pythonVersion;
- inherit hasDistutilsCxxPatch pythonForBuild;
+ inherit hasDistutilsCxxPatch;
+ # TODO: rename to pythonOnBuild
+ # Not done immediately because its likely used outside Nixpkgs.
+ pythonForBuild = pythonOnBuildForHost.override { inherit packageOverrides; self = pythonForBuild; };
tests = callPackage ./tests.nix {
python = self;
};
};
-
in {
python27 = callPackage ./cpython/2.7 {
@@ -122,9 +181,9 @@ in {
major = "3";
minor = "10";
patch = "0";
- suffix = "a1";
+ suffix = "a2";
};
- sha256 = "0q59a99w1yad808mx4w6l0j7bk7dbd2kakngbk0w1h9z4dhr8wyv";
+ sha256 = "0zl5h61s8n2w2v1n40af0mwaw7lqh5fl1ys7kyjgcph60vb9wzjr";
inherit (darwin) configd;
inherit passthruFun;
};
@@ -132,7 +191,6 @@ in {
# Minimal versions of Python (built without optional dependencies)
python3Minimal = (python38.override {
self = python3Minimal;
- pythonForBuild = pkgs.buildPackages.python3Minimal;
# strip down that python version as much as possible
openssl = null;
readline = null;