-
-
Notifications
You must be signed in to change notification settings - Fork 15.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
177 additions
and
139 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
{ stdenv | ||
, pkgs | ||
, python | ||
#, pythonConfig ? (self: super: {}) | ||
, overrides ? (self: super: {}) | ||
}: | ||
|
||
let | ||
inherit (stdenv) lib; | ||
|
||
# Package set | ||
packages = let | ||
|
||
inherit (lib) fix' extends fold; | ||
|
||
pythonPackages = self: import ./support.nix { | ||
inherit pkgs python setuptools; | ||
} self; | ||
|
||
commonConfiguration = import ../../../top-level/python-packages.nix { inherit pkgs stdenv; }; | ||
|
||
#in fix' (fold extends [ overrides commonConfiguration pythonPackages ]); | ||
in fix' (extends overrides (extends commonConfiguration pythonPackages)); | ||
|
||
# Function to build an environment | ||
buildEnv = import ./wrapper.nix { | ||
inherit stdenv python; | ||
inherit (pkgs) buildEnv makeWrapper; | ||
}; | ||
|
||
# Function to build an environment, but accepting only a list of packages | ||
withPackages = import ./with-packages.nix { | ||
inherit buildEnv; | ||
pythonPackages = packages; | ||
}; | ||
|
||
# Derivation with scripts for building wrappers | ||
wrapPython = import ./wrap-python.nix { | ||
inherit lib python; | ||
inherit (pkgs) makeSetupHook makeWrapper; | ||
}; | ||
|
||
# Setuptools derivation | ||
setuptools = import ../../python-modules/setuptools { | ||
inherit stdenv lib python wrapPython; | ||
inherit (pkgs) fetchurl; | ||
}; | ||
|
||
# Function to build a package that doesn't use setuptools | ||
mkPythonDerivation = import ./mk-python-derivation.nix { | ||
inherit lib python wrapPython setuptools; | ||
inherit (pkgs) unzip ensureNewerSourcesHook; | ||
}; | ||
|
||
# Function to build a package that uses setuptools or installs a wheel | ||
buildPythonPackage = lib.makeOverridable ( import ./build-python-package.nix { | ||
inherit lib python mkPythonDerivation; | ||
bootstrapped-pip = import ../../python-modules/bootstrapped-pip { | ||
inherit stdenv python; | ||
inherit (pkgs) fetchurl makeWrapper unzip; | ||
}; | ||
}); | ||
|
||
in { | ||
# For each Python interpreter version we have this set. | ||
pkgs = packages; | ||
inherit withPackages; | ||
inherit buildEnv; | ||
inherit mkPythonDerivation; | ||
inherit buildPythonPackage; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
{ pkgs | ||
, python | ||
, setuptools }: | ||
|
||
with pkgs.lib; | ||
|
||
self: | ||
|
||
let | ||
modules = python.modules or { | ||
readline = null; | ||
sqlite3 = null; | ||
curses = null; | ||
curses_panel = null; | ||
crypt = null; | ||
}; | ||
|
||
in rec { | ||
|
||
inherit python; | ||
inherit setuptools; # Packages shouldn't depend explicitly on setuptools. | ||
inherit (python) mkPythonDerivation buildPythonPackage wrapPython ; | ||
inherit modules; | ||
|
||
pythonAtLeast = versionAtLeast python.pythonVersion; | ||
pythonOlder = versionOlder python.pythonVersion; | ||
isPy26 = python.majorVersion == "2.6"; | ||
isPy27 = python.majorVersion == "2.7"; | ||
isPy33 = python.majorVersion == "3.3"; | ||
isPy34 = python.majorVersion == "3.4"; | ||
isPy35 = python.majorVersion == "3.5"; | ||
isPy36 = python.majorVersion == "3.6"; | ||
isPyPy = python.executable == "pypy"; | ||
isPy3k = strings.substring 0 1 python.majorVersion == "3"; | ||
|
||
callPackage = pkgs.newScope self; | ||
|
||
buildPythonApplication = args: buildPythonPackage ({namePrefix="";} // args ); | ||
|
||
} // modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.