Start using final CPython 3.11 and dev 3.12 in CI
MODIFY
.github/workflows/ci.yml
.github/workflows/ci.yml
@@ -31,20 +31,18 @@ jobs:
python -m twine check dist/*
test:
- env:
- SETUPTOOLS_USE_DISTUTILS: stdlib
strategy:
fail-fast: false
matrix:
- python-version: ["3.7", "3.8", "3.9", "3.10"]
+ python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12-dev"]
os:
- macos-11
- windows-latest
- ubuntu-20.04 # OpenSSL 1.1.1
- ubuntu-22.04 # OpenSSL 3.0
- experimental: [false]
nox-session: ['']
include:
+ - experimental: false
- python-version: "pypy-3.7"
os: ubuntu-latest
experimental: false
@@ -66,14 +64,8 @@ jobs:
os: ubuntu-20.04 # CPython 3.9.2 is not available for ubuntu-22.04.
experimental: false
nox-session: test-3.9
- - python-version: 3.11
- os: ubuntu-20.04
- experimental: true
- nox-session: test-3.11
- - python-version: 3.11
- os: ubuntu-22.04
+ - python-version: "3.12-dev"
experimental: true
- nox-session: test-3.11
exclude:
# Ubuntu 22.04 comes with OpenSSL 3.0, so only CPython 3.9+ is compatible with it
# https://github.com/python/cpython/issues/83001
@@ -81,6 +73,9 @@ jobs:
os: ubuntu-22.04
- python-version: "3.8"
os: ubuntu-22.04
+ # Testing with non-final CPython on macOS is too slow for CI.
+ - python-version: "3.12-dev"
+ os: macos-11
runs-on: ${{ matrix.os }}
name: ${{ fromJson('{"macos-11":"macOS","windows-latest":"Windows","ubuntu-latest":"Ubuntu","ubuntu-20.04":"Ubuntu 20.04 (OpenSSL 1.1.1)","ubuntu-22.04":"Ubuntu 22.04 (OpenSSL 3.0)"}')[matrix.os] }} ${{ matrix.python-version }} ${{ matrix.nox-session}}
@@ -95,13 +90,6 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
- # Use deadsnakes for development versions
- - if: endsWith(matrix.python-version, '-dev')
- name: "Setup Python ${{ matrix.python-version }}"
- uses: deadsnakes/action@e3117c2981fd8afe4af79f3e1be80066c82b70f5
- with:
- python-version: ${{ matrix.python-version }}
-
# Setup Python 3.x to run nox on behalf of Python 2.7
- if: matrix.python-version == '2.7'
name: "Setup Python 3.x"

MODIFY
dev-requirements.txt
dev-requirements.txt
@@ -8,4 +8,4 @@ trustme==0.9.0
cryptography==39.0.0
backports.zoneinfo==0.2.1;python_version<"3.9"
towncrier==21.9.0
-pytest-memray==1.4.0;python_version>="3.8" and sys_platform!="win32" and implementation_name=="cpython"
+pytest-memray==1.4.0;python_version>="3.8" and python_version<"3.12" and sys_platform!="win32" and implementation_name=="cpython"

MODIFY
noxfile.py
noxfile.py
@@ -35,7 +35,11 @@ def tests_impl(
session.run("python", "-m", "OpenSSL.debug")
memray_supported = True
- if sys.implementation.name != "cpython" or sys.version_info < (3, 8):
+ if (
+ sys.implementation.name != "cpython"
+ or sys.version_info < (3, 8)
+ or sys.version_info.releaselevel != "final"
+ ):
memray_supported = False # pytest-memray requires CPython 3.8+
elif sys.platform == "win32":
memray_supported = False
@@ -64,7 +68,7 @@ def tests_impl(
)
-@nox.session(python=["3.7", "3.8", "3.9", "3.10", "3.11", "pypy"])
+@nox.session(python=["3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "pypy"])
def test(session: nox.Session) -> None:
tests_impl(session)

MODIFY
test/test_wait.py
test/test_wait.py
@@ -153,8 +153,11 @@ def test_eintr_zero_timeout(wfs: TYPE_WAIT_FOR, spair: TYPE_SOCKET_PAIR) -> None
signal.setitimer(signal.ITIMER_REAL, 0.001, 0.001)
# Hammer the system call for a while to trigger the
# race.
+ end = time.monotonic() + 5
for i in range(100000):
wfs(a, read=True, timeout=0)
+ if time.monotonic() >= end:
+ break
finally:
# Stop delivering SIGALRM
signal.setitimer(signal.ITIMER_REAL, 0)

Start using final CPython 3.11 and dev 3.12 in CI (#2760)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Quentin Pradet <quentin.pradet@gmail.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>