Skip to content

Commit 5e510d8

Browse files
miguelgrinbergpquentin
authored andcommitted
Add 3.14 to CI builds (#3103)
* Add 3.14 to CI builds * Support Python 3.14 __annotate_func__ * Temporarily remove pyarrow * Update pyproject.toml Co-authored-by: Quentin Pradet <quentin.pradet@gmail.com> * cleanup annotationlib use --------- Co-authored-by: Quentin Pradet <quentin.pradet@gmail.com> (cherry picked from commit 1f43ab9)
1 parent 33bcc7b commit 5e510d8

File tree

7 files changed

+24
-8
lines changed

7 files changed

+24
-8
lines changed

.buildkite/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
ARG PYTHON_VERSION=3.13
1+
ARG PYTHON_VERSION=3.14
22
FROM python:${PYTHON_VERSION}
33

44
# Default UID/GID to 1000

.buildkite/pipeline.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,19 @@ steps:
1616
- "3.11"
1717
- "3.12"
1818
- "3.13"
19+
- "3.14"
1920
connection:
2021
- "urllib3"
2122
- "requests"
2223
nox_session:
2324
- "test"
2425
adjustments:
2526
- with:
26-
python: "3.9"
27+
python: "3.10"
2728
connection: "urllib3"
2829
nox_session: "test_otel"
2930
- with:
30-
python: "3.13"
31+
python: "3.14"
3132
connection: "urllib3"
3233
nox_session: "test_otel"
3334
command: ./.buildkite/run-tests

.buildkite/run-tests

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# Default environment variables
88
export STACK_VERSION="${STACK_VERSION:=8.0.0-SNAPSHOT}"
99
export TEST_SUITE="${TEST_SUITE:=platinum}"
10-
export PYTHON_VERSION="${PYTHON_VERSION:=3.13}"
10+
export PYTHON_VERSION="${PYTHON_VERSION:=3.14}"
1111
export PYTHON_CONNECTION_CLASS="${PYTHON_CONNECTION_CLASS:=urllib3}"
1212

1313
script_path=$(dirname $(realpath $0))

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
strategy:
3939
fail-fast: false
4040
matrix:
41-
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
41+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
4242
nox-session: [""]
4343
runs-on: ["ubuntu-latest"]
4444

elasticsearch/dsl/document_base.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@
3434
overload,
3535
)
3636

37+
try:
38+
import annotationlib
39+
except ImportError:
40+
annotationlib = None
41+
3742
try:
3843
from types import UnionType
3944
except ImportError:
@@ -332,6 +337,16 @@ def __init__(self, name: str, bases: Tuple[type, ...], attrs: Dict[str, Any]):
332337
# # ignore attributes
333338
# field10: ClassVar[string] = "a regular class variable"
334339
annotations = attrs.get("__annotations__", {})
340+
if not annotations and annotationlib:
341+
# Python 3.14+ uses annotationlib
342+
annotate = annotationlib.get_annotate_from_class_namespace(attrs)
343+
if annotate:
344+
annotations = (
345+
annotationlib.call_annotate_function(
346+
annotate, format=annotationlib.Format.VALUE
347+
)
348+
or {}
349+
)
335350
fields = {n for n in attrs if isinstance(attrs[n], Field)}
336351
fields.update(annotations.keys())
337352
field_defaults = {}

noxfile.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,14 @@ def pytest_argv():
4444
]
4545

4646

47-
@nox.session(python=["3.9", "3.10", "3.11", "3.12", "3.13"])
47+
@nox.session(python=["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"])
4848
def test(session):
4949
session.install("-e", ".[dev]", env=INSTALL_ENV, silent=False)
5050

5151
session.run(*pytest_argv(), *session.posargs)
5252

5353

54-
@nox.session(python=["3.9", "3.13"])
54+
@nox.session(python=["3.10", "3.14"])
5555
def test_otel(session):
5656
session.install(
5757
".[dev]",

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ dev = [
7373
"orjson",
7474
"numpy",
7575
"simsimd",
76-
"pyarrow",
76+
"pyarrow; python_version<'3.14'",
7777
"pandas",
7878
"mapbox-vector-tile",
7979
"jinja2",

0 commit comments

Comments
 (0)