Browse Source

chore: drop Python 3.6 (#29504)

josh 3 years ago
parent
commit
b0cfeb1c10
6 changed files with 13 additions and 22 deletions
  1. 1 1
      docker/Dockerfile
  2. 1 1
      docker/builder.dockerfile
  3. 5 10
      requirements-base.txt
  4. 1 1
      setup.cfg
  5. 4 4
      setup.py
  6. 1 5
      src/sentry/lang/javascript/errorlocale.py

+ 1 - 1
docker/Dockerfile

@@ -1,4 +1,4 @@
-FROM python:3.6.13-slim-buster
+FROM python:3.8.12-slim-buster
 
 LABEL maintainer="oss@sentry.io"
 LABEL org.opencontainers.image.title="Sentry"

+ 1 - 1
docker/builder.dockerfile

@@ -1,4 +1,4 @@
-FROM python:3.6.13-slim-buster as sdist
+FROM python:3.8.12-slim-buster as sdist
 
 LABEL maintainer="oss@sentry.io"
 LABEL org.opencontainers.image.title="Sentry Wheel Builder"

+ 5 - 10
requirements-base.txt

@@ -3,10 +3,9 @@ boto3==1.13.16
 botocore==1.16.16
 celery==4.4.7
 click==7.1.2
-confluent-kafka==1.5.0; python_version <= '3.8'
+confluent-kafka==1.5.0; python_version == '3.8'
 confluent-kafka==1.6.0; python_version == '3.9'
 croniter==0.3.37
-dataclasses==0.8; python_version <= '3.6'
 datadog==0.29.3
 django-crispy-forms==1.8.1
 django-picklefield==2.1.0
@@ -22,7 +21,7 @@ google-cloud-pubsub==2.2.0
 google-cloud-storage==1.35.0
 # Only necessary to prevent installing the latest version
 # https://github.com/googleapis/python-crc32c/issues/83
-google-crc32c==1.1.2; python_version == '3.8'
+google-crc32c==1.1.2
 jsonschema==3.2.0
 lxml==4.6.3
 maxminddb==2.0.3
@@ -31,8 +30,7 @@ mmh3==3.0.0
 parsimonious==0.8.0
 petname==2.6
 phonenumberslite==8.12.0
-Pillow==8.2.0; python_version == '3.6'
-Pillow==8.3.1; python_version > '3.6'
+Pillow==8.3.1
 progressbar2==3.32.0
 python-rapidjson==1.4
 psycopg2-binary==2.8.6
@@ -53,7 +51,7 @@ rfc3986-validator==0.1.1
 # [end] jsonschema format validators
 sentry-relay==0.8.9
 sentry-sdk>=1.4.3,<1.5.0
-snuba-sdk>=0.0.25,<1.0.0
+snuba-sdk>=0.0.26,<1.0.0
 simplejson==3.17.2
 statsd==3.3
 structlog==21.1.0
@@ -66,10 +64,7 @@ uWSGI==2.0.19.1
 zstandard==0.14.1
 
 msgpack==1.0.0
-# for encrypting stored user credentials
-cryptography==3.3.2; python_version == '3.6'
-# Development only: It has an arm64 wheel for Apple M1 chipsets
-cryptography==3.4.8; python_version > '3.6'
+cryptography==3.4.8
 # celery
 billiard==3.6.3
 kombu==4.6.11

+ 1 - 1
setup.cfg

@@ -10,7 +10,7 @@ ignore = F999,E203,E501,E128,E124,E402,W503,W504,E731,C901,B007,B009,B010,B011
 # But rather than append # noqa: E501 to all of them, we just ignore E501 for now.
 
 [bdist_wheel]
-python-tag = py36
+python-tag = py38
 
 [coverage:run]
 omit =

+ 4 - 4
setup.py

@@ -5,13 +5,13 @@ import sys
 
 python_version = sys.version_info[:2]
 
-if python_version < (3, 6):
-    sys.exit(f"Error: Sentry requires at least Python 3.6 ({python_version})")
-if python_version not in ((3, 6), (3, 8)):
+if python_version < (3, 8):
+    sys.exit(f"Error: Sentry requires at least Python 3.8 ({python_version})")
+if python_version != (3, 8):
     import logging
 
     logger = logging.getLogger()
-    logger.warning(f"A Python version different than 3.6 or 3.8 is being used ({python_version})")
+    logger.warning(f"A Python version different than 3.8 is being used ({python_version})")
 
 
 from distutils.command.build import build as BuildCommand

+ 1 - 5
src/sentry/lang/javascript/errorlocale.py

@@ -1,6 +1,5 @@
 import os
 import re
-import sys
 
 from sentry.utils.safe import get_path
 
@@ -10,9 +9,6 @@ TARGET_LOCALE = "en-US"
 translation_lookup_table = set()
 target_locale_lookup_table = dict()
 
-# TODO(python3.8): inline me
-_to_replace = r"\%s" if sys.version_info[:2] < (3, 7) else r"%s"
-
 
 def populate_target_locale_lookup_table():
     for locale in os.listdir(LOCALES_DIR):
@@ -30,7 +26,7 @@ def populate_target_locale_lookup_table():
                 else:
                     translation_regexp = re.escape(translation)
                     translation_regexp = translation_regexp.replace(
-                        _to_replace, r"(?P<format_string_data>[a-zA-Z0-9-_\$]+)"
+                        r"%s", r"(?P<format_string_data>[a-zA-Z0-9-_\$]+)"
                     )
                     # Some errors are substrings of more detailed ones, so we need exact match
                     translation_regexp = re.compile("^" + translation_regexp + "$")