python3.pkgs.pypaBuildHook: init

This commit is contained in:
Doron Behar
2023-07-28 12:13:25 +02:00
committed by Martin Weinelt
parent 1298c367b1
commit 6560d0086c
3 changed files with 35 additions and 2 deletions
@@ -62,6 +62,16 @@ in {
};
} ./pip-build-hook.sh) {};
pypaBuildHook = callPackage ({ makePythonHook, build, wheel }:
makePythonHook {
name = "pypa-build-hook.sh";
propagatedBuildInputs = [ build wheel ];
substitutions = {
inherit pythonInterpreter;
};
} ./pypa-build-hook.sh) {};
pipInstallHook = callPackage ({ makePythonHook, pip }:
makePythonHook {
name = "pip-install-hook";
@@ -0,0 +1,19 @@
# Setup hook to use for pypa/build projects
echo "Sourcing pypa-build-hook"
pypaBuildPhase() {
echo "Executing pypaBuildPhase"
runHook preBuild
echo "Creating a wheel..."
@pythonInterpreter@ -m build --no-isolation --outdir dist/ --wheel $pypaBuildFlags
echo "Finished creating a wheel..."
runHook postBuild
echo "Finished executing pypaBuildPhase"
}
if [ -z "${dontUsePypaBuild-}" ] && [ -z "${buildPhase-}" ]; then
echo "Using pypaBuildPhase"
buildPhase=pypaBuildPhase
fi