mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-02-04 11:15:12 +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
|
||||
echo "Sourcing pip-build-hook"
|
||||
# shellcheck shell=bash
|
||||
|
||||
declare -a pipBuildFlags
|
||||
echo "Sourcing pip-build-hook"
|
||||
|
||||
pipBuildPhase() {
|
||||
echo "Executing pipBuildPhase"
|
||||
runHook preBuild
|
||||
|
||||
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..."
|
||||
@pythonInterpreter@ -m pip wheel \
|
||||
--verbose \
|
||||
--no-index \
|
||||
--no-deps \
|
||||
--no-clean \
|
||||
--no-build-isolation \
|
||||
--wheel-dir dist \
|
||||
$pipBuildFlags .
|
||||
echoCmd 'pip build flags' "${flagsArray[@]}"
|
||||
@pythonInterpreter@ -m pip wheel "${flagsArray[@]}" .
|
||||
echo "Finished creating a wheel..."
|
||||
|
||||
runHook postBuild
|
||||
|
@ -3,7 +3,7 @@ mesonPythonBuildFlagsHook() {
|
||||
for f in $mesonFlags; do
|
||||
pypaBuildFlags+=" -Csetup-args=$f"
|
||||
# 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
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user