2019-07-17 20:36:47 +02:00
|
|
|
# Setup hook to use for pip projects
|
|
|
|
echo "Sourcing pip-build-hook"
|
|
|
|
|
|
|
|
pipBuildPhase() {
|
|
|
|
echo "Executing pipBuildPhase"
|
|
|
|
runHook preBuild
|
|
|
|
|
|
|
|
mkdir -p dist
|
|
|
|
echo "Creating a wheel..."
|
2021-05-17 12:22:48 +02:00
|
|
|
@pythonInterpreter@ -m pip wheel --verbose --no-index --no-deps --no-clean --no-build-isolation --wheel-dir dist .
|
2019-07-17 20:36:47 +02:00
|
|
|
echo "Finished creating a wheel..."
|
|
|
|
|
|
|
|
runHook postBuild
|
|
|
|
echo "Finished executing pipBuildPhase"
|
|
|
|
}
|
|
|
|
|
|
|
|
pipShellHook() {
|
|
|
|
echo "Executing pipShellHook"
|
|
|
|
runHook preShellHook
|
|
|
|
|
|
|
|
# Long-term setup.py should be dropped.
|
|
|
|
if [ -e pyproject.toml ]; then
|
|
|
|
tmp_path=$(mktemp -d)
|
|
|
|
export PATH="$tmp_path/bin:$PATH"
|
|
|
|
export PYTHONPATH="$tmp_path/@pythonSitePackages@:$PYTHONPATH"
|
|
|
|
mkdir -p "$tmp_path/@pythonSitePackages@"
|
2020-06-06 09:48:21 +02:00
|
|
|
@pythonInterpreter@ -m pip install -e . --prefix "$tmp_path" \
|
|
|
|
--no-build-isolation >&2
|
2019-07-17 20:36:47 +02:00
|
|
|
fi
|
|
|
|
|
|
|
|
runHook postShellHook
|
|
|
|
echo "Finished executing pipShellHook"
|
|
|
|
}
|
|
|
|
|
2019-10-31 18:59:18 +01:00
|
|
|
if [ -z "${dontUsePipBuild-}" ] && [ -z "${buildPhase-}" ]; then
|
2019-07-17 20:36:47 +02:00
|
|
|
echo "Using pipBuildPhase"
|
|
|
|
buildPhase=pipBuildPhase
|
|
|
|
fi
|
|
|
|
|
2019-11-20 05:05:59 +01:00
|
|
|
if [ -z "${shellHook-}" ]; then
|
2019-07-17 20:36:47 +02:00
|
|
|
echo "Using pipShellHook"
|
|
|
|
shellHook=pipShellHook
|
|
|
|
fi
|