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

Test free-threaded build on all PRs #4631

Merged
merged 4 commits into from
Oct 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,6 @@ jobs:
- run: python3 -m nox -s test

test-free-threaded:
if: ${{ contains(github.event.pull_request.labels.*.name, 'CI-build-full') || github.event_name != 'pull_request' }}
needs: [fmt]
runs-on: ubuntu-latest
env:
Expand Down
10 changes: 8 additions & 2 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import shutil
import subprocess
import sys
import sysconfig
import tempfile
from functools import lru_cache
from glob import glob
Expand Down Expand Up @@ -32,6 +33,7 @@
PYO3_DOCS_TARGET = PYO3_TARGET / "doc"
PY_VERSIONS = ("3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13")
PYPY_VERSIONS = ("3.9", "3.10")
FREE_THREADED_BUILD = bool(sysconfig.get_config_var("Py_GIL_DISABLED"))


@nox.session(venv_backend="none")
Expand All @@ -48,10 +50,14 @@ def test_rust(session: nox.Session):
_run_cargo_test(session, package="pyo3-ffi")

_run_cargo_test(session)
_run_cargo_test(session, features="abi3")
# the free-threaded build ignores abi3, so we skip abi3
# tests to avoid unnecessarily running the tests twice
if not FREE_THREADED_BUILD:
_run_cargo_test(session, features="abi3")
if "skip-full" not in session.posargs:
_run_cargo_test(session, features="full")
_run_cargo_test(session, features="abi3 full")
if not FREE_THREADED_BUILD:
_run_cargo_test(session, features="abi3 full")


@nox.session(name="test-py", venv_backend="none")
Expand Down
Loading