Skip to content

Commit 1d336b6

Browse files
committed
Enhance release workflow by improving virtual environment setup and error handling. Ensure the environment is activated before installing dependencies and add a check for the existence of the virtual environment.
1 parent 019e1d6 commit 1d336b6

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

.github/workflows/_release.yml

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,14 +136,20 @@ jobs:
136136
# - attempt install again after 5 seconds if it fails because there is
137137
# sometimes a delay in availability on test pypi
138138
run: |
139+
set -euo pipefail
140+
139141
uv venv
140-
VIRTUAL_ENV=.venv uv pip install dist/*.whl
142+
# Activate the environment so every subsequent command (including python)
143+
# operates inside the freshly created venv that has the built wheel installed.
144+
source .venv/bin/activate
145+
146+
uv pip install dist/*.whl
141147
142148
# Replace all dashes in the package name with underscores,
143149
# since that's how Python imports packages with dashes in the name.
144150
IMPORT_NAME="$(echo "$PKG_NAME" | sed s/-/_/g)"
145151
146-
uv run python -c "import $IMPORT_NAME; print(dir($IMPORT_NAME))"
152+
python -c "import $IMPORT_NAME; print(dir($IMPORT_NAME))"
147153
148154
- name: Import test dependencies
149155
run: uv sync --group test
@@ -157,7 +163,14 @@ jobs:
157163
PKG_NAME: ${{ needs.build.outputs.pkg-name }}
158164
VERSION: ${{ needs.build.outputs.version }}
159165
run: |
160-
VIRTUAL_ENV=.venv uv pip install dist/*.whl
166+
set -euo pipefail
167+
168+
if [ ! -d ".venv" ]; then
169+
uv venv
170+
fi
171+
172+
source .venv/bin/activate
173+
uv pip install dist/*.whl
161174
162175
- name: Run unit tests
163176
run: make tests

0 commit comments

Comments
 (0)