diff --git a/pkgs/development/interpreters/python/hooks/default.nix b/pkgs/development/interpreters/python/hooks/default.nix index 5d605b240ad8..903ad0215cdf 100644 --- a/pkgs/development/interpreters/python/hooks/default.nix +++ b/pkgs/development/interpreters/python/hooks/default.nix @@ -92,9 +92,8 @@ in rec { pythonCatchConflictsHook = callPackage ({ setuptools }: makeSetupHook { name = "python-catch-conflicts-hook"; - deps = [ setuptools ]; substitutions = { - inherit pythonInterpreter; + inherit pythonInterpreter pythonSitePackages setuptools; catchConflicts=../catch_conflicts/catch_conflicts.py; }; } ./python-catch-conflicts-hook.sh) {}; diff --git a/pkgs/development/interpreters/python/hooks/python-catch-conflicts-hook.sh b/pkgs/development/interpreters/python/hooks/python-catch-conflicts-hook.sh index 374a2eddb407..0abcad3c42f2 100644 --- a/pkgs/development/interpreters/python/hooks/python-catch-conflicts-hook.sh +++ b/pkgs/development/interpreters/python/hooks/python-catch-conflicts-hook.sh @@ -2,7 +2,7 @@ echo "Sourcing python-catch-conflicts-hook.sh" pythonCatchConflictsPhase() { - @pythonInterpreter@ @catchConflicts@ + PYTHONPATH="@setuptools@/@pythonSitePackages@:$PYTHONPATH" @pythonInterpreter@ @catchConflicts@ } if [ -z "${dontUsePythonCatchConflicts-}" ]; then diff --git a/pkgs/development/interpreters/python/mk-python-derivation.nix b/pkgs/development/interpreters/python/mk-python-derivation.nix index f37ad592cb49..a032c08d2a82 100644 --- a/pkgs/development/interpreters/python/mk-python-derivation.nix +++ b/pkgs/development/interpreters/python/mk-python-derivation.nix @@ -121,7 +121,7 @@ let ensureNewerSourcesForZipFilesHook # move to wheel installer (pip) or builder (setuptools, flit, ...)? pythonRemoveTestsDirHook ] ++ lib.optionals catchConflicts [ - setuptools pythonCatchConflictsHook + pythonCatchConflictsHook ] ++ lib.optionals removeBinBytecode [ pythonRemoveBinBytecodeHook ] ++ lib.optionals (lib.hasSuffix "zip" (attrs.src.name or "")) [