Merge remote-tracking branch 'origin/staging-next' into staging
This commit is contained in:
@@ -4,6 +4,8 @@
|
||||
lib,
|
||||
config,
|
||||
python,
|
||||
# Allow passing in a custom stdenv to buildPython*.override
|
||||
stdenv,
|
||||
wrapPython,
|
||||
unzip,
|
||||
ensureNewerSourcesForZipFilesHook,
|
||||
@@ -192,9 +194,6 @@ in
|
||||
|
||||
doCheck ? true,
|
||||
|
||||
# Allow passing in a custom stdenv to buildPython*
|
||||
stdenv ? python.stdenv,
|
||||
|
||||
...
|
||||
}@attrs:
|
||||
|
||||
|
||||
@@ -39,27 +39,50 @@ let
|
||||
else
|
||||
result
|
||||
)
|
||||
// lib.optionalAttrs (f ? override) {
|
||||
// {
|
||||
# Support overriding `f` itself, e.g. `buildPythonPackage.override { }`.
|
||||
# Ensure `makeOverridablePythonPackage` is applied to the result.
|
||||
override = lib.mirrorFunctionArgs f.override (fdrv: makeOverridablePythonPackage (f.override fdrv));
|
||||
};
|
||||
|
||||
overrideStdenvCompat =
|
||||
f:
|
||||
lib.setFunctionArgs (
|
||||
args:
|
||||
if !(lib.isFunction args) && (args ? stdenv) then
|
||||
lib.warnIf (lib.oldestSupportedReleaseIsAtLeast 2511) ''
|
||||
Passing `stdenv` directly to `buildPythonPackage` or `buildPythonApplication` is deprecated. You should use their `.override` function instead, e.g:
|
||||
buildPythonPackage.override { stdenv = customStdenv; } { }
|
||||
'' (f.override { stdenv = args.stdenv; } args)
|
||||
else
|
||||
f args
|
||||
) (removeAttrs (lib.functionArgs f) [ "stdenv" ])
|
||||
// {
|
||||
# Intentionally drop the effect of overrideStdenvCompat when calling `buildPython*.override`.
|
||||
inherit (f) override;
|
||||
};
|
||||
|
||||
mkPythonDerivation =
|
||||
if python.isPy3k then ./mk-python-derivation.nix else ./python2/mk-python-derivation.nix;
|
||||
|
||||
buildPythonPackage = makeOverridablePythonPackage (
|
||||
callPackage mkPythonDerivation {
|
||||
inherit namePrefix; # We want Python libraries to be named like e.g. "python3.6-${name}"
|
||||
inherit toPythonModule; # Libraries provide modules
|
||||
}
|
||||
overrideStdenvCompat (
|
||||
callPackage mkPythonDerivation {
|
||||
inherit namePrefix; # We want Python libraries to be named like e.g. "python3.6-${name}"
|
||||
inherit toPythonModule; # Libraries provide modules
|
||||
inherit (python) stdenv;
|
||||
}
|
||||
)
|
||||
);
|
||||
|
||||
buildPythonApplication = makeOverridablePythonPackage (
|
||||
callPackage mkPythonDerivation {
|
||||
namePrefix = ""; # Python applications should not have any prefix
|
||||
toPythonModule = x: x; # Application does not provide modules.
|
||||
}
|
||||
overrideStdenvCompat (
|
||||
callPackage mkPythonDerivation {
|
||||
namePrefix = ""; # Python applications should not have any prefix
|
||||
toPythonModule = x: x; # Application does not provide modules.
|
||||
inherit (python) stdenv;
|
||||
}
|
||||
)
|
||||
);
|
||||
|
||||
# Check whether a derivation provides a Python module.
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
lib,
|
||||
config,
|
||||
python,
|
||||
# Allow passing in a custom stdenv to buildPython*.override
|
||||
stdenv,
|
||||
wrapPython,
|
||||
unzip,
|
||||
ensureNewerSourcesForZipFilesHook,
|
||||
@@ -101,8 +103,6 @@
|
||||
}@attrs:
|
||||
|
||||
let
|
||||
inherit (python) stdenv;
|
||||
|
||||
withDistOutput = lib.elem format [
|
||||
"pyproject"
|
||||
"setuptools"
|
||||
|
||||
Reference in New Issue
Block a user