Skip to content

Commit

Permalink
Pin Python version in CI (#905) (#906)
Browse files Browse the repository at this point in the history
* 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 5f73e76)

Co-authored-by: Matthew Treinish <mtreinish@kortar.org>
  • Loading branch information
mergify[bot] and mtreinish committed Jun 20, 2023
1 parent 2baaf11 commit 283a663
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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" },
Expand All @@ -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:
Expand Down

0 comments on commit 283a663

Please sign in to comment.