Skip to content

Commit bacf109

Browse files
Merge pull request #630 from getsentry/py310-plus
only support python 3.10+
2 parents 0ca956a + 7f21b65 commit bacf109

File tree

10 files changed

+23
-29
lines changed

10 files changed

+23
-29
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ jobs:
2626
- uses: actions/checkout@v3
2727
- run: python3 -u docker/install-pythons --dest pythons
2828
- run: |
29-
echo "$PWD/pythons/cp38-cp38/bin" >> "$GITHUB_PATH"
30-
echo "$PWD/pythons/cp39-cp39/bin" >> "$GITHUB_PATH"
3129
echo "$PWD/pythons/cp310-cp310/bin" >> "$GITHUB_PATH"
3230
echo "$PWD/pythons/cp311-cp311/bin" >> "$GITHUB_PATH"
3331
echo "$PWD/venv/bin" >> "$GITHUB_PATH"
@@ -65,7 +63,7 @@ jobs:
6563
- uses: actions/checkout@v3
6664
- uses: actions/setup-python@v4
6765
with:
68-
python-version: 3.9
66+
python-version: '3.10'
6967
- run: pip install -r docker/requirements.txt
7068
- uses: actions/download-artifact@v3
7169
with:

.github/workflows/pre-commit.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ jobs:
1111
- uses: actions/checkout@v3
1212
- uses: actions/setup-python@v4
1313
with:
14-
python-version: 3.9
14+
python-version: '3.10'
1515
- uses: pre-commit/action@v3.0.0

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ jobs:
1414
- uses: actions/checkout@v3
1515
- uses: actions/setup-python@v4
1616
with:
17-
python-version: 3.9
17+
python-version: '3.10'
1818
- run: pip install tox
1919
- run: tox -e py

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,16 @@ repos:
1111
rev: v3.12.0
1212
hooks:
1313
- id: reorder-python-imports
14-
args: [--py39-plus, --add-import, 'from __future__ import annotations']
14+
args: [--py310-plus, --add-import, 'from __future__ import annotations']
1515
- repo: https://github.com/psf/black
16-
rev: 23.12.1
16+
rev: 24.1.1
1717
hooks:
1818
- id: black
1919
- repo: https://github.com/asottile/pyupgrade
2020
rev: v3.15.0
2121
hooks:
2222
- id: pyupgrade
23-
args: [--py39-plus]
23+
args: [--py310-plus]
2424
- repo: https://github.com/PyCQA/flake8
2525
rev: 7.0.0
2626
hooks:

build.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@
1717
import urllib.parse
1818
import urllib.request
1919
import zipfile
20+
from collections.abc import Callable
2021
from collections.abc import Generator
2122
from collections.abc import Mapping
2223
from collections.abc import MutableMapping
23-
from typing import Callable
2424
from typing import ContextManager
2525
from typing import NamedTuple
2626

@@ -32,7 +32,7 @@
3232
from packaging.utils import parse_wheel_filename
3333
from packaging.version import Version
3434

35-
PYTHONS = ((3, 9), (3, 10), (3, 11))
35+
PYTHONS = ((3, 10), (3, 11))
3636

