diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 610222e..2832413 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -47,7 +47,7 @@ jobs: fail-fast: false # If one platform fails, allow the rest to keep testing. matrix: rust: [stable] - python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "pypy-3.9"] + python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.13t", "pypy-3.9", "pypy-3.10"] platform: [ { @@ -65,11 +65,6 @@ jobs: python-architecture: "x64", rust-target: "x86_64-pc-windows-msvc", }, - { - os: "windows-latest", - python-architecture: "x86", - rust-target: "i686-pc-windows-msvc", - }, ] exclude: # PyPy doesn't release 32-bit Windows builds any more @@ -89,7 +84,7 @@ jobs: # Test the `nightly` feature - rust: nightly - python-version: "3.12" + python-version: "3.13" platform: { os: "ubuntu-latest", @@ -99,11 +94,16 @@ jobs: msrv: "nightly" extra_features: "nightly" + # Test 32-bit windows just on latest Python + - rust: stable + python-version: "3.13" + platform: { os: "windows-latest", python-architecture: "x86", rust-target: "i686-pc-windows-msvc" } + steps: - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 + uses: Quansight-Labs/setup-python@v5 with: python-version: ${{ matrix.python-version }} architecture: ${{ matrix.platform.python-architecture }} @@ -125,8 +125,8 @@ jobs: - name: Build run: cargo build --features=${{env.features}} --verbose --target ${{ matrix.platform.rust-target }} - # uvloop doesn't compile under Windows and PyPy - - if: ${{ matrix.platform.os != 'windows-latest' && !startsWith(matrix.python-version, 'pypy') }} + # uvloop doesn't compile under Windows and PyPy, nor for free-threaded Python + - if: ${{ matrix.platform.os != 'windows-latest' && !startsWith(matrix.python-version, 'pypy') && !endsWith(matrix.python-version, 't') }} name: Install pyo3-asyncio test dependencies run: | python -m pip install -U uvloop diff --git a/pytests/test_async_std_uvloop.rs b/pytests/test_async_std_uvloop.rs index 972cebd..10477fc 100644 --- a/pytests/test_async_std_uvloop.rs +++ b/pytests/test_async_std_uvloop.rs @@ -4,6 +4,14 @@ fn main() -> pyo3::PyResult<()> { pyo3::prepare_freethreaded_python(); Python::with_gil(|py| { + // uvloop not supported on the free-threaded build yet + // https://github.com/MagicStack/uvloop/issues/642 + let sysconfig = py.import("sysconfig")?; + let is_freethreaded = sysconfig.call_method1("get_config_var", ("Py_GIL_DISABLED",))?; + if is_freethreaded.is_truthy()? { + return Ok(()); + } + let uvloop = py.import("uvloop")?; uvloop.call_method0("install")?; diff --git a/pytests/test_tokio_current_thread_uvloop.rs b/pytests/test_tokio_current_thread_uvloop.rs index 2d1b47d..9ea8a4b 100644 --- a/pytests/test_tokio_current_thread_uvloop.rs +++ b/pytests/test_tokio_current_thread_uvloop.rs @@ -13,6 +13,14 @@ fn main() -> pyo3::PyResult<()> { }); Python::with_gil(|py| { + // uvloop not supported on the free-threaded build yet + // https://github.com/MagicStack/uvloop/issues/642 + let sysconfig = py.import("sysconfig")?; + let is_freethreaded = sysconfig.call_method1("get_config_var", ("Py_GIL_DISABLED",))?; + if is_freethreaded.is_truthy()? { + return Ok(()); + } + let uvloop = py.import("uvloop")?; uvloop.call_method0("install")?; diff --git a/pytests/test_tokio_multi_thread_uvloop.rs b/pytests/test_tokio_multi_thread_uvloop.rs index f664919..9921c09 100644 --- a/pytests/test_tokio_multi_thread_uvloop.rs +++ b/pytests/test_tokio_multi_thread_uvloop.rs @@ -5,6 +5,14 @@ fn main() -> pyo3::PyResult<()> { pyo3::prepare_freethreaded_python(); Python::with_gil(|py| { + // uvloop not supported on the free-threaded build yet + // https://github.com/MagicStack/uvloop/issues/642 + let sysconfig = py.import("sysconfig")?; + let is_freethreaded = sysconfig.call_method1("get_config_var", ("Py_GIL_DISABLED",))?; + if is_freethreaded.is_truthy()? { + return Ok(()); + } + let uvloop = py.import("uvloop")?; uvloop.call_method0("install")?;