Skip to content

Commit 1c9256c

Browse files
Add 3.14 to CI builds (elastic#3103) (elastic#3113)
* Add 3.14 to CI builds * Support Python 3.14 __annotate_func__ * Temporarily remove pyarrow * Update pyproject.toml * cleanup annotationlib use --------- Co-authored-by: Quentin Pradet <[email protected]>
1 parent 44e9290 commit 1c9256c

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: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ steps:
1717
- "3.11"
1818
- "3.12"
1919
- "3.13"
20+
- "3.14"
2021
connection:
2122
- "urllib3"
2223
- "requests"
@@ -28,7 +29,7 @@ steps:
2829
connection: "urllib3"
2930
nox_session: "test_otel"
3031
- with:
31-
python: "3.13"
32+
python: "3.14"
3233
connection: "urllib3"
3334
nox_session: "test_otel"
3435
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.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
41+
python-version: ["3.8", "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: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,11 @@
3535
overload,
3636
)
3737

38+
try:
39+
import annotationlib
40+
except ImportError:
41+
annotationlib = None
42+
3843
try:
3944
from types import UnionType
4045
except ImportError:
@@ -333,7 +338,17 @@ def __init__(self, name: str, bases: Tuple[type, ...], attrs: Dict[str, Any]):
333338
# # ignore attributes
334339
# field10: ClassVar[string] = "a regular class variable"
335340
annotations = attrs.get("__annotations__", {})
336-
fields = set([n for n in attrs if isinstance(attrs[n], Field)])
341+
if not annotations and annotationlib:
342+
# Python 3.14+ uses annotationlib
343+
annotate = annotationlib.get_annotate_from_class_namespace(attrs)
344+
if annotate:
345+
annotations = (
346+
annotationlib.call_annotate_function(
347+
annotate, format=annotationlib.Format.VALUE
348+
)
349+
or {}
350+
)
351+
fields = {n for n in attrs if isinstance(attrs[n], Field)}
337352
fields.update(annotations.keys())
338353
field_defaults = {}
339354
for name in fields:

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.8", "3.9", "3.10", "3.11", "3.12", "3.13"])
47+
@nox.session(python=["3.8", "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.8", "3.13"])
54+
@nox.session(python=["3.8", "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
@@ -74,7 +74,7 @@ dev = [
7474
"orjson",
7575
"numpy",
7676
"simsimd",
77-
"pyarrow",
77+
"pyarrow; python_version<'3.14'",
7878
"pandas",
7979
"mapbox-vector-tile",
8080
"jinja2",

0 commit comments

Comments
 (0)