Skip to content

Commit

Permalink
build.hooks: Pass UV_NO_CONFIG to uv build/install frontend
Browse files Browse the repository at this point in the history
  • Loading branch information
adisbladis committed Dec 24, 2024
1 parent 0a65248 commit 3f40cde
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 8 deletions.
17 changes: 17 additions & 0 deletions build/hooks/pyproject-configure-hook.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,23 @@ pyprojectConfigurePhase() {
# information from the cross compiled Python.
export PYTHONPATH=@pythonPath@

# Compile bytecode by default.
if [ -z "${UV_COMPILE_BYTECODE-}" ]; then
export UV_COMPILE_BYTECODE=1
fi

# Opt out of uv-specific installer metadata that causes non-reproducible builds.
if [ -z "${UV_NO_INSTALLER_METADATA-}" ]; then
export UV_NO_INSTALLER_METADATA=1
fi

# Don't load uv config from pyproject.toml & such.
# Loading config might cause uv-specific behaviour defined in tool.uv such as
# find-links to fail at build time.0984dhbb
if [ -z "${UV_NO_CONFIG-}" ]; then
export UV_NO_CONFIG=1
fi

runHook postConfigure
echo "Finished executing pyprojectConfigurePhase"
}
Expand Down
8 changes: 0 additions & 8 deletions build/hooks/pyproject-install-hook.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,6 @@ pyprojectInstallPhase() {

pushd dist >/dev/null

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

if [ -z "${UV_NO_INSTALLER_METADATA-}" ]; then
export UV_NO_INSTALLER_METADATA=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 3f40cde

Please sign in to comment.