From 283a663633f7681acb4b730762bb89ed33ca3857 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Tue, 20 Jun 2023 16:14:12 -0400 Subject: [PATCH] Pin Python version in CI (#905) (#906) * Pin Python version in CI Recently github updated the cached version of python installed for 3.7 in the CI environment to 3.7.17. This new binary was not built with bz2 support which is causing failures in our CI jobs that run with 3.7. While we'll be dropping 3.7 support from the main branch (for 0.14.0) in the near future we still support 3.7 on the stable 0.13.x series. This commit pins the python version to the previous patch release which was known to work. * Use 3.7 on windows * Fix windows capitalization * Fix syntax error (cherry picked from commit 5f73e767fb74ec4ff8e9cf6a2dc6de2c95f30144) Co-authored-by: Matthew Treinish --- .github/workflows/main.yml | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2520c934f..1f8642482 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -57,7 +57,7 @@ jobs: strategy: matrix: rust: [stable] - python-version: [3.7, 3.8, 3.9, "3.10", "3.11"] + python-version: ['3.7.16', 3.8, 3.9, "3.10", "3.11"] platform: [ { os: "macOS-latest", python-architecture: "x64", rust-target: "x86_64-apple-darwin" }, { os: "ubuntu-latest", python-architecture: "x64", rust-target: "x86_64-unknown-linux-gnu" }, @@ -76,6 +76,20 @@ jobs: with: python-version: ${{ matrix.python-version }} architecture: ${{ matrix.platform.python-architecture }} + if: runner.os != 'Windows' + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: 3.7 + architecture: ${{ matrix.platform.python-architecture }} + if: ${{ runner.os == 'Windows' && matrix.python-version == '3.7.16' }} + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + architecture: ${{ matrix.platform.python-architecture }} + if: ${{ runner.os == 'Windows' && matrix.python-version != '3.7.16' }} + - name: Install Rust toolchain uses: dtolnay/rust-toolchain@master with: