Skip to content

Commit 8a61144

Browse files
committed
Drop Python 3.7 support
1 parent 00d31c1 commit 8a61144

File tree

10 files changed

+11
-55
lines changed

10 files changed

+11
-55
lines changed

.ci/.matrix_exclude.yml

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -5,35 +5,20 @@ exclude:
55
# Django 4.0 requires Python 3.8+
66
- VERSION: pypy-3 # current pypy-3 is compatible with Python 3.7
77
FRAMEWORK: django-4.0
8-
- VERSION: python-3.7
9-
FRAMEWORK: django-4.0
10-
# Django 4.2 requires Python 3.8+
11-
- VERSION: python-3.7
12-
FRAMEWORK: django-4.2
138
# Django 5.0 requires Python 3.10+
14-
- VERSION: python-3.7
15-
FRAMEWORK: django-5.0
169
- VERSION: python-3.8
1710
FRAMEWORK: django-5.0
1811
- VERSION: python-3.9
1912
FRAMEWORK: django-5.0
2013
- VERSION: pypy-3 # current pypy-3 is compatible with Python 3.7
2114
FRAMEWORK: celery-5-django-4
22-
- VERSION: python-3.7
23-
FRAMEWORK: celery-5-django-4
24-
- VERSION: python-3.7
25-
FRAMEWORK: celery-5-django-5
2615
- VERSION: python-3.8
2716
FRAMEWORK: celery-5-django-5
2817
- VERSION: python-3.9
2918
FRAMEWORK: celery-5-django-5
3019
# Flask
3120
- VERSION: pypy-3
3221
FRAMEWORK: flask-0.11 # see https://github.com/pallets/flask/commit/6e46d0cd, 0.11.2 was never released
33-
- VERSION: python-3.7
34-
FRAMEWORK: flask-2.3
35-
- VERSION: python-3.7
36-
FRAMEWORK: flask-3.0
3722
# Python 3.10 removed a bunch of classes from collections, now in collections.abc
3823
- VERSION: python-3.10
3924
FRAMEWORK: django-1.11
@@ -266,8 +251,6 @@ exclude:
266251
- VERSION: python-3.13
267252
FRAMEWORK: pylibmc-1.4
268253
# grpc
269-
- VERSION: python-3.7
270-
FRAMEWORK: grpc-1.24
271254
- VERSION: python-3.8
272255
FRAMEWORK: grpc-1.24
273256
- VERSION: python-3.9
@@ -280,12 +263,6 @@ exclude:
280263
FRAMEWORK: grpc-1.24
281264
- VERSION: python-3.13
282265
FRAMEWORK: grpc-1.24
283-
- VERSION: python-3.7
284-
FRAMEWORK: flask-1.0
285-
- VERSION: python-3.7
286-
FRAMEWORK: flask-1.1
287-
- VERSION: python-3.7
288-
FRAMEWORK: jinja2-2
289266
# TODO py3.12
290267
- VERSION: python-3.12
291268
FRAMEWORK: sanic-20.12 # no wheels available yet

.ci/.matrix_python.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
VERSION:
2-
- python-3.7
2+
- python-3.8
33
- python-3.13

.ci/.matrix_python_full.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
VERSION:
2-
- python-3.7
32
- python-3.8
43
- python-3.9
54
- python-3.10

.ci/publish-aws.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ for region in $ALL_AWS_REGIONS; do
4646
--layer-name="${FULL_LAYER_NAME}" \
4747
--description="AWS Lambda Extension Layer for the Elastic APM Python Agent" \
4848
--license-info="BSD-3-Clause" \
49-
--compatible-runtimes python3.7 python3.8 python3.9 python3.10 python3.11 python3.12 python3.13\
49+
--compatible-runtimes python3.8 python3.9 python3.10 python3.11 python3.12 python3.13\
5050
--zip-file="fileb://${zip_file}")
5151
echo "${publish_output}" > "${AWS_FOLDER}/${region}"
5252
layer_version=$(echo "${publish_output}" | jq '.Version')

.github/workflows/test.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,6 @@ jobs:
114114
fail-fast: false
115115
matrix:
116116
include:
117-
# - version: "3.7"
118-
# framework: none
119-
# asyncio: true
120117
- version: "3.8"
121118
framework: none
122119
asyncio: true

elasticapm/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
VERSION = "unknown"
6363

6464

65-
if sys.version_info < (3, 7):
66-
raise DeprecationWarning("The Elastic APM agent requires Python 3.7+")
65+
if sys.version_info < (3, 8):
66+
raise DeprecationWarning("The Elastic APM agent requires Python 3.8+")
6767

6868
from elasticapm.contrib.asyncio.traces import async_capture_span # noqa: F401 E402

elasticapm/base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -704,8 +704,8 @@ def should_ignore_topic(self, topic: str) -> bool:
704704

705705
def check_python_version(self) -> None:
706706
v = tuple(map(int, platform.python_version_tuple()[:2]))
707-
if v < (3, 7):
708-
warnings.warn("The Elastic APM agent only supports Python 3.7+", DeprecationWarning)
707+
if v < (3, 8):
708+
warnings.warn("The Elastic APM agent only supports Python 3.8+", DeprecationWarning)
709709

710710
def check_server_version(
711711
self, gte: Optional[Tuple[int, ...]] = None, lte: Optional[Tuple[int, ...]] = None

setup.cfg

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ classifiers =
1515
Operating System :: OS Independent
1616
Topic :: Software Development
1717
Programming Language :: Python
18-
Programming Language :: Python :: 3.7
1918
Programming Language :: Python :: 3.8
2019
Programming Language :: Python :: 3.9
2120
Programming Language :: Python :: 3.10
@@ -32,7 +31,7 @@ project_urls =
3231
Tracker = https://github.com/elastic/apm-agent-python/issues
3332

3433
[options]
35-
python_requires = >=3.7, <4
34+
python_requires = >=3.8, <4
3635
packages = find:
3736
include_package_data = true
3837
zip_safe = false

tests/context/test_context.py

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -39,21 +39,9 @@
3939
def test_execution_context_backing():
4040
execution_context = elasticapm.context.init_execution_context()
4141

42-
if sys.version_info[0] == 3 and sys.version_info[1] >= 7:
43-
from elasticapm.context.contextvars import ContextVarsContext
42+
from elasticapm.context.contextvars import ContextVarsContext
4443

45-
assert isinstance(execution_context, ContextVarsContext)
46-
else:
47-
try:
48-
import opentelemetry
49-
50-
pytest.skip(
51-
"opentelemetry installs contextvars backport, so this test isn't valid for the opentelemetry matrix"
52-
)
53-
except ImportError:
54-
pass
55-
56-
assert isinstance(execution_context, ThreadLocalContext)
44+
assert isinstance(execution_context, ContextVarsContext)
5745

5846

5947
def test_execution_context_monkeypatched(monkeypatch):

tests/requirements/reqs-base.txt

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
11
pytest==7.4.0
22
pytest-random-order==1.1.0
33
pytest-django==4.4.0
4-
coverage==6.3 ; python_version == '3.7'
5-
coverage[toml]==6.3 ; python_version == '3.7'
6-
coverage==7.3.1 ; python_version > '3.7'
7-
pytest-cov==4.0.0 ; python_version < '3.8'
8-
pytest-cov==4.1.0 ; python_version > '3.7'
9-
jinja2==3.1.5 ; python_version == '3.7'
4+
coverage==7.3.1
5+
pytest-cov==4.1.0
106
pytest-localserver==0.9.0
117
pytest-mock==3.10.0
128
pytest-benchmark==4.0.0

0 commit comments

Comments
 (0)