diff --git a/pkgs/development/interpreters/python/hooks/default.nix b/pkgs/development/interpreters/python/hooks/default.nix index d06f3db334da7..fcc655d641856 100644 --- a/pkgs/development/interpreters/python/hooks/default.nix +++ b/pkgs/development/interpreters/python/hooks/default.nix @@ -2,7 +2,6 @@ self: dontUse: with self; let inherit (python) pythonOnBuildForHost; - inherit (pkgs) runCommand; pythonInterpreter = pythonOnBuildForHost.interpreter; pythonSitePackages = python.sitePackages; pythonCheckInterpreter = python.interpreter; @@ -58,7 +57,6 @@ in { pypaBuildHook = callPackage ({ makePythonHook, build, wheel }: makePythonHook { name = "pypa-build-hook.sh"; - propagatedBuildInputs = [ wheel ]; substitutions = { inherit build; }; @@ -68,8 +66,8 @@ in { # Such conflicts don't happen within the standard nixpkgs python package # set, but in downstream projects that build packages depending on other # versions of this hook's dependencies. - passthru.tests = import ./pypa-build-hook-test.nix { - inherit pythonOnBuildForHost runCommand; + passthru.tests = callPackage ./pypa-build-hook-tests.nix { + inherit pythonOnBuildForHost; }; } ./pypa-build-hook.sh) { inherit (pythonOnBuildForHost.pkgs) build; diff --git a/pkgs/development/interpreters/python/hooks/pypa-build-hook-test.nix b/pkgs/development/interpreters/python/hooks/pypa-build-hook-tests.nix similarity index 95% rename from pkgs/development/interpreters/python/hooks/pypa-build-hook-test.nix rename to pkgs/development/interpreters/python/hooks/pypa-build-hook-tests.nix index 4153c21ca4f97..59c60c8c53ba0 100644 --- a/pkgs/development/interpreters/python/hooks/pypa-build-hook-test.nix +++ b/pkgs/development/interpreters/python/hooks/pypa-build-hook-tests.nix @@ -25,6 +25,7 @@ # At least one dependency of `build` should be included here to # keep the test meaningful (mkConflict pythonOnBuildForHost.pkgs.tomli) + (mkConflict pythonOnBuildForHost.pkgs.wheel) # setuptools is also needed to build the example project pythonOnBuildForHost.pkgs.setuptools ]; diff --git a/pkgs/development/python-modules/build/default.nix b/pkgs/development/python-modules/build/default.nix index 4b06298f1d26f..58c1d81906384 100644 --- a/pkgs/development/python-modules/build/default.nix +++ b/pkgs/development/python-modules/build/default.nix @@ -11,6 +11,7 @@ , pytest-rerunfailures , pytest-xdist , pytestCheckHook +, python3 , pythonOlder , setuptools , tomli @@ -93,6 +94,12 @@ buildPythonPackage rec { "build" ]; + # Add the wheel dependency via a wrapper. + # DO NOT use propagatedBuildInputs to prevent leakage into the build env. + makeWrapperArgs = [ + ''--suffix PYTHONPATH : "${wheel}/${python3.sitePackages}"'' + ]; + meta = with lib; { mainProgram = "pyproject-build"; description = "Simple, correct PEP517 package builder";