Skip to content

Commit 0ec8d2f

Browse files
[Backport 8.15] Drop Python 3.7 support (#2618)
Signed-off-by: Tomasz Kłoczko <[email protected]> Co-authored-by: Quentin Pradet <[email protected]> (cherry picked from commit dec4858) Co-authored-by: Tomasz Kłoczko <[email protected]>
1 parent 3a40e00 commit 0ec8d2f

25 files changed

+35
-60
lines changed

.buildkite/pipeline.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ steps:
1111
matrix:
1212
setup:
1313
python:
14-
- "3.7"
1514
- "3.8"
1615
- "3.9"
1716
- "3.10"
@@ -24,7 +23,7 @@ steps:
2423
- "test"
2524
adjustments:
2625
- with:
27-
python: "3.7"
26+
python: "3.8"
2827
connection: "urllib3"
2928
nox_session: "test_otel"
3029
- with:

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
strategy:
2424
fail-fast: false
2525
matrix:
26-
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
26+
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
2727
nox-session: [""]
2828
runs-on: ["ubuntu-latest"]
2929

docs/guide/getting-started.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ operations with it.
88
[discrete]
99
=== Requirements
1010

11-
* https://www.python.org/[Python] 3.7 or newer
11+
* https://www.python.org/[Python] 3.8 or newer
1212
* https://pip.pypa.io/en/stable/[`pip`], installed by default alongside Python
1313

1414
[discrete]

docs/sphinx/conf.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# -*- coding: utf-8 -*-
21
# Licensed to Elasticsearch B.V. under one or more contributor
32
# license agreements. See the NOTICE file distributed with
43
# this work for additional information regarding copyright

docs/sphinx/quickstart.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ operations like indexing or searching documents.
99
Requirements
1010
------------
1111

12-
- `Python <https://www.python.org/>`_ 3.7 or newer
12+
- `Python <https://www.python.org/>`_ 3.8 or newer
1313
- `pip <https://pip.pypa.io/en/stable/>`_
1414

1515

elasticsearch/_otel.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,7 @@
1919

2020
import contextlib
2121
import os
22-
from typing import TYPE_CHECKING, Generator, Mapping
23-
24-
if TYPE_CHECKING:
25-
from typing import Literal
22+
from typing import Generator, Literal, Mapping
2623

2724
try:
2825
from opentelemetry import trace
@@ -48,8 +45,7 @@ def __init__(
4845
self,
4946
enabled: bool | None = None,
5047
tracer: trace.Tracer | None = None,
51-
# TODO import Literal at the top-level when dropping Python 3.7
52-
body_strategy: 'Literal["omit", "raw"]' | None = None,
48+
body_strategy: Literal["omit", "raw"] | None = None,
5349
):
5450
if enabled is None:
5551
enabled = os.environ.get(ENABLED_ENV_VAR, "true") == "true"

examples/bulk-ingest/bulk-ingest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ def generate_actions():
6666
yields a single document. This function is passed into the bulk()
6767
helper to create many documents in sequence.
6868
"""
69-
with open(DATASET_PATH, mode="r") as f:
69+
with open(DATASET_PATH) as f:
7070
reader = csv.DictReader(f)
7171

7272
for row in reader:

noxfile.py

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

4747

48-
@nox.session(python=["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"])
48+
@nox.session(python=["3.8", "3.9", "3.10", "3.11", "3.12"])
4949
def test(session):
5050
session.install(".[dev]", env=INSTALL_ENV, silent=False)
5151

5252
session.run(*pytest_argv())
5353

5454

55-
@nox.session(python=["3.7", "3.12"])
55+
@nox.session(python=["3.8", "3.12"])
5656
def test_otel(session):
5757
session.install(
5858
".[dev]",

pyproject.toml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ name = "elasticsearch"
77
description = "Python client for Elasticsearch"
88
readme = "README.md"
99
license = "Apache-2.0"
10-
requires-python = ">=3.7"
10+
requires-python = ">=3.8"
1111
authors = [
1212
{ name = "Elastic Client Library Maintainers", email = "[email protected]" },
1313
]
@@ -21,7 +21,6 @@ classifiers = [
2121
"Operating System :: OS Independent",
2222
"Programming Language :: Python",
2323
"Programming Language :: Python :: 3",
24-
"Programming Language :: Python :: 3.7",
2524
"Programming Language :: Python :: 3.8",
2625
"Programming Language :: Python :: 3.9",
2726
"Programming Language :: Python :: 3.10",
@@ -72,8 +71,6 @@ dev = [
7271
"simsimd",
7372
"pandas",
7473
"mapbox-vector-tile",
75-
# Python 3.7 gets an old version of mapbox-vector-tile, requiring an old version of protobuf
76-
"protobuf<4; python_version<=\"3.7\"",
7774
]
7875
docs = [
7976
"sphinx",

test_elasticsearch/test_async/test_server/test_clients.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# -*- coding: utf-8 -*-
21
# Licensed to Elasticsearch B.V. under one or more contributor
32
# license agreements. See the NOTICE file distributed with
43
# this work for additional information regarding copyright
@@ -16,7 +15,6 @@
1615
# specific language governing permissions and limitations
1716
# under the License.
1817

19-
from __future__ import unicode_literals
2018

2119
import pytest
2220

0 commit comments

Comments
 (0)