mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-04-08 13:56:50 +00:00
pipBuildHook: handle pipBuildFlags __structuredAttrs
-agnostically
This commit is contained in:
parent
1f8bb94bca
commit
c4bc1a8bb6
@ -1,22 +1,27 @@
|
|||||||
# Setup hook to use for pip projects
|
# Setup hook to use for pip projects
|
||||||
echo "Sourcing pip-build-hook"
|
# shellcheck shell=bash
|
||||||
|
|
||||||
declare -a pipBuildFlags
|
echo "Sourcing pip-build-hook"
|
||||||
|
|
||||||
pipBuildPhase() {
|
pipBuildPhase() {
|
||||||
echo "Executing pipBuildPhase"
|
echo "Executing pipBuildPhase"
|
||||||
runHook preBuild
|
runHook preBuild
|
||||||
|
|
||||||
mkdir -p dist
|
mkdir -p dist
|
||||||
|
|
||||||
|
local -a flagsArray=(
|
||||||
|
--verbose
|
||||||
|
--no-index
|
||||||
|
--no-deps
|
||||||
|
--no-clean
|
||||||
|
--no-build-isolation
|
||||||
|
--wheel-dir dist
|
||||||
|
)
|
||||||
|
concatTo flagsArray pipBuildFlags
|
||||||
|
|
||||||
echo "Creating a wheel..."
|
echo "Creating a wheel..."
|
||||||
@pythonInterpreter@ -m pip wheel \
|
echoCmd 'pip build flags' "${flagsArray[@]}"
|
||||||
--verbose \
|
@pythonInterpreter@ -m pip wheel "${flagsArray[@]}" .
|
||||||
--no-index \
|
|
||||||
--no-deps \
|
|
||||||
--no-clean \
|
|
||||||
--no-build-isolation \
|
|
||||||
--wheel-dir dist \
|
|
||||||
$pipBuildFlags .
|
|
||||||
echo "Finished creating a wheel..."
|
echo "Finished creating a wheel..."
|
||||||
|
|
||||||
runHook postBuild
|
runHook postBuild
|
||||||
|
@ -3,7 +3,7 @@ mesonPythonBuildFlagsHook() {
|
|||||||
for f in $mesonFlags; do
|
for f in $mesonFlags; do
|
||||||
pypaBuildFlags+=" -Csetup-args=$f"
|
pypaBuildFlags+=" -Csetup-args=$f"
|
||||||
# This requires pip>23.0.1, see: https://meson-python.readthedocs.io/en/latest/how-to-guides/config-settings.html
|
# This requires pip>23.0.1, see: https://meson-python.readthedocs.io/en/latest/how-to-guides/config-settings.html
|
||||||
pipBuildFlags+=" --config-settings=setup-args=$f"
|
appendToVar pipBuildFlags "--config-settings=setup-args=$f"
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user