From 2ef7ab8b87bc7ebe131eb514c9b1862b6d6bcdac Mon Sep 17 00:00:00 2001 From: Roman Inflianskas Date: Mon, 8 Jul 2024 20:31:21 +0300 Subject: [PATCH] Make Python versions in GitHub Actions consistent Consistently use the following Python versions everywhere in CI: - 3.8 - 3.9 - 3.10 - 3.11 - 3.12 - 3.13 - pypy3.9 - pypy3.10 The heels for Python 3.13 are beneficial for dependent packages such as `jsonschema`. Note that PyPy3.8 was dropped since the PyPy website (https://www.pypy.org/) states they currently support Python versions 3.10, 3.9, and 2.7. To build extension for PyPy on Windows, "generate-import-lib" in `Cargo.toml` is needed: https://github.com/PyO3/maturin-action/issues/267#issuecomment-2106844429 --- .github/workflows/CI.yml | 71 +++++++++++++++++++++++++++++++++++----- Cargo.toml | 4 ++- 2 files changed, 65 insertions(+), 10 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 35eaadd..57cb69f 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -21,7 +21,16 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 with: - python-version: "3.x" + python-version: | + 3.8 + 3.9 + 3.10 + 3.11 + 3.12 + 3.13 + pypy3.9 + pypy3.10 + allow-prereleases: true - uses: pre-commit/action@v3.0.1 list: @@ -64,6 +73,7 @@ jobs: 3.11 3.12 3.13 + pypy3.9 pypy3.10 allow-prereleases: true - name: Set up nox @@ -81,12 +91,21 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 with: - python-version: "3.x" + python-version: | + 3.8 + 3.9 + 3.10 + 3.11 + 3.12 + 3.13 + pypy3.9 + pypy3.10 + allow-prereleases: true - name: Build wheels uses: PyO3/maturin-action@v1 with: target: ${{ matrix.target }} - args: --release --out dist --interpreter '3.8 3.9 3.10 3.11 3.12 pypy3.8 pypy3.9 pypy3.10' + args: --release --out dist --interpreter '3.8 3.9 3.10 3.11 3.12 3.13 pypy3.9 pypy3.10' sccache: "true" manylinux: auto - name: Upload wheels @@ -108,12 +127,21 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 with: - python-version: "3.x" + python-version: | + 3.8 + 3.9 + 3.10 + 3.11 + 3.12 + 3.13 + pypy3.9 + pypy3.10 + allow-prereleases: true - name: Build wheels uses: PyO3/maturin-action@v1 with: target: ${{ matrix.target }} - args: --release --out dist --interpreter '3.8 3.9 3.10 3.11 3.12 pypy3.8 pypy3.9 pypy3.10' + args: --release --out dist --interpreter '3.8 3.9 3.10 3.11 3.12 3.13 pypy3.9 pypy3.10' manylinux: musllinux_1_2 sccache: "true" - name: Upload wheels @@ -127,7 +155,7 @@ jobs: runs-on: windows-latest strategy: matrix: - target: [x64, x86] + target: [x64, x86] # x86 is not supported by pypy steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 @@ -138,12 +166,16 @@ jobs: 3.10 3.11 3.12 + 3.13 + ${{ matrix.target == 'x64' && 'pypy3.9' || '' }} + ${{ matrix.target == 'x64' && 'pypy3.10' || '' }} + allow-prereleases: true architecture: ${{ matrix.target }} - name: Build wheels uses: PyO3/maturin-action@v1 with: target: ${{ matrix.target }} - args: --release --out dist --interpreter '3.8 3.9 3.10 3.11 3.12' + args: --release --out dist --interpreter '3.8 3.9 3.10 3.11 3.12 3.13' -- interpreter ${{ matrix.target == 'x64' && 'pypy3.9 pypy3.10' || '' }} sccache: "true" - name: Upload wheels uses: actions/upload-artifact@v3 @@ -161,12 +193,21 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 with: - python-version: "3.x" + python-version: | + 3.8 + 3.9 + 3.10 + 3.11 + 3.12 + 3.13 + pypy3.9 + pypy3.10 + allow-prereleases: true - name: Build wheels uses: PyO3/maturin-action@v1 with: target: ${{ matrix.target }} - args: --release --out dist --interpreter '3.8 3.9 3.10 3.11 3.12 pypy3.8 pypy3.9 pypy3.10' + args: --release --out dist --interpreter '3.8 3.9 3.10 3.11 3.12 3.13 pypy3.9 pypy3.10' sccache: "true" - name: Upload wheels uses: actions/upload-artifact@v3 @@ -179,6 +220,18 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: | + 3.8 + 3.9 + 3.10 + 3.11 + 3.12 + 3.13 + pypy3.9 + pypy3.10 + allow-prereleases: true - name: Build an sdist uses: PyO3/maturin-action@v1 with: diff --git a/Cargo.toml b/Cargo.toml index 49c4671..46a410d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,4 +13,6 @@ archery = "1.2.0" [dependencies.pyo3] version = "0.22.1" -features = ["extension-module"] +# To build extension for PyPy on Windows, "generate-import-lib" is needed: +# https://github.com/PyO3/maturin-action/issues/267#issuecomment-2106844429 +features = ["extension-module", "generate-import-lib"]