Skip to content

Commit fe4bcd0

Browse files
committed
CI: disable "update-environment" for "setup-python"
setup-python, by default, sets various cmake and pkg-config env vars, so that packages using cmake can be built. Since this might interfere with out package builds disable it. We only care about the Python executable itself, so use the action output to create the venv.
1 parent 47cc05c commit fe4bcd0

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

β€Ž.github/workflows/build.ymlβ€Ž

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,18 +136,23 @@ jobs:
136136
persist-credentials: false
137137

138138
- uses: actions/setup-python@v5
139+
id: python
139140
with:
140141
python-version: '3.13'
141142
cache: 'pip'
142143
cache-dependency-path: 'requirements.txt'
143144
# Note that ARM64 prior to Win11 requires x86, but this will install x64
144145
architecture: 'x64'
146+
# Avoid it setting CMake/pkg-config variables
147+
# https://github.com/actions/setup-python/blob/main/docs/advanced-usage.md#environment-variables
148+
update-environment: false
145149

146150
- name: Install deps
147151
env:
148152
PIP_DISABLE_PIP_VERSION_CHECK: 1
153+
PYTHON_PATH: ${{ steps.python.outputs.python-path }}
149154
run: |
150-
python -m venv .venv
155+
& "$env:PYTHON_PATH" -m venv .venv
151156
.\.venv\Scripts\activate
152157
python -m pip install -r requirements.txt
153158
echo "$env:VIRTUAL_ENV\Scripts" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append

0 commit comments

Comments
Β (0)