Merge staging-next into staging

This commit is contained in:
Frederik Rietdijk 2022-09-19 10:02:39 +02:00
commit 00035c6295
5 changed files with 5 additions and 29 deletions

View File

@ -92,8 +92,9 @@ in rec {
pythonCatchConflictsHook = callPackage ({ setuptools }: pythonCatchConflictsHook = callPackage ({ setuptools }:
makeSetupHook { makeSetupHook {
name = "python-catch-conflicts-hook"; name = "python-catch-conflicts-hook";
deps = [ setuptools ];
substitutions = { substitutions = {
inherit pythonInterpreter pythonSitePackages setuptools; inherit pythonInterpreter;
catchConflicts=../catch_conflicts/catch_conflicts.py; catchConflicts=../catch_conflicts/catch_conflicts.py;
}; };
} ./python-catch-conflicts-hook.sh) {}; } ./python-catch-conflicts-hook.sh) {};
@ -114,11 +115,6 @@ in rec {
}; };
} ./python-namespaces-hook.sh) {}; } ./python-namespaces-hook.sh) {};
pythonOutputDistHook = callPackage ({ }:
makeSetupHook {
name = "python-output-dist-hook";
} ./python-output-dist-hook.sh ) {};
pythonRecompileBytecodeHook = callPackage ({ }: pythonRecompileBytecodeHook = callPackage ({ }:
makeSetupHook { makeSetupHook {
name = "python-recompile-bytecode-hook"; name = "python-recompile-bytecode-hook";

View File

@ -2,7 +2,7 @@
echo "Sourcing python-catch-conflicts-hook.sh" echo "Sourcing python-catch-conflicts-hook.sh"
pythonCatchConflictsPhase() { pythonCatchConflictsPhase() {
PYTHONPATH="@setuptools@/@pythonSitePackages@:$PYTHONPATH" @pythonInterpreter@ @catchConflicts@ @pythonInterpreter@ @catchConflicts@
} }
if [ -z "${dontUsePythonCatchConflicts-}" ]; then if [ -z "${dontUsePythonCatchConflicts-}" ]; then

View File

@ -1,10 +0,0 @@
# Setup hook for storing dist folder (wheels/sdists) in a separate output
echo "Sourcing python-catch-conflicts-hook.sh"
pythonOutputDistPhase() {
echo "Executing pythonOutputDistPhase"
mv "dist" "$dist"
echo "Finished executing pythonOutputDistPhase"
}
preFixupPhases+=" pythonOutputDistPhase"

View File

@ -17,7 +17,6 @@
, pythonCatchConflictsHook , pythonCatchConflictsHook
, pythonImportsCheckHook , pythonImportsCheckHook
, pythonNamespacesHook , pythonNamespacesHook
, pythonOutputDistHook
, pythonRemoveBinBytecodeHook , pythonRemoveBinBytecodeHook
, pythonRemoveTestsDirHook , pythonRemoveTestsDirHook
, setuptoolsBuildHook , setuptoolsBuildHook
@ -50,8 +49,6 @@
# Enabled to detect some (native)BuildInputs mistakes # Enabled to detect some (native)BuildInputs mistakes
, strictDeps ? true , strictDeps ? true
, outputs ? [ "out" ]
# used to disable derivation, useful for specific python versions # used to disable derivation, useful for specific python versions
, disabled ? false , disabled ? false
@ -109,13 +106,11 @@ else
let let
inherit (python) stdenv; inherit (python) stdenv;
withDistOutput = lib.elem format ["pyproject" "setuptools" "flit"];
name_ = name; name_ = name;
self = toPythonModule (stdenv.mkDerivation ((builtins.removeAttrs attrs [ self = toPythonModule (stdenv.mkDerivation ((builtins.removeAttrs attrs [
"disabled" "checkPhase" "checkInputs" "doCheck" "doInstallCheck" "dontWrapPythonPrograms" "catchConflicts" "format" "disabled" "checkPhase" "checkInputs" "doCheck" "doInstallCheck" "dontWrapPythonPrograms" "catchConflicts" "format"
"disabledTestPaths" "outputs" "disabledTestPaths"
]) // { ]) // {
name = namePrefix + name_; name = namePrefix + name_;
@ -126,7 +121,7 @@ let
ensureNewerSourcesForZipFilesHook # move to wheel installer (pip) or builder (setuptools, flit, ...)? ensureNewerSourcesForZipFilesHook # move to wheel installer (pip) or builder (setuptools, flit, ...)?
pythonRemoveTestsDirHook pythonRemoveTestsDirHook
] ++ lib.optionals catchConflicts [ ] ++ lib.optionals catchConflicts [
pythonCatchConflictsHook setuptools pythonCatchConflictsHook
] ++ lib.optionals removeBinBytecode [ ] ++ lib.optionals removeBinBytecode [
pythonRemoveBinBytecodeHook pythonRemoveBinBytecodeHook
] ++ lib.optionals (lib.hasSuffix "zip" (attrs.src.name or "")) [ ] ++ lib.optionals (lib.hasSuffix "zip" (attrs.src.name or "")) [
@ -149,8 +144,6 @@ let
] ++ lib.optionals (python.pythonAtLeast "3.3") [ ] ++ lib.optionals (python.pythonAtLeast "3.3") [
# Optionally enforce PEP420 for python3 # Optionally enforce PEP420 for python3
pythonNamespacesHook pythonNamespacesHook
] ++ lib.optionals withDistOutput [
pythonOutputDistHook
] ++ nativeBuildInputs; ] ++ nativeBuildInputs;
buildInputs = buildInputs ++ pythonPath; buildInputs = buildInputs ++ pythonPath;
@ -184,8 +177,6 @@ let
# Python packages built through cross-compilation are always for the host platform. # Python packages built through cross-compilation are always for the host platform.
disallowedReferences = lib.optionals (python.stdenv.hostPlatform != python.stdenv.buildPlatform) [ python.pythonForBuild ]; disallowedReferences = lib.optionals (python.stdenv.hostPlatform != python.stdenv.buildPlatform) [ python.pythonForBuild ];
outputs = outputs ++ lib.optional withDistOutput "dist";
meta = { meta = {
# default to python's platforms # default to python's platforms
platforms = python.meta.platforms; platforms = python.meta.platforms;

View File

@ -119,7 +119,6 @@ in {
pythonCatchConflictsHook pythonCatchConflictsHook
pythonImportsCheckHook pythonImportsCheckHook
pythonNamespacesHook pythonNamespacesHook
pythonOutputDistHook
pythonRecompileBytecodeHook pythonRecompileBytecodeHook
pythonRelaxDepsHook pythonRelaxDepsHook
pythonRemoveBinBytecodeHook pythonRemoveBinBytecodeHook