From fe4bcd08a9fbdd4a2874a67b4491991a76d784a7 Mon Sep 17 00:00:00 2001 From: Christoph Reiter Date: Mon, 10 Mar 2025 08:38:48 +0100 Subject: [PATCH] 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. --- .github/workflows/build.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6405ee2..9ac81af 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -136,18 +136,23 @@ jobs: persist-credentials: false - uses: actions/setup-python@v5 + id: python with: python-version: '3.13' cache: 'pip' cache-dependency-path: 'requirements.txt' # Note that ARM64 prior to Win11 requires x86, but this will install x64 architecture: 'x64' + # Avoid it setting CMake/pkg-config variables + # https://github.com/actions/setup-python/blob/main/docs/advanced-usage.md#environment-variables + update-environment: false - name: Install deps env: PIP_DISABLE_PIP_VERSION_CHECK: 1 + PYTHON_PATH: ${{ steps.python.outputs.python-path }} run: | - python -m venv .venv + & "$env:PYTHON_PATH" -m venv .venv .\.venv\Scripts\activate python -m pip install -r requirements.txt echo "$env:VIRTUAL_ENV\Scripts" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append