Skip to content

Commit

Permalink
Reapplyx3 "ref: upgrade sentry to python 3.12" (#76625)
Browse files Browse the repository at this point in the history
This reverts commit 0c527a0.

now that pyuwsgi is no longer deadlocking this should be good to go!
  • Loading branch information
asottile-sentry committed Aug 28, 2024
1 parent 71ca69d commit e2ff918
Show file tree
Hide file tree
Showing 14 changed files with 41 additions and 36 deletions.
3 changes: 2 additions & 1 deletion .github/actions/setup-sentry/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ inputs:
python-version:
description: 'python version to install'
required: false
default: '3.11.8'
default: '3.12.3'
pg-version:
description: 'PostgreSQL version to use'
default: '14'
Expand Down Expand Up @@ -79,6 +79,7 @@ runs:
### pytest configuration ###
echo "PY_COLORS=1" >> "$GITHUB_ENV"
echo "PYTEST_ADDOPTS=--reruns=5 --durations=10 --fail-slow=60s" >> $GITHUB_ENV
echo "COVERAGE_CORE=sysmon" >> "$GITHUB_ENV"
### pytest-sentry configuration ###
if [ "$GITHUB_REPOSITORY" = "getsentry/sentry" ]; then
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ jobs:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: getsentry/action-setup-venv@a133e6fd5fa6abd3f590a1c106abda344f5df69f # v2.1.0
with:
python-version: 3.11.8
python-version: 3.12.3
cache-dependency-path: requirements-dev-frozen.txt
install-cmd: python3 -m tools.hack_pip && pip install -q --constraint requirements-dev-frozen.txt pip-tools
- name: check requirements
Expand Down Expand Up @@ -301,7 +301,7 @@ jobs:

- uses: getsentry/action-setup-venv@a133e6fd5fa6abd3f590a1c106abda344f5df69f # v2.1.0
with:
python-version: 3.11.8
python-version: 3.12.3
cache-dependency-path: requirements-dev-frozen.txt
install-cmd: python3 -m tools.hack_pip && pip install -r requirements-dev-frozen.txt

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/development-environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: getsentry/action-setup-venv@a133e6fd5fa6abd3f590a1c106abda344f5df69f # v2.1.0
with:
python-version: 3.11.8
python-version: 3.12.3
cache-dependency-path: |
requirements-dev.txt
requirements-dev-frozen.txt
Expand All @@ -52,7 +52,7 @@ jobs:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: getsentry/action-setup-venv@a133e6fd5fa6abd3f590a1c106abda344f5df69f # v2.1.0
with:
python-version: 3.11.8
python-version: 3.12.3
cache-dependency-path: |
requirements-dev.txt
requirements-dev-frozen.txt
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ jobs:

- uses: getsentry/action-setup-venv@a133e6fd5fa6abd3f590a1c106abda344f5df69f # v2.1.0
with:
python-version: 3.11.8
python-version: 3.12.3
cache-dependency-path: |
requirements-dev.txt
requirements-dev-frozen.txt
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/react-to-product-owners-yml-changes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:

- uses: getsentry/action-setup-venv@a133e6fd5fa6abd3f590a1c106abda344f5df69f # v2.1.0
with:
python-version: 3.11.3
python-version: 3.12.3

- name: React to product-owners.yml changes
shell: bash
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/self-hosted.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:

- uses: getsentry/action-setup-venv@a133e6fd5fa6abd3f590a1c106abda344f5df69f # v2.1.0
with:
python-version: 3.11.6
python-version: 3.12.3
cache-dependency-path: requirements-dev-frozen.txt
install-cmd: python3 -m tools.hack_pip

Expand Down
2 changes: 1 addition & 1 deletion .python-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.11.8
3.12.3
40 changes: 20 additions & 20 deletions devenv/config.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[venv.sentry]
python = 3.11.8
python = 3.12.3
path = .venv
requirements = requirements-dev.txt
editable =
Expand All @@ -8,7 +8,7 @@ editable =
# bins =

[venv.getsentry]
python = 3.11.8
python = 3.12.3
# technically these are conflicting paths but getsentry is special
# and would rather keep devenv config symlinked
path = .venv
Expand All @@ -17,15 +17,15 @@ editable = .
# but we'll just install it during sync as it's rarely populated
requirements = sentry-requirements-dev-frozen.txt

[python3.11.8]
darwin_x86_64 = https://github.com/indygreg/python-build-standalone/releases/download/20240224/cpython-3.11.8+20240224-x86_64-apple-darwin-install_only.tar.gz
darwin_x86_64_sha256 = 097f467b0c36706bfec13f199a2eaf924e668f70c6e2bd1f1366806962f7e86e
darwin_arm64 = https://github.com/indygreg/python-build-standalone/releases/download/20240224/cpython-3.11.8+20240224-aarch64-apple-darwin-install_only.tar.gz
darwin_arm64_sha256 = 389a51139f5abe071a0d70091ca5df3e7a3dfcfcbe3e0ba6ad85fb4c5638421e
linux_x86_64 = https://github.com/indygreg/python-build-standalone/releases/download/20240224/cpython-3.11.8+20240224-x86_64-unknown-linux-gnu-install_only.tar.gz
linux_x86_64_sha256 = 94e13d0e5ad417035b80580f3e893a72e094b0900d5d64e7e34ab08e95439987
linux_arm64 = https://github.com/indygreg/python-build-standalone/releases/download/20240224/cpython-3.11.8+20240224-aarch64-unknown-linux-gnu-install_only.tar.gz
linux_arm64_sha256 = 389b9005fb78dd5a6f68df5ea45ab7b30d9a4b3222af96999e94fd20d4ad0c6a
[python3.12.3]
darwin_x86_64 = https://github.com/indygreg/python-build-standalone/releases/download/20240415/cpython-3.12.3+20240415-x86_64-apple-darwin-install_only.tar.gz
darwin_x86_64_sha256 = c37a22fca8f57d4471e3708de6d13097668c5f160067f264bb2b18f524c890c8
darwin_arm64 = https://github.com/indygreg/python-build-standalone/releases/download/20240415/cpython-3.12.3+20240415-aarch64-apple-darwin-install_only.tar.gz
darwin_arm64_sha256 = ccc40e5af329ef2af81350db2a88bbd6c17b56676e82d62048c15d548401519e
linux_x86_64 = https://github.com/indygreg/python-build-standalone/releases/download/20240415/cpython-3.12.3+20240415-x86_64-unknown-linux-gnu-install_only.tar.gz
linux_x86_64_sha256 = a73ba777b5d55ca89edef709e6b8521e3f3d4289581f174c8699adfb608d09d6
linux_arm64 = https://github.com/indygreg/python-build-standalone/releases/download/20240415/cpython-3.12.3+20240415-aarch64-unknown-linux-gnu-install_only.tar.gz
linux_arm64_sha256 = ec8126de97945e629cca9aedc80a29c4ae2992c9d69f2655e27ae73906ba187d

[colima]
darwin_x86_64 = https://github.com/abiosoft/colima/releases/download/v0.6.6/colima-Darwin-x86_64
Expand All @@ -41,12 +41,12 @@ version = v0.6.6

# kept here only for compatibility with older `devenv`
[python]
version = 3.11.8
darwin_x86_64 = https://github.com/indygreg/python-build-standalone/releases/download/20240224/cpython-3.11.8+20240224-x86_64-apple-darwin-install_only.tar.gz
darwin_x86_64_sha256 = 097f467b0c36706bfec13f199a2eaf924e668f70c6e2bd1f1366806962f7e86e
darwin_arm64 = https://github.com/indygreg/python-build-standalone/releases/download/20240224/cpython-3.11.8+20240224-aarch64-apple-darwin-install_only.tar.gz
darwin_arm64_sha256 = 389a51139f5abe071a0d70091ca5df3e7a3dfcfcbe3e0ba6ad85fb4c5638421e
linux_x86_64 = https://github.com/indygreg/python-build-standalone/releases/download/20240224/cpython-3.11.8+20240224-x86_64-unknown-linux-gnu-install_only.tar.gz
linux_x86_64_sha256 = 94e13d0e5ad417035b80580f3e893a72e094b0900d5d64e7e34ab08e95439987
linux_arm64 = https://github.com/indygreg/python-build-standalone/releases/download/20240224/cpython-3.11.8+20240224-aarch64-unknown-linux-gnu-install_only.tar.gz
linux_arm64_sha256 = 389b9005fb78dd5a6f68df5ea45ab7b30d9a4b3222af96999e94fd20d4ad0c6a
version = 3.12.3
darwin_x86_64 = https://github.com/indygreg/python-build-standalone/releases/download/20240415/cpython-3.12.3+20240415-x86_64-apple-darwin-install_only.tar.gz
darwin_x86_64_sha256 = c37a22fca8f57d4471e3708de6d13097668c5f160067f264bb2b18f524c890c8
darwin_arm64 = https://github.com/indygreg/python-build-standalone/releases/download/20240415/cpython-3.12.3+20240415-aarch64-apple-darwin-install_only.tar.gz
darwin_arm64_sha256 = ccc40e5af329ef2af81350db2a88bbd6c17b56676e82d62048c15d548401519e
linux_x86_64 = https://github.com/indygreg/python-build-standalone/releases/download/20240415/cpython-3.12.3+20240415-x86_64-unknown-linux-gnu-install_only.tar.gz
linux_x86_64_sha256 = a73ba777b5d55ca89edef709e6b8521e3f3d4289581f174c8699adfb608d09d6
linux_arm64 = https://github.com/indygreg/python-build-standalone/releases/download/20240415/cpython-3.12.3+20240415-aarch64-unknown-linux-gnu-install_only.tar.gz
linux_arm64_sha256 = ec8126de97945e629cca9aedc80a29c4ae2992c9d69f2655e27ae73906ba187d
6 changes: 5 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ filterwarnings = [
# this warning in protobuf causes a segfault in 3.12+ protocolbuffers/protobuf#15077
"ignore:Type google\\._upb.*",

# TODO: we should fix these, but for now there's a lot
"ignore:datetime.datetime.utcfromtimestamp\\(\\) is deprecated.*",
"ignore:datetime.datetime.utcnow\\(\\) is deprecated.*",

# The following warning filters are for pytest only.
"ignore:.*sentry.digests.backends.dummy.DummyBackend.*:sentry.utils.warnings.UnsupportedBackend",

Expand All @@ -43,7 +47,7 @@ filterwarnings = [
looponfailroots = ["src", "tests"]

[tool.mypy]
python_version = "3.11"
python_version = "3.12"
mypy_path = ["fixtures/stubs-for-mypy"]
plugins = [
"pydantic.mypy",
Expand Down
2 changes: 1 addition & 1 deletion requirements-dev-frozen.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# This file is autogenerated by pip-compile with Python 3.11
# This file is autogenerated by pip-compile with Python 3.12
# by the following command:
#
# make freeze-requirements
Expand Down
2 changes: 1 addition & 1 deletion requirements-frozen.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# This file is autogenerated by pip-compile with Python 3.11
# This file is autogenerated by pip-compile with Python 3.12
# by the following command:
#
# make freeze-requirements
Expand Down
4 changes: 2 additions & 2 deletions scripts/lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,11 @@ EOF
else
minor=$(echo "${python_version}" | sed 's/[0-9]*\.\([0-9]*\)\.\([0-9]*\)/\1/')
patch=$(echo "${python_version}" | sed 's/[0-9]*\.\([0-9]*\)\.\([0-9]*\)/\2/')
if [ "$minor" -ne 11 ] || [ "$patch" -lt 6 ]; then
if [ "$minor" -ne 12 ] || [ "$patch" -lt 1 ]; then
cat <<EOF
${red}${bold}
ERROR: You're running a virtualenv with Python ${python_version}.
We only support >= 3.11.6, < 3.12.
We only support >= 3.12.1, < 3.13.
Either run "rm -rf ${venv_name} && direnv allow" to
OR set SENTRY_PYTHON_VERSION=${python_version} to an .env file to bypass this check."
EOF
Expand Down
2 changes: 1 addition & 1 deletion self-hosted/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.11.8-slim-bookworm
FROM python:3.12.3-slim-bookworm

LABEL maintainer="oss@sentry.io"
LABEL org.opencontainers.image.title="Sentry"
Expand Down
2 changes: 1 addition & 1 deletion tests/sentry/test_devimports.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def _import(name, globals=None, locals=None, fromlist=(), level=0):
raise SystemExit(f'unexpected success importing {{xfail}}')
"""

env = {"SENTRY_ENVIRONMENT": "production", "SETUPTOOLS_USE_DISTUTILS": "stdlib"}
env = {"SENTRY_ENVIRONMENT": "production"}
ret = subprocess.run(
(sys.executable, "-c", script),
env=env,
Expand Down

0 comments on commit e2ff918

Please sign in to comment.