-
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: Introduce & use pyprojectPypaBuildHook for cross builds
The way uv invokes it's environment scripts with `-I` (isolated mode) is incompatible with how nixpkgs sets up cross builds. Nixpkgs relies on sysconfig coming through PYTHONPATH, which is ignored in isolated mode.
- Loading branch information
1 parent
339d745
commit eb94196
Showing
3 changed files
with
47 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Setup hook to use for PEP-621/setuptools builds | ||
echo "Sourcing pyproject-build-hook" | ||
|
||
pyprojectPypaBuildPhase() { | ||
echo "Executing pyprojectPypaBuildPhase" | ||
runHook preBuild | ||
|
||
echo "Creating a wheel..." | ||
env PYTHONPATH="${NIX_PYPROJECT_PYTHONPATH}:${PYTHONPATH}" @build@/bin/pyproject-build --no-isolation --outdir dist/ --wheel $pypaBuildFlags | ||
|
||
runHook postBuild | ||
echo "Finished executing pyprojectPypaBuildPhase" | ||
} | ||
|
||
if [ -z "${dontUsePyprojectPypaBuild-}" ] && [ -z "${buildPhase-}" ]; then | ||
echo "Using pyprojectPypaBuildPhase" | ||
buildPhase=pyprojectPypaBuildPhase | ||
fi |