Skip to content

Commit

Permalink
pyprojectInstallHook: Use uv's byte code compilation instead of custo…
Browse files Browse the repository at this point in the history
…m hook

And only use custom hook for cross where we can't yet use uv.
  • Loading branch information
adisbladis committed Nov 20, 2024
1 parent edd08c3 commit 55201d6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions build/hooks/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ in
pyprojectBytecodeHook,
pyprojectOutputSetupHook,
python,
stdenv,
}:
makeSetupHook {
name = "pyproject-hook";
Expand All @@ -212,9 +213,8 @@ in
pyprojectConfigureHook
pyprojectBuildHook
pyprojectInstallHook
pyprojectBytecodeHook
pyprojectOutputSetupHook
];
] ++ lib.optional (stdenv.buildPlatform != stdenv.hostPlatform) pyprojectBytecodeHook;
} ./meta-hook.sh
)
(
Expand Down
4 changes: 4 additions & 0 deletions build/hooks/pyproject-install-hook.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ pyprojectInstallPhase() {

pushd dist >/dev/null

if [ -z "${UV_COMPILE_BYTECODE-}" ]; then
export UV_COMPILE_BYTECODE=1
fi

for wheel in ./*.whl; do
@uv@/bin/uv pip --offline --no-cache install --no-deps --link-mode=copy --python=@pythonInterpreter@ --system --prefix "$out" $uvPipInstallFlags "$wheel"
echo "Successfully installed $wheel"
Expand Down

0 comments on commit 55201d6

Please sign in to comment.