Skip to content

[2.0] Drop support for Python 2.7 and 3.5 #2581

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 30 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
d8846eb
Drop Python<=3.5 support
sentrivana Dec 11, 2023
00f9e0e
Drop 2.7, 3.5 from tox.ini and workflows
sentrivana Dec 11, 2023
3ed5180
Remove old py imports in tests
sentrivana Dec 12, 2023
9ee89d9
Remove obsolete version guards
sentrivana Dec 12, 2023
17464cc
Remove object as superclass
sentrivana Dec 12, 2023
2ab6422
Update setup.py
sentrivana Dec 12, 2023
44c45f3
Remove tracing_utils_py*
sentrivana Dec 12, 2023
0ac1f29
move import
sentrivana Dec 12, 2023
ea70099
Merge branch 'sentry-sdk-2.0' into ivana/drop-py27-and-py35
sentrivana Dec 13, 2023
4235a9b
Circular import
sentrivana Dec 14, 2023
a651eeb
Update Python version 3.9->3.12 in makefile
sentrivana Dec 14, 2023
779e90f
Fix decorator tests
sentrivana Dec 14, 2023
0dbf603
Update tests, migration guide
sentrivana Dec 14, 2023
b6d8791
Remove # coding: utf-8
sentrivana Dec 15, 2023
fe36b71
Remove obsolete __future__ imports
sentrivana Dec 15, 2023
e8f76e7
Fix mypy
sentrivana Dec 15, 2023
cffb1d0
Remove more small py2 hacks;
sentrivana Dec 15, 2023
be440d8
Document dropped framework versions
sentrivana Dec 15, 2023
d5288b5
Remove deprecation message
sentrivana Dec 15, 2023
f4bbd5e
mypy
sentrivana Dec 15, 2023
46b27b3
Remove functools compat
sentrivana Dec 15, 2023
108e2d5
more compat
sentrivana Dec 15, 2023
e40fcee
Fix bottle
sentrivana Dec 15, 2023
b9a3d20
Remove u-strings
sentrivana Jan 10, 2024
542fced
old import
sentrivana Jan 10, 2024
e6a3398
Merge branch 'sentry-sdk-2.0' into ivana/drop-py27-and-py35
sentrivana Jan 10, 2024
95b79e2
remove py2 special behavior
sentrivana Jan 10, 2024
4ba8ad1
fix mock
sentrivana Jan 10, 2024
1c0a015
more path fixes
sentrivana Jan 10, 2024
f66baad
lint
sentrivana Jan 10, 2024
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 .github/workflows/test-integrations-aws-lambda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ jobs:
test-aws_lambda-pinned:
name: AWS Lambda (pinned)
timeout-minutes: 30
needs: check-permissions
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
Expand All @@ -64,6 +63,7 @@ jobs:
# ubuntu-20.04 is the last version that supported python3.6
# see https://github.com/actions/setup-python/issues/544#issuecomment-1332535877
os: [ubuntu-20.04]
needs: check-permissions
steps:
- uses: actions/checkout@v4
with:
Expand Down
43 changes: 1 addition & 42 deletions .github/workflows/test-integrations-cloud-computing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,46 +114,9 @@ jobs:
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage.xml
test-cloud_computing-py27:
name: Cloud Computing (py27)
timeout-minutes: 30
runs-on: ubuntu-20.04
container: python:2.7
steps:
- uses: actions/checkout@v4
- name: Setup Test Env
run: |
pip install coverage "tox>=3,<4"
- name: Erase coverage
run: |
coverage erase
- name: Test boto3 py27
run: |
set -x # print commands that are executed
./scripts/runtox.sh --exclude-latest "py2.7-boto3" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch
- name: Test chalice py27
run: |
set -x # print commands that are executed
./scripts/runtox.sh --exclude-latest "py2.7-chalice" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch
- name: Test cloud_resource_context py27
run: |
set -x # print commands that are executed
./scripts/runtox.sh --exclude-latest "py2.7-cloud_resource_context" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch
- name: Test gcp py27
run: |
set -x # print commands that are executed
./scripts/runtox.sh --exclude-latest "py2.7-gcp" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch
- name: Generate coverage XML
run: |
coverage combine .coverage*
coverage xml -i
- uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage.xml
check_required_tests:
name: All Cloud Computing tests passed
needs: [test-cloud_computing-pinned, test-cloud_computing-py27]
needs: test-cloud_computing-pinned
# Always run this, even if a dependent job failed
if: always()
runs-on: ubuntu-20.04
Expand All @@ -162,7 +125,3 @@ jobs:
if: contains(needs.test-cloud_computing-pinned.result, 'failure') || contains(needs.test-cloud_computing-pinned.result, 'skipped')
run: |
echo "One of the dependent jobs has failed. You may need to re-run it." && exit 1
- name: Check for 2.7 failures
if: contains(needs.test-cloud_computing-py27.result, 'failure') || contains(needs.test-cloud_computing-py27.result, 'skipped')
run: |
echo "One of the dependent jobs has failed. You may need to re-run it." && exit 1
33 changes: 2 additions & 31 deletions .github/workflows/test-integrations-common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.5","3.6","3.7","3.8","3.9","3.10","3.11","3.12"]
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 Expand Up @@ -54,34 +54,9 @@ jobs:
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage.xml
test-common-py27:
name: Common (py27)
timeout-minutes: 30
runs-on: ubuntu-20.04
container: python:2.7
steps:
- uses: actions/checkout@v4
- name: Setup Test Env
run: |
pip install coverage "tox>=3,<4"
- name: Erase coverage
run: |
coverage erase
- name: Test common py27
run: |
set -x # print commands that are executed
./scripts/runtox.sh --exclude-latest "py2.7-common" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch
- name: Generate coverage XML
run: |
coverage combine .coverage*
coverage xml -i
- uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage.xml
check_required_tests:
name: All Common tests passed
needs: [test-common-pinned, test-common-py27]
needs: test-common-pinned
# Always run this, even if a dependent job failed
if: always()
runs-on: ubuntu-20.04
Expand All @@ -90,7 +65,3 @@ jobs:
if: contains(needs.test-common-pinned.result, 'failure') || contains(needs.test-common-pinned.result, 'skipped')
run: |
echo "One of the dependent jobs has failed. You may need to re-run it." && exit 1
- name: Check for 2.7 failures
if: contains(needs.test-common-py27.result, 'failure') || contains(needs.test-common-py27.result, 'skipped')
run: |
echo "One of the dependent jobs has failed. You may need to re-run it." && exit 1
51 changes: 3 additions & 48 deletions .github/workflows/test-integrations-data-processing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.5","3.7","3.8","3.11","3.12"]
python-version: ["3.7","3.8","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 Expand Up @@ -77,7 +77,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.5","3.6","3.7","3.8","3.9","3.10","3.11","3.12"]
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 Expand Up @@ -122,50 +122,9 @@ jobs:
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage.xml
test-data_processing-py27:
name: Data Processing (py27)
timeout-minutes: 30
runs-on: ubuntu-20.04
container: python:2.7
steps:
- uses: actions/checkout@v4
- name: Setup Test Env
run: |
pip install coverage "tox>=3,<4"
- name: Erase coverage
run: |
coverage erase
- name: Test arq py27
run: |
set -x # print commands that are executed
./scripts/runtox.sh --exclude-latest "py2.7-arq" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch
- name: Test beam py27
run: |
set -x # print commands that are executed
./scripts/runtox.sh --exclude-latest "py2.7-beam" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch
- name: Test celery py27
run: |
set -x # print commands that are executed
./scripts/runtox.sh --exclude-latest "py2.7-celery" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch
- name: Test huey py27
run: |
set -x # print commands that are executed
./scripts/runtox.sh --exclude-latest "py2.7-huey" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch
- name: Test rq py27
run: |
set -x # print commands that are executed
./scripts/runtox.sh --exclude-latest "py2.7-rq" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch
- name: Generate coverage XML
run: |
coverage combine .coverage*
coverage xml -i
- uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage.xml
check_required_tests:
name: All Data Processing tests passed
needs: [test-data_processing-pinned, test-data_processing-py27]
needs: test-data_processing-pinned
# Always run this, even if a dependent job failed
if: always()
runs-on: ubuntu-20.04
Expand All @@ -174,7 +133,3 @@ jobs:
if: contains(needs.test-data_processing-pinned.result, 'failure') || contains(needs.test-data_processing-pinned.result, 'skipped')
run: |
echo "One of the dependent jobs has failed. You may need to re-run it." && exit 1
- name: Check for 2.7 failures
if: contains(needs.test-data_processing-py27.result, 'failure') || contains(needs.test-data_processing-py27.result, 'skipped')
run: |
echo "One of the dependent jobs has failed. You may need to re-run it." && exit 1
65 changes: 1 addition & 64 deletions .github/workflows/test-integrations-databases.yml
Original file line number Diff line number Diff line change
Expand Up @@ -158,68 +158,9 @@ jobs:
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage.xml
test-databases-py27:
name: Databases (py27)
timeout-minutes: 30
runs-on: ubuntu-20.04
container: python:2.7
services:
postgres:
image: postgres
env:
POSTGRES_PASSWORD: sentry
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
# Maps tcp port 5432 on service container to the host
ports:
- 5432:5432
env:
SENTRY_PYTHON_TEST_POSTGRES_USER: postgres
SENTRY_PYTHON_TEST_POSTGRES_PASSWORD: sentry
SENTRY_PYTHON_TEST_POSTGRES_NAME: ci_test
SENTRY_PYTHON_TEST_POSTGRES_HOST: postgres
steps:
- uses: actions/checkout@v4
- uses: getsentry/action-clickhouse-in-ci@v1
- name: Setup Test Env
run: |
pip install coverage "tox>=3,<4"
psql postgresql://postgres:sentry@postgres:5432 -c "create database ${SENTRY_PYTHON_TEST_POSTGRES_NAME};" || true
psql postgresql://postgres:sentry@postgres:5432 -c "grant all privileges on database ${SENTRY_PYTHON_TEST_POSTGRES_NAME} to ${SENTRY_PYTHON_TEST_POSTGRES_USER};" || true
- name: Erase coverage
run: |
coverage erase
- name: Test asyncpg py27
run: |
set -x # print commands that are executed
./scripts/runtox.sh --exclude-latest "py2.7-asyncpg" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch
- name: Test clickhouse_driver py27
run: |
set -x # print commands that are executed
./scripts/runtox.sh --exclude-latest "py2.7-clickhouse_driver" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch
- name: Test pymongo py27
run: |
set -x # print commands that are executed
./scripts/runtox.sh --exclude-latest "py2.7-pymongo" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch
- name: Test sqlalchemy py27
run: |
set -x # print commands that are executed
./scripts/runtox.sh --exclude-latest "py2.7-sqlalchemy" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch
- name: Generate coverage XML
run: |
coverage combine .coverage*
coverage xml -i
- uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage.xml
check_required_tests:
name: All Databases tests passed
needs: [test-databases-pinned, test-databases-py27]
needs: test-databases-pinned
# Always run this, even if a dependent job failed
if: always()
runs-on: ubuntu-20.04
Expand All @@ -228,7 +169,3 @@ jobs:
if: contains(needs.test-databases-pinned.result, 'failure') || contains(needs.test-databases-pinned.result, 'skipped')
run: |
echo "One of the dependent jobs has failed. You may need to re-run it." && exit 1
- name: Check for 2.7 failures
if: contains(needs.test-databases-py27.result, 'failure') || contains(needs.test-databases-py27.result, 'skipped')
run: |
echo "One of the dependent jobs has failed. You may need to re-run it." && exit 1
4 changes: 2 additions & 2 deletions .github/workflows/test-integrations-miscellaneous.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.5","3.8","3.11","3.12"]
python-version: ["3.8","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 Expand Up @@ -73,7 +73,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.5","3.6","3.7","3.8","3.9","3.11","3.12"]
python-version: ["3.6","3.7","3.8","3.9","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
43 changes: 1 addition & 42 deletions .github/workflows/test-integrations-networking.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,46 +114,9 @@ jobs:
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage.xml
test-networking-py27:
name: Networking (py27)
timeout-minutes: 30
runs-on: ubuntu-20.04
container: python:2.7
steps:
- uses: actions/checkout@v4
- name: Setup Test Env
run: |
pip install coverage "tox>=3,<4"
- name: Erase coverage
run: |
coverage erase
- name: Test gevent py27
run: |
set -x # print commands that are executed
./scripts/runtox.sh --exclude-latest "py2.7-gevent" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch
- name: Test grpc py27
run: |
set -x # print commands that are executed
./scripts/runtox.sh --exclude-latest "py2.7-grpc" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch
- name: Test httpx py27
run: |
set -x # print commands that are executed
./scripts/runtox.sh --exclude-latest "py2.7-httpx" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch
- name: Test requests py27
run: |
set -x # print commands that are executed
./scripts/runtox.sh --exclude-latest "py2.7-requests" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch
- name: Generate coverage XML
run: |
coverage combine .coverage*
coverage xml -i
- uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage.xml
check_required_tests:
name: All Networking tests passed
needs: [test-networking-pinned, test-networking-py27]
needs: test-networking-pinned
# Always run this, even if a dependent job failed
if: always()
runs-on: ubuntu-20.04
Expand All @@ -162,7 +125,3 @@ jobs:
if: contains(needs.test-networking-pinned.result, 'failure') || contains(needs.test-networking-pinned.result, 'skipped')
run: |
echo "One of the dependent jobs has failed. You may need to re-run it." && exit 1
- name: Check for 2.7 failures
if: contains(needs.test-networking-py27.result, 'failure') || contains(needs.test-networking-py27.result, 'skipped')
run: |
echo "One of the dependent jobs has failed. You may need to re-run it." && exit 1
Loading