Skip to content

Commit c5b915d

Browse files
authored
Use Python 3.12 in CI where possible (#2488)
Run workflow steps (lint, build, etc.) on Python 3.12 and test integrations on Python 3.12 if the library/framework supports it.
1 parent 52eb367 commit c5b915d

35 files changed

+77
-69
lines changed

.github/workflows/ci.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
- uses: actions/checkout@v4
2727
- uses: actions/setup-python@v4
2828
with:
29-
python-version: 3.11
29+
python-version: 3.12
3030

3131
- run: |
3232
pip install tox
@@ -41,7 +41,7 @@ jobs:
4141
- uses: actions/checkout@v4
4242
- uses: actions/setup-python@v4
4343
with:
44-
python-version: 3.9
44+
python-version: 3.12
4545

4646
- run: |
4747
python scripts/split-tox-gh-actions/split-tox-gh-actions.py --fail-on-changes
@@ -55,7 +55,7 @@ jobs:
5555
- uses: actions/checkout@v4
5656
- uses: actions/setup-python@v4
5757
with:
58-
python-version: 3.9
58+
python-version: 3.12
5959
- name: Setup build cache
6060
uses: actions/cache@v3
6161
id: build_cache
@@ -84,7 +84,7 @@ jobs:
8484
- uses: actions/checkout@v4
8585
- uses: actions/setup-python@v4
8686
with:
87-
python-version: 3.11
87+
python-version: 3.12
8888

8989
- run: |
9090
pip install virtualenv

.github/workflows/test-integration-ariadne.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
strategy:
3232
fail-fast: false
3333
matrix:
34-
python-version: ["3.8","3.9","3.10","3.11"]
34+
python-version: ["3.8","3.9","3.10","3.11","3.12"]
3535
# python3.6 reached EOL and is no longer being supported on
3636
# new versions of hosted runners on Github Actions
3737
# ubuntu-20.04 is the last version that supported python3.6

.github/workflows/test-integration-arq.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
strategy:
3232
fail-fast: false
3333
matrix:
34-
python-version: ["3.7","3.8","3.9","3.10","3.11"]
34+
python-version: ["3.7","3.8","3.9","3.10","3.11","3.12"]
3535
# python3.6 reached EOL and is no longer being supported on
3636
# new versions of hosted runners on Github Actions
3737
# ubuntu-20.04 is the last version that supported python3.6

.github/workflows/test-integration-asgi.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
strategy:
3232
fail-fast: false
3333
matrix:
34-
python-version: ["3.7","3.8","3.9","3.10","3.11"]
34+
python-version: ["3.7","3.8","3.9","3.10","3.11","3.12"]
3535
# python3.6 reached EOL and is no longer being supported on
3636
# new versions of hosted runners on Github Actions
3737
# ubuntu-20.04 is the last version that supported python3.6

.github/workflows/test-integration-asyncpg.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
strategy:
3232
fail-fast: false
3333
matrix:
34-
python-version: ["3.7","3.8","3.9","3.10","3.11"]
34+
python-version: ["3.7","3.8","3.9","3.10","3.11","3.12"]
3535
# python3.6 reached EOL and is no longer being supported on
3636
# new versions of hosted runners on Github Actions
3737
# ubuntu-20.04 is the last version that supported python3.6

.github/workflows/test-integration-bottle.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
strategy:
3232
fail-fast: false
3333
matrix:
34-
python-version: ["3.5","3.6","3.7","3.8","3.9","3.10","3.11"]
34+
python-version: ["3.5","3.6","3.7","3.8","3.9","3.10","3.11","3.12"]
3535
# python3.6 reached EOL and is no longer being supported on
3636
# new versions of hosted runners on Github Actions
3737
# ubuntu-20.04 is the last version that supported python3.6

.github/workflows/test-integration-clickhouse_driver.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
strategy:
3232
fail-fast: false
3333
matrix:
34-
python-version: ["3.8","3.9","3.10","3.11"]
34+
python-version: ["3.8","3.9","3.10","3.11","3.12"]
3535
# python3.6 reached EOL and is no longer being supported on
3636
# new versions of hosted runners on Github Actions
3737
# ubuntu-20.04 is the last version that supported python3.6

.github/workflows/test-integration-cloud_resource_context.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
strategy:
3232
fail-fast: false
3333
matrix:
34-
python-version: ["3.6","3.7","3.8","3.9","3.10","3.11"]
34+
python-version: ["3.6","3.7","3.8","3.9","3.10","3.11","3.12"]
3535
# python3.6 reached EOL and is no longer being supported on
3636
# new versions of hosted runners on Github Actions
3737
# ubuntu-20.04 is the last version that supported python3.6

.github/workflows/test-integration-django.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
strategy:
3232
fail-fast: false
3333
matrix:
34-
python-version: ["3.5","3.6","3.7","3.8","3.9","3.10","3.11"]
34+
python-version: ["3.5","3.6","3.7","3.8","3.9","3.10","3.11","3.12"]
3535
# python3.6 reached EOL and is no longer being supported on
3636
# new versions of hosted runners on Github Actions
3737
# ubuntu-20.04 is the last version that supported python3.6

.github/workflows/test-integration-falcon.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
strategy:
3232
fail-fast: false
3333
matrix:
34-
python-version: ["3.5","3.6","3.7","3.8","3.9","3.10","3.11"]
34+
python-version: ["3.5","3.6","3.7","3.8","3.9","3.10","3.11","3.12"]
3535
# python3.6 reached EOL and is no longer being supported on
3636
# new versions of hosted runners on Github Actions
3737
# ubuntu-20.04 is the last version that supported python3.6

.github/workflows/test-integration-fastapi.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
strategy:
3232
fail-fast: false
3333
matrix:
34-
python-version: ["3.7","3.8","3.9","3.10","3.11"]
34+
python-version: ["3.7","3.8","3.9","3.10","3.11","3.12"]
3535
# python3.6 reached EOL and is no longer being supported on
3636
# new versions of hosted runners on Github Actions
3737
# ubuntu-20.04 is the last version that supported python3.6

.github/workflows/test-integration-flask.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
strategy:
3232
fail-fast: false
3333
matrix:
34-
python-version: ["3.5","3.6","3.7","3.8","3.9","3.10","3.11"]
34+
python-version: ["3.5","3.6","3.7","3.8","3.9","3.10","3.11","3.12"]
3535
# python3.6 reached EOL and is no longer being supported on
3636
# new versions of hosted runners on Github Actions
3737
# ubuntu-20.04 is the last version that supported python3.6

.github/workflows/test-integration-graphene.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
strategy:
3232
fail-fast: false
3333
matrix:
34-
python-version: ["3.7","3.8","3.9","3.10","3.11"]
34+
python-version: ["3.7","3.8","3.9","3.10","3.11","3.12"]
3535
# python3.6 reached EOL and is no longer being supported on
3636
# new versions of hosted runners on Github Actions
3737
# ubuntu-20.04 is the last version that supported python3.6

.github/workflows/test-integration-grpc.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
strategy:
3232
fail-fast: false
3333
matrix:
34-
python-version: ["3.7","3.8","3.9","3.10","3.11"]
34+
python-version: ["3.7","3.8","3.9","3.10","3.11","3.12"]
3535
# python3.6 reached EOL and is no longer being supported on
3636
# new versions of hosted runners on Github Actions
3737
# ubuntu-20.04 is the last version that supported python3.6

.github/workflows/test-integration-httpx.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
strategy:
3232
fail-fast: false
3333
matrix:
34-
python-version: ["3.6","3.7","3.8","3.9","3.10","3.11"]
34+
python-version: ["3.6","3.7","3.8","3.9","3.10","3.11","3.12"]
3535
# python3.6 reached EOL and is no longer being supported on
3636
# new versions of hosted runners on Github Actions
3737
# ubuntu-20.04 is the last version that supported python3.6

.github/workflows/test-integration-huey.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
strategy:
3232
fail-fast: false
3333
matrix:
34-
python-version: ["3.5","3.6","3.7","3.8","3.9","3.10","3.11"]
34+
python-version: ["3.5","3.6","3.7","3.8","3.9","3.10","3.11","3.12"]
3535
# python3.6 reached EOL and is no longer being supported on
3636
# new versions of hosted runners on Github Actions
3737
# ubuntu-20.04 is the last version that supported python3.6

.github/workflows/test-integration-loguru.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
strategy:
3232
fail-fast: false
3333
matrix:
34-
python-version: ["3.5","3.6","3.7","3.8","3.9","3.10","3.11"]
34+
python-version: ["3.5","3.6","3.7","3.8","3.9","3.10","3.11","3.12"]
3535
# python3.6 reached EOL and is no longer being supported on
3636
# new versions of hosted runners on Github Actions
3737
# ubuntu-20.04 is the last version that supported python3.6

.github/workflows/test-integration-opentelemetry.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
strategy:
3232
fail-fast: false
3333
matrix:
34-
python-version: ["3.7","3.8","3.9","3.10","3.11"]
34+
python-version: ["3.7","3.8","3.9","3.10","3.11","3.12"]
3535
# python3.6 reached EOL and is no longer being supported on
3636
# new versions of hosted runners on Github Actions
3737
# ubuntu-20.04 is the last version that supported python3.6

.github/workflows/test-integration-pure_eval.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
strategy:
3232
fail-fast: false
3333
matrix:
34-
python-version: ["3.5","3.6","3.7","3.8","3.9","3.10","3.11"]
34+
python-version: ["3.5","3.6","3.7","3.8","3.9","3.10","3.11","3.12"]
3535
# python3.6 reached EOL and is no longer being supported on
3636
# new versions of hosted runners on Github Actions
3737
# ubuntu-20.04 is the last version that supported python3.6

.github/workflows/test-integration-pymongo.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
strategy:
3232
fail-fast: false
3333
matrix:
34-
python-version: ["3.6","3.7","3.8","3.9","3.10","3.11"]
34+
python-version: ["3.6","3.7","3.8","3.9","3.10","3.11","3.12"]
3535
# python3.6 reached EOL and is no longer being supported on
3636
# new versions of hosted runners on Github Actions
3737
# ubuntu-20.04 is the last version that supported python3.6

.github/workflows/test-integration-pyramid.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
strategy:
3232
fail-fast: false
3333
matrix:
34-
python-version: ["3.5","3.6","3.7","3.8","3.9","3.10","3.11"]
34+
python-version: ["3.5","3.6","3.7","3.8","3.9","3.10","3.11","3.12"]
3535
# python3.6 reached EOL and is no longer being supported on
3636
# new versions of hosted runners on Github Actions
3737
# ubuntu-20.04 is the last version that supported python3.6

.github/workflows/test-integration-quart.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
strategy:
3232
fail-fast: false
3333
matrix:
34-
python-version: ["3.7","3.8","3.9","3.10","3.11"]
34+
python-version: ["3.7","3.8","3.9","3.10","3.11","3.12"]
3535
# python3.6 reached EOL and is no longer being supported on
3636
# new versions of hosted runners on Github Actions
3737
# ubuntu-20.04 is the last version that supported python3.6

.github/workflows/test-integration-redis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
strategy:
3232
fail-fast: false
3333
matrix:
34-
python-version: ["3.7","3.8","3.9","3.10","3.11"]
34+
python-version: ["3.7","3.8","3.9","3.10","3.11","3.12"]
3535
# python3.6 reached EOL and is no longer being supported on
3636
# new versions of hosted runners on Github Actions
3737
# ubuntu-20.04 is the last version that supported python3.6

.github/workflows/test-integration-requests.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
strategy:
3232
fail-fast: false
3333
matrix:
34-
python-version: ["3.8","3.9","3.10","3.11"]
34+
python-version: ["3.8","3.9","3.10","3.11","3.12"]
3535
# python3.6 reached EOL and is no longer being supported on
3636
# new versions of hosted runners on Github Actions
3737
# ubuntu-20.04 is the last version that supported python3.6

.github/workflows/test-integration-rq.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
strategy:
3232
fail-fast: false
3333
matrix:
34-
python-version: ["3.5","3.6","3.7","3.8","3.9","3.10","3.11"]
34+
python-version: ["3.5","3.6","3.7","3.8","3.9","3.10","3.11","3.12"]
3535
# python3.6 reached EOL and is no longer being supported on
3636
# new versions of hosted runners on Github Actions
3737
# ubuntu-20.04 is the last version that supported python3.6

.github/workflows/test-integration-sqlalchemy.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
strategy:
3232
fail-fast: false
3333
matrix:
34-
python-version: ["3.7","3.8","3.9","3.10","3.11"]
34+
python-version: ["3.7","3.8","3.9","3.10","3.11","3.12"]
3535
# python3.6 reached EOL and is no longer being supported on
3636
# new versions of hosted runners on Github Actions
3737
# ubuntu-20.04 is the last version that supported python3.6

.github/workflows/test-integration-starlette.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
strategy:
3232
fail-fast: false
3333
matrix:
34-
python-version: ["3.7","3.8","3.9","3.10","3.11"]
34+
python-version: ["3.7","3.8","3.9","3.10","3.11","3.12"]
3535
# python3.6 reached EOL and is no longer being supported on
3636
# new versions of hosted runners on Github Actions
3737
# ubuntu-20.04 is the last version that supported python3.6

.github/workflows/test-integration-strawberry.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
strategy:
3232
fail-fast: false
3333
matrix:
34-
python-version: ["3.8","3.9","3.10","3.11"]
34+
python-version: ["3.8","3.9","3.10","3.11","3.12"]
3535
# python3.6 reached EOL and is no longer being supported on
3636
# new versions of hosted runners on Github Actions
3737
# ubuntu-20.04 is the last version that supported python3.6

.github/workflows/test-integration-tornado.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
strategy:
3232
fail-fast: false
3333
matrix:
34-
python-version: ["3.7","3.8","3.9","3.10","3.11"]
34+
python-version: ["3.7","3.8","3.9","3.10","3.11","3.12"]
3535
# python3.6 reached EOL and is no longer being supported on
3636
# new versions of hosted runners on Github Actions
3737
# ubuntu-20.04 is the last version that supported python3.6

.github/workflows/test-integration-trytond.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
strategy:
3232
fail-fast: false
3333
matrix:
34-
python-version: ["3.5","3.6","3.7","3.8","3.9","3.10","3.11"]
34+
python-version: ["3.5","3.6","3.7","3.8","3.9","3.10","3.11","3.12"]
3535
# python3.6 reached EOL and is no longer being supported on
3636
# new versions of hosted runners on Github Actions
3737
# ubuntu-20.04 is the last version that supported python3.6

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ help:
2020

2121
dist: .venv
2222
rm -rf dist dist-serverless build
23-
$(VENV_PATH)/bin/pip install wheel
23+
$(VENV_PATH)/bin/pip install wheel setuptools
2424
$(VENV_PATH)/bin/python setup.py sdist bdist_wheel
2525
.PHONY: dist
2626

sentry_sdk/integrations/opentelemetry/span_processor.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,9 @@ def _update_span_with_otel_data(self, sentry_span, otel_span):
290290
url = otel_span.attributes.get(SpanAttributes.HTTP_URL, None)
291291
if url:
292292
parsed_url = urlparse(url)
293-
url = f"{parsed_url.scheme}://{parsed_url.netloc}{parsed_url.path}"
293+
url = "{}://{}{}".format(
294+
parsed_url.scheme, parsed_url.netloc, parsed_url.path
295+
)
294296
description += " {}".format(url)
295297

296298
status_code = otel_span.attributes.get(

tests/integrations/asyncpg/test_asyncpg.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@
3131
from sentry_sdk.integrations.asyncpg import AsyncPGIntegration
3232

3333

34-
PG_CONNECTION_URI = f"postgresql://{PG_USER}:{PG_PASSWORD}@{PG_HOST}/{PG_NAME}"
34+
PG_CONNECTION_URI = "postgresql://{}:{}@{}/{}".format(
35+
PG_USER, PG_PASSWORD, PG_HOST, PG_NAME
36+
)
3537
CRUMBS_CONNECT = {
3638
"category": "query",
3739
"data": {

tests/integrations/grpc/test_grpc.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def test_grpc_server_starts_transaction(sentry_init, capture_events_forksafe):
2929

3030
server = _set_up()
3131

32-
with grpc.insecure_channel(f"localhost:{PORT}") as channel:
32+
with grpc.insecure_channel("localhost:{}".format(PORT)) as channel:
3333
stub = gRPCTestServiceStub(channel)
3434
stub.TestServe(gRPCTestMessage(text="test"))
3535

@@ -54,7 +54,7 @@ def test_grpc_server_continues_transaction(sentry_init, capture_events_forksafe)
5454

5555
server = _set_up()
5656

57-
with grpc.insecure_channel(f"localhost:{PORT}") as channel:
57+
with grpc.insecure_channel("localhost:{}".format(PORT)) as channel:
5858
stub = gRPCTestServiceStub(channel)
5959

6060
with start_transaction() as transaction:
@@ -100,7 +100,7 @@ def test_grpc_client_starts_span(sentry_init, capture_events_forksafe):
100100

101101
server = _set_up()
102102

103-
with grpc.insecure_channel(f"localhost:{PORT}") as channel:
103+
with grpc.insecure_channel("localhost:{}".format(PORT)) as channel:
104104
channel = grpc.intercept_channel(channel, *interceptors)
105105
stub = gRPCTestServiceStub(channel)
106106

@@ -137,7 +137,7 @@ def test_grpc_client_and_servers_interceptors_integration(
137137

138138
server = _set_up()
139139

140-
with grpc.insecure_channel(f"localhost:{PORT}") as channel:
140+
with grpc.insecure_channel("localhost:{}".format(PORT)) as channel:
141141
channel = grpc.intercept_channel(channel, *interceptors)
142142
stub = gRPCTestServiceStub(channel)
143143

@@ -163,7 +163,7 @@ def _set_up():
163163
)
164164

165165
add_gRPCTestServiceServicer_to_server(TestService, server)
166-
server.add_insecure_port(f"[::]:{PORT}")
166+
server.add_insecure_port("[::]:{}".format(PORT))
167167
server.start()
168168

169169
return server

0 commit comments

Comments
 (0)