Skip to content

Commit 1359fd3

Browse files
committed
fix(ci): add --no-isolation to python -m build to fix semantic release
python -m build runs in isolation mode by default, which spawns a pip subprocess to install build deps into a temporary environment. In a uv-managed venv, .venv/bin/pip is a non-functional stub that cannot execute when uv is not on PATH (as in the semantic-release Action subprocess environment). --no-isolation uses the already-populated venv directly, bypassing the pip subprocess entirely. setuptools and wheel are already present from uv sync --all-extras.
1 parent ca89e3e commit 1359fd3

1 file changed

Lines changed: 7 additions & 21 deletions

File tree

dev-tools/package/build.sh

Lines changed: 7 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -29,27 +29,13 @@ if [ "$QUIET" = false ]; then
2929
fi
3030
rm -rf dist/ build/ -- *.egg-info/
3131

32-
# Install build dependencies if needed
32+
# Verify build dependencies are present (declared in pyproject.toml dev deps)
3333
if [ "$QUIET" = false ]; then
3434
echo "INFO: Checking build dependencies..."
3535
fi
3636
if ! $RUN_TOOL python -c "import build" 2>/dev/null; then
37-
if [ "$QUIET" = false ]; then
38-
echo "INFO: Installing build dependencies..."
39-
fi
40-
if command -v uv >/dev/null 2>&1; then
41-
if [ "$QUIET" = true ]; then
42-
$RUN_TOOL uv add --dev build >/dev/null 2>&1
43-
else
44-
$RUN_TOOL uv add --dev build
45-
fi
46-
else
47-
if [ "$QUIET" = true ]; then
48-
$RUN_TOOL pip install build >/dev/null 2>&1
49-
else
50-
$RUN_TOOL pip install build
51-
fi
52-
fi
37+
echo "ERROR: 'build' package not found. Ensure 'uv sync --all-extras' has been run." >&2
38+
exit 1
5339
fi
5440

5541
# Build package
@@ -61,17 +47,17 @@ if [ "$QUIET" = true ]; then
6147
# Suppress all output in quiet mode
6248
if [ -n "$BUILD_ARGS" ]; then
6349
# shellcheck disable=SC2086
64-
$RUN_TOOL python -m build $BUILD_ARGS >/dev/null 2>&1
50+
$RUN_TOOL python -m build --no-isolation $BUILD_ARGS >/dev/null 2>&1
6551
else
66-
$RUN_TOOL python -m build >/dev/null 2>&1
52+
$RUN_TOOL python -m build --no-isolation >/dev/null 2>&1
6753
fi
6854
else
6955
# Normal output
7056
if [ -n "$BUILD_ARGS" ]; then
7157
# shellcheck disable=SC2086
72-
$RUN_TOOL python -m build $BUILD_ARGS 2>/dev/null
58+
$RUN_TOOL python -m build --no-isolation $BUILD_ARGS 2>/dev/null
7359
else
74-
$RUN_TOOL python -m build 2>/dev/null
60+
$RUN_TOOL python -m build --no-isolation 2>/dev/null
7561
fi
7662
fi
7763

0 commit comments

Comments
 (0)