Skip to content

Commit 2a4030c

Browse files
authored
[8.11] Add Python 3.12 support (#2370)
1 parent 5e8d007 commit 2a4030c

File tree

5 files changed

+18
-19
lines changed

5 files changed

+18
-19
lines changed

.buildkite/pipeline.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ steps:
1515
- "3.9"
1616
- "3.10"
1717
- "3.11"
18+
- "3.12"
1819
connection:
1920
- "urllib3"
2021
- "requests"

.github/workflows/ci.yml

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,15 @@ jobs:
1414
with:
1515
python-version: "3.11"
1616
- name: Install dependencies
17-
run: |
18-
python3 -m pip install nox
17+
run: python3 -m pip install nox
1918
- name: Lint the code
2019
run: nox -s lint
2120

2221
test-linux:
2322
strategy:
2423
fail-fast: false
2524
matrix:
26-
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
25+
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
2726
nox-session: [""]
2827
runs-on: ["ubuntu-latest"]
2928

@@ -38,18 +37,10 @@ jobs:
3837
with:
3938
python-version: ${{ matrix.python-version }}
4039
- name: Install Dependencies
41-
run: |
42-
python -m pip install nox
40+
run: python -m pip install nox
4341
- name: Run Tests
4442
shell: bash
4543
run: .ci/run-nox.sh
4644
env:
4745
PYTHON_VERSION: ${{ matrix.python-version }}
48-
NOX_SESSION: ${{ matrix.nox-session }}
49-
# TEMPORARY for 3.11
50-
# https://github.com/aio-libs/aiohttp/issues/6600
51-
AIOHTTP_NO_EXTENSIONS: 1
52-
# https://github.com/aio-libs/frozenlist/issues/285
53-
FROZENLIST_NO_EXTENSIONS: 1
54-
# https://github.com/aio-libs/yarl/issues/680
55-
YARL_NO_EXTENSIONS: 1
46+
NOX_SESSION: ${{ matrix.nox-session }}

.readthedocs.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@ version: 2
33
build:
44
os: ubuntu-22.04
55
tools:
6-
python: "3.11"
6+
# To work around https://github.com/aio-libs/aiohttp/issues/7675, we need
7+
# to set AIOHTTP_NO_EXTENSIONS to 1 but it has to be done in
8+
# https://readthedocs.org/dashboard/elasticsearch-py/environmentvariables/
9+
# because of https://github.com/readthedocs/readthedocs.org/issues/6311
10+
python: "3.12"
711

812
python:
913
install:

noxfile.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,14 @@
2828
"test_elasticsearch/",
2929
"utils/",
3030
)
31+
# Allow building aiohttp when no wheels are available (eg. for recent Python versions)
32+
INSTALL_ENV = {"AIOHTTP_NO_EXTENSIONS": "1"}
3133

3234

33-
@nox.session(python=["3.6", "3.7", "3.8", "3.9", "3.10", "3.11"])
35+
@nox.session(python=["3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12"])
3436
def test(session):
35-
session.install(".")
36-
session.install("-r", "dev-requirements.txt")
37+
session.install(".[async,requests]", env=INSTALL_ENV, silent=False)
38+
session.install("-r", "dev-requirements.txt", silent=False)
3739

3840
python_version = tuple(int(x) for x in session.python.split("."))
3941
junit_xml = os.path.join(SOURCE_DIR, "junit", "elasticsearch-py-junit.xml")
@@ -77,7 +79,7 @@ def lint(session):
7779
session.run("python", "utils/license-headers.py", "check", *SOURCE_FILES)
7880

7981
# Workaround to make '-r' to still work despite uninstalling aiohttp below.
80-
session.install(".[async,requests]")
82+
session.install(".[async,requests]", env=INSTALL_ENV)
8183

8284
# Run mypy on the package and then the type examples separately for
8385
# the two different mypy use-cases, ourselves and our users.

setup.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,11 @@
8686
"Programming Language :: Python :: 3.9",
8787
"Programming Language :: Python :: 3.10",
8888
"Programming Language :: Python :: 3.11",
89+
"Programming Language :: Python :: 3.12",
8990
"Programming Language :: Python :: Implementation :: CPython",
9091
"Programming Language :: Python :: Implementation :: PyPy",
9192
],
92-
python_requires=">=3.6, <4",
93+
python_requires=">=3.6",
9394
install_requires=install_requires,
9495
extras_require={
9596
"requests": ["requests>=2.4.0, <3.0.0"],

0 commit comments

Comments
 (0)