Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .buildkite/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG PYTHON_VERSION=3.13
ARG PYTHON_VERSION=3.14
FROM python:${PYTHON_VERSION}

# Default UID/GID to 1000
Expand Down
5 changes: 3 additions & 2 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,19 @@ steps:
- "3.11"
- "3.12"
- "3.13"
- "3.14"
connection:
- "urllib3"
- "requests"
nox_session:
- "test"
adjustments:
- with:
python: "3.9"
python: "3.10"
connection: "urllib3"
nox_session: "test_otel"
- with:
python: "3.13"
python: "3.14"
connection: "urllib3"
nox_session: "test_otel"
command: ./.buildkite/run-tests
2 changes: 1 addition & 1 deletion .buildkite/run-tests
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# Default environment variables
export STACK_VERSION="${STACK_VERSION:=8.0.0-SNAPSHOT}"
export TEST_SUITE="${TEST_SUITE:=platinum}"
export PYTHON_VERSION="${PYTHON_VERSION:=3.13}"
export PYTHON_VERSION="${PYTHON_VERSION:=3.14}"
export PYTHON_CONNECTION_CLASS="${PYTHON_CONNECTION_CLASS:=urllib3}"

script_path=$(dirname $(realpath $0))
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
nox-session: [""]
runs-on: ["ubuntu-latest"]

Expand Down
15 changes: 15 additions & 0 deletions elasticsearch/dsl/document_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@
overload,
)

try:
import annotationlib
except ImportError:
annotationlib = None

try:
from types import UnionType
except ImportError:
Expand Down Expand Up @@ -332,6 +337,16 @@ def __init__(self, name: str, bases: Tuple[type, ...], attrs: Dict[str, Any]):
# # ignore attributes
# field10: ClassVar[string] = "a regular class variable"
annotations = attrs.get("__annotations__", {})
if not annotations and annotationlib:
# Python 3.14+ uses annotationlib
annotate = annotationlib.get_annotate_from_class_namespace(attrs)
if annotate:
annotations = (
annotationlib.call_annotate_function(
annotate, format=annotationlib.Format.VALUE
)
or {}
)
fields = {n for n in attrs if isinstance(attrs[n], Field)}
fields.update(annotations.keys())
field_defaults = {}
Expand Down
4 changes: 2 additions & 2 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,14 @@ def pytest_argv():
]


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

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


@nox.session(python=["3.9", "3.13"])
@nox.session(python=["3.10", "3.14"])
def test_otel(session):
session.install(
".[dev]",
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ dev = [
"orjson",
"numpy",
"simsimd",
"pyarrow",
"pyarrow; python_version<'3.14'",
"pandas",
"mapbox-vector-tile",
"jinja2",
Expand Down