pypaBuildHook: handle pypaBuildFlags __structuredAttrs-agnostically

This commit is contained in:
Yueh-Shun Li
2024-10-28 22:22:41 +08:00
parent 3a0f6fabff
commit 1f39bb6586
2 changed files with 10 additions and 2 deletions
@@ -5,8 +5,16 @@ pypaBuildPhase() {
echo "Executing pypaBuildPhase"
runHook preBuild
local -a flagsArray=(
--no-isolation
--outdir dist/
--wheel
)
concatTo flagsArray pypaBuildFlags
echo "Creating a wheel..."
@build@/bin/pyproject-build --no-isolation --outdir dist/ --wheel $pypaBuildFlags
echoCmd 'pypa build flags' "${flagsArray[@]}"
@build@/bin/pyproject-build "${flagsArray[@]}"
echo "Finished creating a wheel..."
runHook postBuild
@@ -1,7 +1,7 @@
mesonPythonBuildFlagsHook() {
# Add all of mesonFlags to -Csetup-args for pypa builds
for f in $mesonFlags; do
pypaBuildFlags+=" -Csetup-args=$f"
appendToVar pypaBuildFlags "-Csetup-args=$f"
# This requires pip>23.0.1, see: https://meson-python.readthedocs.io/en/latest/how-to-guides/config-settings.html
appendToVar pipBuildFlags "--config-settings=setup-args=$f"
done