Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add support for 3.13 with no GIL #505

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
47 changes: 29 additions & 18 deletions .github/workflows/mrml-python-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@ on:
branches:
- main
paths:
- '.github/workflows/mrml-python-main.yml'
- 'Cargo.lock'
- 'Cargo.toml'
- 'packages/mrml-core/**'
- 'packages/mrml-python/**'
- ".github/workflows/mrml-python-main.yml"
- "Cargo.lock"
- "Cargo.toml"
- "packages/mrml-core/**"
- "packages/mrml-python/**"
pull_request:
paths:
- '.github/workflows/mrml-python-main.yml'
- 'Cargo.lock'
- 'Cargo.toml'
- 'packages/mrml-core/**'
- 'packages/mrml-python/**'
- ".github/workflows/mrml-python-main.yml"
- "Cargo.lock"
- "Cargo.toml"
- "packages/mrml-core/**"
- "packages/mrml-python/**"
workflow_dispatch:

permissions:
Expand All @@ -26,32 +26,43 @@ jobs:
testing:
runs-on: ubuntu-latest

strategy:
matrix:
python-version: ["3.10", "3.13"]

concurrency:
group: ${{ github.ref }}-mrml-python
group: ${{ github.ref }}-mrml-python-${{ matrix.python-version }}
cancel-in-progress: true

steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
- name: setup python
if: matrix.python-version != '3.13'
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

# Use deadsnakes until https://github.com/actions/setup-python/issues/771 is closed
- name: setup python
if: matrix.python-version == '3.13'
uses: deadsnakes/[email protected]
with:
python-version: '3.10'
python-version: ${{ matrix.python-version }}
nogil: true

- name: install cargo toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal

- name: install maturin
run: cargo install maturin --locked

- name: init python venv
run: |
python3 -m pip install --upgrade pip
pip install --upgrade pip
python3 -m venv env
source env/bin/activate
python3 -m pip install pytest
python3 -m pip install pytest maturin
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Installing Maturin via pip seems much faster since it's already compiled.

maturin develop
python3 -m pytest
working-directory: packages/mrml-python
21 changes: 15 additions & 6 deletions .github/workflows/mrml-python-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,12 @@ jobs:
manylinux: "auto"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
# Use deadsnakes until https://github.com/actions/setup-python/issues/771 is closed
- name: setup python
uses: deadsnakes/[email protected]
with:
python-version: "3.10"
python-version: "3.13"
nogil: true"
- name: build wheels
uses: PyO3/maturin-action@v1
with:
Expand All @@ -61,9 +64,12 @@ jobs:
target: [x64, x86]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
# Use deadsnakes until https://github.com/actions/setup-python/issues/771 is closed
- name: setup python
uses: deadsnakes/[email protected]
with:
python-version: "3.10"
python-version: "3.13"
nogil: true"
architecture: ${{ matrix.target }}
- name: build wheels
uses: PyO3/maturin-action@v1
Expand All @@ -85,9 +91,12 @@ jobs:
target: [x86_64, aarch64]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
# Use deadsnakes until https://github.com/actions/setup-python/issues/771 is closed
- name: setup python
uses: deadsnakes/[email protected]
with:
python-version: "3.10"
python-version: "3.13"
nogil: true"
- name: build wheels
uses: PyO3/maturin-action@v1
with:
Expand Down
Loading
Loading