From d148dc0fe0f81064a22b763eea9fbcf90b0b810f Mon Sep 17 00:00:00 2001 From: eleanorjboyd <26030610+eleanorjboyd@users.noreply.github.com> Date: Thu, 24 Sep 2026 12:41:06 -0700 Subject: [PATCH 1/3] Fix CI venv setup collision and log existing paths The venv matrix failed on both Windows and Linux when .venv was already occupied. Give the venv test interpreter a distinct path and log .venv state around setup so the producer of the collision can be identified in the next CI run.\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .github/workflows/build.yml | 15 ++++++++++++--- .github/workflows/pr-check.yml | 30 ++++++++++++++++++++++++------ 2 files changed, 36 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 10bd0449de12..e665ec155a70 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -290,8 +290,12 @@ jobs: shell: pwsh if: matrix.test-suite == 'venv' run: | + Write-Output '.venv before pipenv:' + Get-Item -Force .venv -ErrorAction SilentlyContinue | Format-List FullName,Mode,LinkType,Target,Length python -m pip install pipenv python -m pipenv run python ./build/ci/addEnvPath.py ${{ env.PYTHON_VIRTUAL_ENVS_LOCATION }} pipenvPath + Write-Output '.venv after pipenv:' + Get-Item -Force .venv -ErrorAction SilentlyContinue | Format-List FullName,Mode,LinkType,Target,Length - name: Prepare poetry for venv tests env: @@ -302,6 +306,8 @@ jobs: python -m pip install poetry Move-Item -Path ".\build\ci\pyproject.toml" -Destination . poetry env use python + Write-Output '.venv after poetry:' + Get-Item -Force .venv -ErrorAction SilentlyContinue | Format-List FullName,Mode,LinkType,Target,Length - name: Prepare virtualenv for venv tests env: @@ -325,11 +331,14 @@ jobs: shell: pwsh if: matrix.test-suite == 'venv' && startsWith(matrix.python, 3.) run: | - python -m venv .venv + Write-Output '.venv before venv creation:' + Get-Item -Force .venv -ErrorAction SilentlyContinue | Format-List FullName,Mode,LinkType,Target,Length + python -m venv .ci-venv + if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } if ('${{ matrix.os }}' -match 'windows-latest') { - & ".venv/Scripts/python.exe" ./build/ci/addEnvPath.py ${{ env.PYTHON_VIRTUAL_ENVS_LOCATION }} venvPath + & "./.ci-venv/Scripts/python.exe" ./build/ci/addEnvPath.py ${{ env.PYTHON_VIRTUAL_ENVS_LOCATION }} venvPath } else { - & ".venv/bin/python" ./build/ci/addEnvPath.py ${{ env.PYTHON_VIRTUAL_ENVS_LOCATION }} venvPath + & "./.ci-venv/bin/python" ./build/ci/addEnvPath.py ${{ env.PYTHON_VIRTUAL_ENVS_LOCATION }} venvPath } - name: Prepare conda for venv tests diff --git a/.github/workflows/pr-check.yml b/.github/workflows/pr-check.yml index 34869bfcd0cb..a0e74693b587 100644 --- a/.github/workflows/pr-check.yml +++ b/.github/workflows/pr-check.yml @@ -283,8 +283,12 @@ jobs: shell: pwsh if: matrix.test-suite == 'venv' run: | + Write-Output '.venv before pipenv:' + Get-Item -Force .venv -ErrorAction SilentlyContinue | Format-List FullName,Mode,LinkType,Target,Length python -m pip install pipenv python -m pipenv run python ./build/ci/addEnvPath.py ${{ env.PYTHON_VIRTUAL_ENVS_LOCATION }} pipenvPath + Write-Output '.venv after pipenv:' + Get-Item -Force .venv -ErrorAction SilentlyContinue | Format-List FullName,Mode,LinkType,Target,Length - name: Prepare poetry for venv tests env: @@ -295,6 +299,8 @@ jobs: python -m pip install poetry Move-Item -Path ".\build\ci\pyproject.toml" -Destination . poetry env use python + Write-Output '.venv after poetry:' + Get-Item -Force .venv -ErrorAction SilentlyContinue | Format-List FullName,Mode,LinkType,Target,Length - name: Prepare virtualenv for venv tests env: @@ -318,11 +324,14 @@ jobs: shell: pwsh if: matrix.test-suite == 'venv' && startsWith(matrix.python, 3.) run: | - python -m venv .venv + Write-Output '.venv before venv creation:' + Get-Item -Force .venv -ErrorAction SilentlyContinue | Format-List FullName,Mode,LinkType,Target,Length + python -m venv .ci-venv + if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } if ('${{ matrix.os }}' -match 'windows-latest') { - & ".venv/Scripts/python.exe" ./build/ci/addEnvPath.py ${{ env.PYTHON_VIRTUAL_ENVS_LOCATION }} venvPath + & "./.ci-venv/Scripts/python.exe" ./build/ci/addEnvPath.py ${{ env.PYTHON_VIRTUAL_ENVS_LOCATION }} venvPath } else { - & ".venv/bin/python" ./build/ci/addEnvPath.py ${{ env.PYTHON_VIRTUAL_ENVS_LOCATION }} venvPath + & "./.ci-venv/bin/python" ./build/ci/addEnvPath.py ${{ env.PYTHON_VIRTUAL_ENVS_LOCATION }} venvPath } - name: Prepare conda for venv tests @@ -565,8 +574,12 @@ jobs: PYTHON_VIRTUAL_ENVS_LOCATION: './src/tmp/envPaths.json' shell: pwsh run: | + Write-Output '.venv before pipenv:' + Get-Item -Force .venv -ErrorAction SilentlyContinue | Format-List FullName,Mode,LinkType,Target,Length python -m pip install pipenv python -m pipenv run python ./build/ci/addEnvPath.py ${{ env.PYTHON_VIRTUAL_ENVS_LOCATION }} pipenvPath + Write-Output '.venv after pipenv:' + Get-Item -Force .venv -ErrorAction SilentlyContinue | Format-List FullName,Mode,LinkType,Target,Length - name: Prepare poetry for venv tests env: @@ -576,6 +589,8 @@ jobs: python -m pip install poetry Move-Item -Path ".\build\ci\pyproject.toml" -Destination . poetry env use python + Write-Output '.venv after poetry:' + Get-Item -Force .venv -ErrorAction SilentlyContinue | Format-List FullName,Mode,LinkType,Target,Length - name: Prepare virtualenv for venv tests env: @@ -597,11 +612,14 @@ jobs: PYTHON_VIRTUAL_ENVS_LOCATION: './src/tmp/envPaths.json' shell: pwsh run: | - python -m venv .venv + Write-Output '.venv before venv creation:' + Get-Item -Force .venv -ErrorAction SilentlyContinue | Format-List FullName,Mode,LinkType,Target,Length + python -m venv .ci-venv + if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } if ('${{ matrix.os }}' -match 'windows-latest') { - & ".venv/Scripts/python.exe" ./build/ci/addEnvPath.py ${{ env.PYTHON_VIRTUAL_ENVS_LOCATION }} venvPath + & "./.ci-venv/Scripts/python.exe" ./build/ci/addEnvPath.py ${{ env.PYTHON_VIRTUAL_ENVS_LOCATION }} venvPath } else { - & ".venv/bin/python" ./build/ci/addEnvPath.py ${{ env.PYTHON_VIRTUAL_ENVS_LOCATION }} venvPath + & "./.ci-venv/bin/python" ./build/ci/addEnvPath.py ${{ env.PYTHON_VIRTUAL_ENVS_LOCATION }} venvPath } - name: Prepare conda for venv tests From 55789be51d3a4f4cdbf65e71904e5784aea05da4 Mon Sep 17 00:00:00 2001 From: eleanorjboyd <26030610+eleanorjboyd@users.noreply.github.com> Date: Thu, 24 Sep 2026 12:52:49 -0700 Subject: [PATCH 2/3] Prevent virtualenv from redirecting .venv in CI virtualenv 21.12 writes a .venv redirect file next to .virtualenv when a pyproject.toml exists. Disable that redirect so the following stdlib venv step can create its intended .venv directory. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .github/workflows/build.yml | 8 ++++---- .github/workflows/pr-check.yml | 16 ++++++++-------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e665ec155a70..1d94a4fa92cf 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -317,7 +317,7 @@ jobs: if: matrix.test-suite == 'venv' run: | python -m pip install virtualenv - python -m virtualenv .virtualenv/ + python -m virtualenv --no-venv-redirect .virtualenv/ if ('${{ matrix.os }}' -match 'windows-latest') { & ".virtualenv/Scripts/python.exe" ./build/ci/addEnvPath.py ${{ env.PYTHON_VIRTUAL_ENVS_LOCATION }} virtualEnvPath } else { @@ -333,12 +333,12 @@ jobs: run: | Write-Output '.venv before venv creation:' Get-Item -Force .venv -ErrorAction SilentlyContinue | Format-List FullName,Mode,LinkType,Target,Length - python -m venv .ci-venv + python -m venv .venv if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } if ('${{ matrix.os }}' -match 'windows-latest') { - & "./.ci-venv/Scripts/python.exe" ./build/ci/addEnvPath.py ${{ env.PYTHON_VIRTUAL_ENVS_LOCATION }} venvPath + & "./.venv/Scripts/python.exe" ./build/ci/addEnvPath.py ${{ env.PYTHON_VIRTUAL_ENVS_LOCATION }} venvPath } else { - & "./.ci-venv/bin/python" ./build/ci/addEnvPath.py ${{ env.PYTHON_VIRTUAL_ENVS_LOCATION }} venvPath + & "./.venv/bin/python" ./build/ci/addEnvPath.py ${{ env.PYTHON_VIRTUAL_ENVS_LOCATION }} venvPath } - name: Prepare conda for venv tests diff --git a/.github/workflows/pr-check.yml b/.github/workflows/pr-check.yml index a0e74693b587..342ac9b95aa5 100644 --- a/.github/workflows/pr-check.yml +++ b/.github/workflows/pr-check.yml @@ -310,7 +310,7 @@ jobs: if: matrix.test-suite == 'venv' run: | python -m pip install virtualenv - python -m virtualenv .virtualenv/ + python -m virtualenv --no-venv-redirect .virtualenv/ if ('${{ matrix.os }}' -match 'windows-latest') { & ".virtualenv/Scripts/python.exe" ./build/ci/addEnvPath.py ${{ env.PYTHON_VIRTUAL_ENVS_LOCATION }} virtualEnvPath } else { @@ -326,12 +326,12 @@ jobs: run: | Write-Output '.venv before venv creation:' Get-Item -Force .venv -ErrorAction SilentlyContinue | Format-List FullName,Mode,LinkType,Target,Length - python -m venv .ci-venv + python -m venv .venv if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } if ('${{ matrix.os }}' -match 'windows-latest') { - & "./.ci-venv/Scripts/python.exe" ./build/ci/addEnvPath.py ${{ env.PYTHON_VIRTUAL_ENVS_LOCATION }} venvPath + & "./.venv/Scripts/python.exe" ./build/ci/addEnvPath.py ${{ env.PYTHON_VIRTUAL_ENVS_LOCATION }} venvPath } else { - & "./.ci-venv/bin/python" ./build/ci/addEnvPath.py ${{ env.PYTHON_VIRTUAL_ENVS_LOCATION }} venvPath + & "./.venv/bin/python" ./build/ci/addEnvPath.py ${{ env.PYTHON_VIRTUAL_ENVS_LOCATION }} venvPath } - name: Prepare conda for venv tests @@ -599,7 +599,7 @@ jobs: shell: pwsh run: | python -m pip install virtualenv - python -m virtualenv .virtualenv/ + python -m virtualenv --no-venv-redirect .virtualenv/ if ('${{ matrix.os }}' -match 'windows-latest') { & ".virtualenv/Scripts/python.exe" ./build/ci/addEnvPath.py ${{ env.PYTHON_VIRTUAL_ENVS_LOCATION }} virtualEnvPath } else { @@ -614,12 +614,12 @@ jobs: run: | Write-Output '.venv before venv creation:' Get-Item -Force .venv -ErrorAction SilentlyContinue | Format-List FullName,Mode,LinkType,Target,Length - python -m venv .ci-venv + python -m venv .venv if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } if ('${{ matrix.os }}' -match 'windows-latest') { - & "./.ci-venv/Scripts/python.exe" ./build/ci/addEnvPath.py ${{ env.PYTHON_VIRTUAL_ENVS_LOCATION }} venvPath + & "./.venv/Scripts/python.exe" ./build/ci/addEnvPath.py ${{ env.PYTHON_VIRTUAL_ENVS_LOCATION }} venvPath } else { - & "./.ci-venv/bin/python" ./build/ci/addEnvPath.py ${{ env.PYTHON_VIRTUAL_ENVS_LOCATION }} venvPath + & "./.venv/bin/python" ./build/ci/addEnvPath.py ${{ env.PYTHON_VIRTUAL_ENVS_LOCATION }} venvPath } - name: Prepare conda for venv tests From c3b184c0283d9859a120b01c20929d85aca99d32 Mon Sep 17 00:00:00 2001 From: eleanorjboyd <26030610+eleanorjboyd@users.noreply.github.com> Date: Thu, 24 Sep 2026 13:11:14 -0700 Subject: [PATCH 3/3] Remove temporary venv path diagnostics Keep the virtualenv redirect opt-out and explicit venv creation failure check; the path logging is no longer needed now that the collision is confirmed. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .github/workflows/build.yml | 8 -------- .github/workflows/pr-check.yml | 16 ---------------- 2 files changed, 24 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1d94a4fa92cf..66530c11c042 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -290,12 +290,8 @@ jobs: shell: pwsh if: matrix.test-suite == 'venv' run: | - Write-Output '.venv before pipenv:' - Get-Item -Force .venv -ErrorAction SilentlyContinue | Format-List FullName,Mode,LinkType,Target,Length python -m pip install pipenv python -m pipenv run python ./build/ci/addEnvPath.py ${{ env.PYTHON_VIRTUAL_ENVS_LOCATION }} pipenvPath - Write-Output '.venv after pipenv:' - Get-Item -Force .venv -ErrorAction SilentlyContinue | Format-List FullName,Mode,LinkType,Target,Length - name: Prepare poetry for venv tests env: @@ -306,8 +302,6 @@ jobs: python -m pip install poetry Move-Item -Path ".\build\ci\pyproject.toml" -Destination . poetry env use python - Write-Output '.venv after poetry:' - Get-Item -Force .venv -ErrorAction SilentlyContinue | Format-List FullName,Mode,LinkType,Target,Length - name: Prepare virtualenv for venv tests env: @@ -331,8 +325,6 @@ jobs: shell: pwsh if: matrix.test-suite == 'venv' && startsWith(matrix.python, 3.) run: | - Write-Output '.venv before venv creation:' - Get-Item -Force .venv -ErrorAction SilentlyContinue | Format-List FullName,Mode,LinkType,Target,Length python -m venv .venv if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } if ('${{ matrix.os }}' -match 'windows-latest') { diff --git a/.github/workflows/pr-check.yml b/.github/workflows/pr-check.yml index 342ac9b95aa5..45079075899f 100644 --- a/.github/workflows/pr-check.yml +++ b/.github/workflows/pr-check.yml @@ -283,12 +283,8 @@ jobs: shell: pwsh if: matrix.test-suite == 'venv' run: | - Write-Output '.venv before pipenv:' - Get-Item -Force .venv -ErrorAction SilentlyContinue | Format-List FullName,Mode,LinkType,Target,Length python -m pip install pipenv python -m pipenv run python ./build/ci/addEnvPath.py ${{ env.PYTHON_VIRTUAL_ENVS_LOCATION }} pipenvPath - Write-Output '.venv after pipenv:' - Get-Item -Force .venv -ErrorAction SilentlyContinue | Format-List FullName,Mode,LinkType,Target,Length - name: Prepare poetry for venv tests env: @@ -299,8 +295,6 @@ jobs: python -m pip install poetry Move-Item -Path ".\build\ci\pyproject.toml" -Destination . poetry env use python - Write-Output '.venv after poetry:' - Get-Item -Force .venv -ErrorAction SilentlyContinue | Format-List FullName,Mode,LinkType,Target,Length - name: Prepare virtualenv for venv tests env: @@ -324,8 +318,6 @@ jobs: shell: pwsh if: matrix.test-suite == 'venv' && startsWith(matrix.python, 3.) run: | - Write-Output '.venv before venv creation:' - Get-Item -Force .venv -ErrorAction SilentlyContinue | Format-List FullName,Mode,LinkType,Target,Length python -m venv .venv if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } if ('${{ matrix.os }}' -match 'windows-latest') { @@ -574,12 +566,8 @@ jobs: PYTHON_VIRTUAL_ENVS_LOCATION: './src/tmp/envPaths.json' shell: pwsh run: | - Write-Output '.venv before pipenv:' - Get-Item -Force .venv -ErrorAction SilentlyContinue | Format-List FullName,Mode,LinkType,Target,Length python -m pip install pipenv python -m pipenv run python ./build/ci/addEnvPath.py ${{ env.PYTHON_VIRTUAL_ENVS_LOCATION }} pipenvPath - Write-Output '.venv after pipenv:' - Get-Item -Force .venv -ErrorAction SilentlyContinue | Format-List FullName,Mode,LinkType,Target,Length - name: Prepare poetry for venv tests env: @@ -589,8 +577,6 @@ jobs: python -m pip install poetry Move-Item -Path ".\build\ci\pyproject.toml" -Destination . poetry env use python - Write-Output '.venv after poetry:' - Get-Item -Force .venv -ErrorAction SilentlyContinue | Format-List FullName,Mode,LinkType,Target,Length - name: Prepare virtualenv for venv tests env: @@ -612,8 +598,6 @@ jobs: PYTHON_VIRTUAL_ENVS_LOCATION: './src/tmp/envPaths.json' shell: pwsh run: | - Write-Output '.venv before venv creation:' - Get-Item -Force .venv -ErrorAction SilentlyContinue | Format-List FullName,Mode,LinkType,Target,Length python -m venv .venv if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } if ('${{ matrix.os }}' -match 'windows-latest') {