Skip to content

Commit

Permalink
Use Python 3.12 in CI where possible (#2488)
Browse files Browse the repository at this point in the history
Run workflow steps (lint, build, etc.) on Python 3.12 and test integrations on Python 3.12 if the library/framework supports it.
  • Loading branch information
sentrivana authored Nov 6, 2023
1 parent 52eb367 commit c5b915d
Show file tree
Hide file tree
Showing 35 changed files with 77 additions and 69 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: 3.11
python-version: 3.12

- run: |
pip install tox
Expand All @@ -41,7 +41,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: 3.9
python-version: 3.12

- run: |
python scripts/split-tox-gh-actions/split-tox-gh-actions.py --fail-on-changes
Expand All @@ -55,7 +55,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: 3.9
python-version: 3.12
- name: Setup build cache
uses: actions/cache@v3
id: build_cache
Expand Down Expand Up @@ -84,7 +84,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: 3.11
python-version: 3.12

- run: |
pip install virtualenv
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-integration-ariadne.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.8","3.9","3.10","3.11"]
python-version: ["3.8","3.9","3.10","3.11","3.12"]
# python3.6 reached EOL and is no longer being supported on
# new versions of hosted runners on Github Actions
# ubuntu-20.04 is the last version that supported python3.6
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-integration-arq.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.7","3.8","3.9","3.10","3.11"]
python-version: ["3.7","3.8","3.9","3.10","3.11","3.12"]
# python3.6 reached EOL and is no longer being supported on
# new versions of hosted runners on Github Actions
# ubuntu-20.04 is the last version that supported python3.6
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-integration-asgi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.7","3.8","3.9","3.10","3.11"]
python-version: ["3.7","3.8","3.9","3.10","3.11","3.12"]
# python3.6 reached EOL and is no longer being supported on
# new versions of hosted runners on Github Actions
# ubuntu-20.04 is the last version that supported python3.6
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-integration-asyncpg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.7","3.8","3.9","3.10","3.11"]
python-version: ["3.7","3.8","3.9","3.10","3.11","3.12"]
# python3.6 reached EOL and is no longer being supported on
# new versions of hosted runners on Github Actions
# ubuntu-20.04 is the last version that supported python3.6
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-integration-bottle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.5","3.6","3.7","3.8","3.9","3.10","3.11"]
python-version: ["3.5","3.6","3.7","3.8","3.9","3.10","3.11","3.12"]
# python3.6 reached EOL and is no longer being supported on
# new versions of hosted runners on Github Actions
# ubuntu-20.04 is the last version that supported python3.6
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-integration-clickhouse_driver.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.8","3.9","3.10","3.11"]
python-version: ["3.8","3.9","3.10","3.11","3.12"]
# python3.6 reached EOL and is no longer being supported on
# new versions of hosted runners on Github Actions
# ubuntu-20.04 is the last version that supported python3.6
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.6","3.7","3.8","3.9","3.10","3.11"]
python-version: ["3.6","3.7","3.8","3.9","3.10","3.11","3.12"]
# python3.6 reached EOL and is no longer being supported on
# new versions of hosted runners on Github Actions
# ubuntu-20.04 is the last version that supported python3.6
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-integration-django.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.5","3.6","3.7","3.8","3.9","3.10","3.11"]
python-version: ["3.5","3.6","3.7","3.8","3.9","3.10","3.11","3.12"]
# python3.6 reached EOL and is no longer being supported on
# new versions of hosted runners on Github Actions
# ubuntu-20.04 is the last version that supported python3.6
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-integration-falcon.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.5","3.6","3.7","3.8","3.9","3.10","3.11"]
python-version: ["3.5","3.6","3.7","3.8","3.9","3.10","3.11","3.12"]
# python3.6 reached EOL and is no longer being supported on
# new versions of hosted runners on Github Actions
# ubuntu-20.04 is the last version that supported python3.6
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-integration-fastapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.7","3.8","3.9","3.10","3.11"]
python-version: ["3.7","3.8","3.9","3.10","3.11","3.12"]
# python3.6 reached EOL and is no longer being supported on
# new versions of hosted runners on Github Actions
# ubuntu-20.04 is the last version that supported python3.6
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-integration-flask.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.5","3.6","3.7","3.8","3.9","3.10","3.11"]
python-version: ["3.5","3.6","3.7","3.8","3.9","3.10","3.11","3.12"]
# python3.6 reached EOL and is no longer being supported on
# new versions of hosted runners on Github Actions
# ubuntu-20.04 is the last version that supported python3.6
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-integration-graphene.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.7","3.8","3.9","3.10","3.11"]
python-version: ["3.7","3.8","3.9","3.10","3.11","3.12"]
# python3.6 reached EOL and is no longer being supported on
# new versions of hosted runners on Github Actions
# ubuntu-20.04 is the last version that supported python3.6
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-integration-grpc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.7","3.8","3.9","3.10","3.11"]
python-version: ["3.7","3.8","3.9","3.10","3.11","3.12"]
# python3.6 reached EOL and is no longer being supported on
# new versions of hosted runners on Github Actions
# ubuntu-20.04 is the last version that supported python3.6
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-integration-httpx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.6","3.7","3.8","3.9","3.10","3.11"]
python-version: ["3.6","3.7","3.8","3.9","3.10","3.11","3.12"]
# python3.6 reached EOL and is no longer being supported on
# new versions of hosted runners on Github Actions
# ubuntu-20.04 is the last version that supported python3.6
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-integration-huey.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.5","3.6","3.7","3.8","3.9","3.10","3.11"]
python-version: ["3.5","3.6","3.7","3.8","3.9","3.10","3.11","3.12"]
# python3.6 reached EOL and is no longer being supported on
# new versions of hosted runners on Github Actions
# ubuntu-20.04 is the last version that supported python3.6
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-integration-loguru.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.5","3.6","3.7","3.8","3.9","3.10","3.11"]
python-version: ["3.5","3.6","3.7","3.8","3.9","3.10","3.11","3.12"]
# python3.6 reached EOL and is no longer being supported on
# new versions of hosted runners on Github Actions
# ubuntu-20.04 is the last version that supported python3.6
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-integration-opentelemetry.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.7","3.8","3.9","3.10","3.11"]
python-version: ["3.7","3.8","3.9","3.10","3.11","3.12"]
# python3.6 reached EOL and is no longer being supported on
# new versions of hosted runners on Github Actions
# ubuntu-20.04 is the last version that supported python3.6
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-integration-pure_eval.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.5","3.6","3.7","3.8","3.9","3.10","3.11"]
python-version: ["3.5","3.6","3.7","3.8","3.9","3.10","3.11","3.12"]
# python3.6 reached EOL and is no longer being supported on
# new versions of hosted runners on Github Actions
# ubuntu-20.04 is the last version that supported python3.6
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-integration-pymongo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.6","3.7","3.8","3.9","3.10","3.11"]
python-version: ["3.6","3.7","3.8","3.9","3.10","3.11","3.12"]
# python3.6 reached EOL and is no longer being supported on
# new versions of hosted runners on Github Actions
# ubuntu-20.04 is the last version that supported python3.6
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-integration-pyramid.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.5","3.6","3.7","3.8","3.9","3.10","3.11"]
python-version: ["3.5","3.6","3.7","3.8","3.9","3.10","3.11","3.12"]
# python3.6 reached EOL and is no longer being supported on
# new versions of hosted runners on Github Actions
# ubuntu-20.04 is the last version that supported python3.6
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-integration-quart.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.7","3.8","3.9","3.10","3.11"]
python-version: ["3.7","3.8","3.9","3.10","3.11","3.12"]
# python3.6 reached EOL and is no longer being supported on
# new versions of hosted runners on Github Actions
# ubuntu-20.04 is the last version that supported python3.6
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-integration-redis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.7","3.8","3.9","3.10","3.11"]
python-version: ["3.7","3.8","3.9","3.10","3.11","3.12"]
# python3.6 reached EOL and is no longer being supported on
# new versions of hosted runners on Github Actions
# ubuntu-20.04 is the last version that supported python3.6
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-integration-requests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.8","3.9","3.10","3.11"]
python-version: ["3.8","3.9","3.10","3.11","3.12"]
# python3.6 reached EOL and is no longer being supported on
# new versions of hosted runners on Github Actions
# ubuntu-20.04 is the last version that supported python3.6
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-integration-rq.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.5","3.6","3.7","3.8","3.9","3.10","3.11"]
python-version: ["3.5","3.6","3.7","3.8","3.9","3.10","3.11","3.12"]
# python3.6 reached EOL and is no longer being supported on
# new versions of hosted runners on Github Actions
# ubuntu-20.04 is the last version that supported python3.6
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-integration-sqlalchemy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.7","3.8","3.9","3.10","3.11"]
python-version: ["3.7","3.8","3.9","3.10","3.11","3.12"]
# python3.6 reached EOL and is no longer being supported on
# new versions of hosted runners on Github Actions
# ubuntu-20.04 is the last version that supported python3.6
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-integration-starlette.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.7","3.8","3.9","3.10","3.11"]
python-version: ["3.7","3.8","3.9","3.10","3.11","3.12"]
# python3.6 reached EOL and is no longer being supported on
# new versions of hosted runners on Github Actions
# ubuntu-20.04 is the last version that supported python3.6
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-integration-strawberry.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.8","3.9","3.10","3.11"]
python-version: ["3.8","3.9","3.10","3.11","3.12"]
# python3.6 reached EOL and is no longer being supported on
# new versions of hosted runners on Github Actions
# ubuntu-20.04 is the last version that supported python3.6
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-integration-tornado.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.7","3.8","3.9","3.10","3.11"]
python-version: ["3.7","3.8","3.9","3.10","3.11","3.12"]
# python3.6 reached EOL and is no longer being supported on
# new versions of hosted runners on Github Actions
# ubuntu-20.04 is the last version that supported python3.6
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-integration-trytond.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.5","3.6","3.7","3.8","3.9","3.10","3.11"]
python-version: ["3.5","3.6","3.7","3.8","3.9","3.10","3.11","3.12"]
# python3.6 reached EOL and is no longer being supported on
# new versions of hosted runners on Github Actions
# ubuntu-20.04 is the last version that supported python3.6
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ help:

dist: .venv
rm -rf dist dist-serverless build
$(VENV_PATH)/bin/pip install wheel
$(VENV_PATH)/bin/pip install wheel setuptools
$(VENV_PATH)/bin/python setup.py sdist bdist_wheel
.PHONY: dist

Expand Down
4 changes: 3 additions & 1 deletion sentry_sdk/integrations/opentelemetry/span_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,9 @@ def _update_span_with_otel_data(self, sentry_span, otel_span):
url = otel_span.attributes.get(SpanAttributes.HTTP_URL, None)
if url:
parsed_url = urlparse(url)
url = f"{parsed_url.scheme}://{parsed_url.netloc}{parsed_url.path}"
url = "{}://{}{}".format(
parsed_url.scheme, parsed_url.netloc, parsed_url.path
)
description += " {}".format(url)

status_code = otel_span.attributes.get(
Expand Down
4 changes: 3 additions & 1 deletion tests/integrations/asyncpg/test_asyncpg.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@
from sentry_sdk.integrations.asyncpg import AsyncPGIntegration


PG_CONNECTION_URI = f"postgresql://{PG_USER}:{PG_PASSWORD}@{PG_HOST}/{PG_NAME}"
PG_CONNECTION_URI = "postgresql://{}:{}@{}/{}".format(
PG_USER, PG_PASSWORD, PG_HOST, PG_NAME
)
CRUMBS_CONNECT = {
"category": "query",
"data": {
Expand Down
10 changes: 5 additions & 5 deletions tests/integrations/grpc/test_grpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def test_grpc_server_starts_transaction(sentry_init, capture_events_forksafe):

server = _set_up()

with grpc.insecure_channel(f"localhost:{PORT}") as channel:
with grpc.insecure_channel("localhost:{}".format(PORT)) as channel:
stub = gRPCTestServiceStub(channel)
stub.TestServe(gRPCTestMessage(text="test"))

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

server = _set_up()

with grpc.insecure_channel(f"localhost:{PORT}") as channel:
with grpc.insecure_channel("localhost:{}".format(PORT)) as channel:
stub = gRPCTestServiceStub(channel)

with start_transaction() as transaction:
Expand Down Expand Up @@ -100,7 +100,7 @@ def test_grpc_client_starts_span(sentry_init, capture_events_forksafe):

server = _set_up()

with grpc.insecure_channel(f"localhost:{PORT}") as channel:
with grpc.insecure_channel("localhost:{}".format(PORT)) as channel:
channel = grpc.intercept_channel(channel, *interceptors)
stub = gRPCTestServiceStub(channel)

Expand Down Expand Up @@ -137,7 +137,7 @@ def test_grpc_client_and_servers_interceptors_integration(

server = _set_up()

with grpc.insecure_channel(f"localhost:{PORT}") as channel:
with grpc.insecure_channel("localhost:{}".format(PORT)) as channel:
channel = grpc.intercept_channel(channel, *interceptors)
stub = gRPCTestServiceStub(channel)

Expand All @@ -163,7 +163,7 @@ def _set_up():
)

add_gRPCTestServiceServicer_to_server(TestService, server)
server.add_insecure_port(f"[::]:{PORT}")
server.add_insecure_port("[::]:{}".format(PORT))
server.start()

return server
Expand Down
Loading

0 comments on commit c5b915d

Please sign in to comment.