3737
BINARY_EXTS = frozenset(
3838
(".c", ".cc", ".cpp", ".cxx", ".pxd", ".pxi", ".pyx", ".go", ".rs")

docker/Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM python:3.9.16-slim-buster
1+
FROM python:3.10.12-slim-buster
22
RUN : \
33
&& apt-get update \
44
&& DEBIAN_FRONTEND=noninteractive apt-get install \
@@ -45,7 +45,7 @@ RUN : \
4545

4646
ENV \
4747
BUILD_IN_CONTAINER=1 \
48-
PATH=/venv/bin:/opt/python/cp38-cp38/bin:/opt/python/cp39-cp39/bin:/opt/python/cp310-cp310/bin:/opt/python/cp311-cp311/bin:$PATH \
48+
PATH=/venv/bin:/opt/python/cp310-cp310/bin:/opt/python/cp311-cp311/bin:$PATH \
4949
PIP_DISABLE_PIP_VERSION_CHECK=1 \
5050
PIP_NO_CACHE_DIR=1 \
5151
PIP_NO_WARN_ABOUT_ROOT_USER=0
@@ -55,7 +55,7 @@ RUN /tmp/install-pythons
5555

5656
COPY requirements.txt /tmp/requirements.txt
5757
RUN : \
58-
&& /opt/python/cp39-cp39/bin/python3.9 -m venv /venv \
58+
&& /opt/python/cp310-cp310/bin/python3.10 -m venv /venv \
5959
&& /venv/bin/pip install --no-cache-dir -r /tmp/requirements.txt
6060

6161
ENTRYPOINT ["dumb-init", "--"]

docker/install-pythons

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env python3.9
1+
#!/usr/bin/env python3.10
22
from __future__ import annotations
33

44
import argparse
@@ -11,12 +11,8 @@ import subprocess
1111
import sys
1212
import tempfile
1313

14-
# gsutil cp gs://sentry-dev-infra-assets/prebuilt-pythons/python-{3.9.15+0,3.10.8+0,3.11.0+0}.sha256sums -
14+
# gsutil cp gs://sentry-dev-infra-assets/prebuilt-pythons/python-{3.10.8+0,3.11.0+0}.sha256sums -
1515
CHECKSUMS = """\
16-
24e0e6a5f0441ec6a037d55930b201c46eefb4559945ded8f670211680c03fe9 python-3.9.16+0-macosx_12_0_arm64.tgz
17-
e08d2874414df8dd1a44a507339884266de5193dd9e637375c7c16ddfc3296e7 python-3.9.16+0-macosx_12_0_x86_64.tgz
18-
acfa20f500332e6f3c4d900db611ba069b52965973c77b03a8af5c774cf51730 python-3.9.16+0-manylinux_2_28_aarch64.tgz
19-
0a50b871ab5ff2e945a461f00589089c944ffee7f049c8c06be7a15e86745fc1 python-3.9.16+0-manylinux_2_28_x86_64.tgz
2016
503f2b82d52647c322af626052995cded0a23899cca94600aa80eb193e4b926a python-3.10.9+0-macosx_12_0_arm64.tgz
2117
30c919dd9be7767488d7953946c6dd39d058571b85c280c7e33df2fb771149cc python-3.10.9+0-macosx_12_0_x86_64.tgz
2218
2ca822fa3c09e515dcbdcf7c8f4b091cc47b5c935b44083f69fd572580f9ceca python-3.10.9+0-manylinux_2_28_aarch64.tgz
@@ -26,7 +22,7 @@ ffdf9ade5d7023921a175294248003ac95f4c4ee6babb5c3d7f9f7650146a96e python-3.11.1+
2622
42fba60f08fffc41e2a2eed0763eb8df57c7e79a56809d883c73efdc3dbba0e2 python-3.11.1+0-manylinux_2_28_aarch64.tgz
2723
be999ab895e67ebf7b199108090c0c09a0fad6cd9f1034dd9bd15ba61f8ef05f python-3.11.1+0-manylinux_2_28_x86_64.tgz
2824
"""
29-
VERSIONS = ("3.9.16+0", "3.10.9+0", "3.11.1+0")
25+
VERSIONS = ("3.10.9+0", "3.11.1+0")
3026
PLAT_TAG = {"linux": "manylinux", "darwin": "macosx"}
3127
PLAT_RE = re.compile(f"{PLAT_TAG[sys.platform]}_.+{platform.machine()}$")
3228

docker/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# This file is autogenerated by pip-compile with Python 3.9
2+
# This file is autogenerated by pip-compile with Python 3.10
33
# by the following command:
44
#
55
# pip-compile --allow-unsafe --no-annotate

tests/validate_test.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,30 +43,30 @@ def test_pythons_to_check_no_pythons_raises_error():
4343

4444
def test_pythons_to_check_py2_ignored():
4545
ret = validate._pythons_to_check(parse_tag("py2.py3-none-any"))
46-
assert ret == ("python3.10", "python3.11", "python3.9")
46+
assert ret == ("python3.10", "python3.11")
4747

4848

4949
def test_pythons_to_check_py3_gives_all():
5050
ret = validate._pythons_to_check(parse_tag("py3-none-any"))
51-
assert ret == ("python3.10", "python3.11", "python3.9")
51+
assert ret == ("python3.10", "python3.11")
5252

5353

5454
def test_pythons_to_check_abi3():
5555
tag = "cp37-abi3-manylinux1_x86_64"
5656
ret = validate._pythons_to_check(parse_tag(tag))
57-
assert ret == ("python3.10", "python3.11", "python3.9")
57+
assert ret == ("python3.10", "python3.11")
5858

5959

6060
def test_pythons_to_check_minimum_abi3():
61-
tag = "cp39-abi3-manylinux1_x86_64"
61+
tag = "cp311-abi3-manylinux1_x86_64"
6262
ret = validate._pythons_to_check(parse_tag(tag))
63-
assert ret == ("python3.10", "python3.11", "python3.9")
63+
assert ret == ("python3.11",)
6464

6565

6666
def test_pythons_to_check_specific_cpython_tag():
67-
tag = "cp39-cp39-manylinux1_aarch64.whl"
67+
tag = "cp311-cp311-manylinux1_aarch64.whl"
6868
ret = validate._pythons_to_check(parse_tag(tag))
69-
assert ret == ("python3.9",)
69+
assert ret == ("python3.11",)
7070

7171

7272
def test_top_imports_record(tmp_path):

validate.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
from packaging.utils import parse_wheel_filename
1616
from packaging.version import Version
1717

18-
PYTHONS = ((3, 9), (3, 10), (3, 11))
18+
PYTHONS = ((3, 10), (3, 11))
1919
DIST_INFO_RE = re.compile(r"^[^/]+.dist-info/[^/]+$")
2020

2121

0 commit comments

Comments
 (0)