Skip to content

Commit 78ffda7

Browse files
pmeiermalfet
andauthored
drop support for Python 3.7 (pytorch#7110)
Co-authored-by: Nikita Shulga <nshulga@fb.com>
1 parent 71073cb commit 78ffda7

18 files changed

+73
-336
lines changed

.circleci/config.yml

+39-293
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.circleci/config.yml.in

+12-12
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ version: 2.1
22

33
# How to test the Linux jobs:
44
# - Install CircleCI local CLI: https://circleci.com/docs/2.0/local-cli/
5-
# - circleci config process .circleci/config.yml > gen.yml && circleci local execute -c gen.yml --job binary_linux_wheel_py3.7
6-
# - Replace binary_linux_wheel_py3.7 with the name of the job you want to test.
5+
# - circleci config process .circleci/config.yml > gen.yml && circleci local execute -c gen.yml --job binary_linux_wheel_py3.8
6+
# - Replace binary_linux_wheel_py3.8 with the name of the job you want to test.
77
# Job names are 'name:' key.
88

99
executors:
@@ -201,7 +201,7 @@ binary_common: &binary_common
201201
default: ""
202202
# Don't edit these
203203
python_version:
204-
description: "Python version to build against (e.g., 3.7)"
204+
description: "Python version to build against (e.g., 3.8)"
205205
type: string
206206
cu_version:
207207
description: "CUDA version to build against, in CU format (e.g., cpu or cu100)"
@@ -258,7 +258,7 @@ smoke_test_common: &smoke_test_common
258258
jobs:
259259
circleci_consistency:
260260
docker:
261-
- image: cimg/python:3.7
261+
- image: cimg/python:3.8
262262
steps:
263263
- checkout
264264
- pip_install:
@@ -271,7 +271,7 @@ jobs:
271271

272272
lint_python_and_config:
273273
docker:
274-
- image: cimg/python:3.7
274+
- image: cimg/python:3.8
275275
steps:
276276
- checkout
277277
- pip_install:
@@ -290,7 +290,7 @@ jobs:
290290

291291
lint_c:
292292
docker:
293-
- image: cimg/python:3.7
293+
- image: cimg/python:3.8
294294
steps:
295295
- apt_install:
296296
args: libtinfo5
@@ -312,7 +312,7 @@ jobs:
312312

313313
type_check_python:
314314
docker:
315-
- image: cimg/python:3.7
315+
- image: cimg/python:3.8
316316
steps:
317317
- checkout
318318
- install_torchvision:
@@ -326,7 +326,7 @@ jobs:
326326

327327
unittest_torchhub:
328328
docker:
329-
- image: cimg/python:3.7
329+
- image: cimg/python:3.8
330330
steps:
331331
- checkout
332332
- install_torchvision
@@ -335,7 +335,7 @@ jobs:
335335

336336
unittest_onnx:
337337
docker:
338-
- image: cimg/python:3.7
338+
- image: cimg/python:3.8
339339
steps:
340340
- checkout
341341
- install_torchvision
@@ -347,7 +347,7 @@ jobs:
347347

348348
unittest_extended:
349349
docker:
350-
- image: cimg/python:3.7
350+
- image: cimg/python:3.8
351351
resource_class: xlarge
352352
steps:
353353
- checkout
@@ -594,7 +594,7 @@ jobs:
594594
description: "What whl subfolder to upload to, e.g., blank or cu100/ (trailing slash is important)"
595595
type: string
596596
docker:
597-
- image: cimg/python:3.7
597+
- image: cimg/python:3.8
598598
steps:
599599
- attach_workspace:
600600
at: ~/workspace
@@ -1017,7 +1017,7 @@ jobs:
10171017
build_docs:
10181018
<<: *binary_common
10191019
docker:
1020-
- image: cimg/python:3.7
1020+
- image: cimg/python:3.8
10211021
resource_class: 2xlarge+
10221022
steps:
10231023
- attach_workspace:

.circleci/regenerate.py

+8-8
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
from jinja2 import select_autoescape
2222

2323

24-
PYTHON_VERSIONS = ["3.7", "3.8", "3.9", "3.10"]
24+
PYTHON_VERSIONS = ["3.8", "3.9", "3.10"]
2525

2626
RC_PATTERN = r"/v[0-9]+(\.[0-9]+)*-rc[0-9]+/"
2727

@@ -55,16 +55,16 @@ def build_workflows(prefix="", filter_branch=None, upload=False, indentation=6,
5555
):
5656
fb = "main"
5757
if not fb and (
58-
os_type == "linux" and cu_version == "cpu" and btype == "wheel" and python_version == "3.7"
58+
os_type == "linux" and cu_version == "cpu" and btype == "wheel" and python_version == "3.8"
5959
):
6060
# the fields must match the build_docs "requires" dependency
6161
fb = "/.*/"
6262

6363
# Disable all Linux Wheels Workflows from CircleCI
6464
# since those will now be done through Nova. We'll keep
65-
# around the py3.7 Linux Wheels build since the docs
65+
# around the py3.8 Linux Wheels build since the docs
6666
# job depends on it.
67-
if os_type == "linux" and btype == "wheel" and python_version != "3.7":
67+
if os_type == "linux" and btype == "wheel" and python_version != "3.8":
6868
continue
6969

7070
# Disable all Macos Wheels Workflows from CircleCI.
@@ -98,7 +98,7 @@ def workflow_pair(btype, os_type, python_version, cu_version, unicode, prefix=""
9898
)
9999
)
100100

101-
# For the remaining py3.7 Linux Wheels job left around for the docs build,
101+
# For the remaining py3.8 Linux Wheels job left around for the docs build,
102102
# we'll disable uploads.
103103
if os_type == "linux" and btype == "wheel":
104104
upload = False
@@ -116,9 +116,9 @@ def workflow_pair(btype, os_type, python_version, cu_version, unicode, prefix=""
116116
def build_doc_job(filter_branch):
117117
job = {
118118
"name": "build_docs",
119-
"python_version": "3.7",
119+
"python_version": "3.8",
120120
"requires": [
121-
"binary_linux_wheel_py3.7_cpu",
121+
"binary_linux_wheel_py3.8_cpu",
122122
],
123123
}
124124

@@ -131,7 +131,7 @@ def upload_doc_job(filter_branch):
131131
job = {
132132
"name": "upload_docs",
133133
"context": "org-member",
134-
"python_version": "3.7",
134+
"python_version": "3.8",
135135
"requires": [
136136
"build_docs",
137137
],

.circleci/unittest/ios/scripts/binary_ios_build.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export PATH="~/anaconda/bin:${PATH}"
1616
source ~/anaconda/bin/activate
1717

1818
# install dependencies
19-
conda install numpy ninja pyyaml mkl mkl-include setuptools cmake cffi requests typing_extensions wget --yes
19+
conda install numpy ninja pyyaml mkl mkl-include setuptools cmake cffi requests wget --yes
2020
conda install -c conda-forge valgrind --yes
2121
export CMAKE_PREFIX_PATH=${CONDA_PREFIX:-"$(dirname $(which conda))/../"}
2222

.github/workflows/prototype-tests-linux-gpu.yml

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ jobs:
88
strategy:
99
matrix:
1010
python-version:
11-
- "3.7"
1211
- "3.8"
1312
- "3.9"
1413
- "3.10"

.github/workflows/test-linux-cpu.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
tests:
1717
strategy:
1818
matrix:
19-
python_version: ["3.7", "3.8", "3.9", "3.10"]
19+
python_version: ["3.8", "3.9", "3.10"]
2020
fail-fast: false
2121
uses: pytorch/test-infra/.github/workflows/linux_job.yml@main
2222
with:

.github/workflows/tests-schedule.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
- name: Set up python
1919
uses: actions/setup-python@v2
2020
with:
21-
python-version: 3.7
21+
python-version: 3.8
2222

2323
- name: Upgrade system packages
2424
run: python -m pip install --upgrade pip setuptools wheel

README.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ supported Python versions.
2121
+--------------------------+--------------------------+---------------------------------+
2222
| ``torch`` | ``torchvision`` | ``python`` |
2323
+==========================+==========================+=================================+
24-
| ``main`` / ``nightly`` | ``main`` / ``nightly`` | ``>=3.7.2``, ``<=3.10`` |
24+
| ``main`` / ``nightly`` | ``main`` / ``nightly`` | ``>=3.8``, ``<=3.10`` |
2525
+--------------------------+--------------------------+---------------------------------+
2626
| ``1.13.0`` | ``0.14.0`` | ``>=3.7.2``, ``<=3.10`` |
2727
+--------------------------+--------------------------+---------------------------------+

packaging/pkg_helpers.bash

+1-2
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ retry () {
150150
}
151151

152152
# Inputs:
153-
# PYTHON_VERSION (3.7, 3.8, 3.9)
153+
# PYTHON_VERSION (3.8, 3.9, 3.10)
154154
# UNICODE_ABI (bool)
155155
#
156156
# Outputs:
@@ -169,7 +169,6 @@ setup_wheel_python() {
169169
# Install native CentOS libJPEG, freetype and GnuTLS
170170
yum install -y libjpeg-turbo-devel freetype gnutls
171171
case "$PYTHON_VERSION" in
172-
3.7) python_abi=cp37-cp37m ;;
173172
3.8) python_abi=cp38-cp38 ;;
174173
3.9) python_abi=cp39-cp39 ;;
175174
3.10) python_abi=cp310-cp310 ;;

packaging/torchvision/conda_build_config.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ c_compiler:
77
cxx_compiler:
88
- vs2017 # [win]
99
python:
10-
- 3.7
10+
- 3.8
1111
# This differs from target_platform in that it determines what subdir the compiler
1212
# will target, not what subdir the compiler package will be itself.
1313
# For example, we need a win-64 vs2008_win-32 package, so that we compile win-32

packaging/vs2017/conda_build_config.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ c_compiler:
55
cxx_compiler:
66
- vs2017 # [win]
77
python:
8-
- 3.7
8+
- 3.8
99
# This differs from target_platform in that it determines what subdir the compiler
1010
# will target, not what subdir the compiler package will be itself.
1111
# For example, we need a win-64 vs2008_win-32 package, so that we compile win-32

packaging/vs2019/conda_build_config.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ c_compiler:
55
cxx_compiler:
66
- vs2019 # [win]
77
python:
8-
- 3.7
8+
- 3.8
99
# This differs from target_platform in that it determines what subdir the compiler
1010
# will target, not what subdir the compiler package will be itself.
1111
# For example, we need a win-64 vs2008_win-32 package, so that we compile win-32

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ first_party_detection = false
55
[tool.black]
66

77
line-length = 120
8-
target-version = ["py37"]
8+
target-version = ["py38"]
99

1010
[tool.ufmt]
1111

setup.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ def write_version_file():
5858
pytorch_dep += "==" + os.getenv("PYTORCH_VERSION")
5959

6060
requirements = [
61-
"typing_extensions",
6261
"numpy",
6362
"requests",
6463
pytorch_dep,
@@ -546,7 +545,7 @@ def run(self):
546545
"scipy": ["scipy"],
547546
},
548547
ext_modules=get_extensions(),
549-
python_requires=">=3.7.2",
548+
python_requires=">=3.8",
550549
cmdclass={
551550
"build_ext": BuildExtension.with_options(no_python_abi_suffix=True),
552551
"clean": clean,

torchvision/prototype/datasets/utils/_resource.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import hashlib
33
import itertools
44
import pathlib
5-
from typing import Any, Callable, IO, NoReturn, Optional, Sequence, Set, Tuple, Union
5+
from typing import Any, Callable, IO, Literal, NoReturn, Optional, Sequence, Set, Tuple, Union
66
from urllib.parse import urlparse
77

88
from torchdata.datapipes.iter import (
@@ -23,7 +23,6 @@
2323
download_url,
2424
extract_archive,
2525
)
26-
from typing_extensions import Literal
2726

2827

2928
class OnlineResource(abc.ABC):

torchvision/prototype/transforms/_geometry.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import math
22
import numbers
33
import warnings
4-
from typing import Any, cast, Dict, List, Optional, Sequence, Tuple, Type, Union
4+
from typing import Any, cast, Dict, List, Literal, Optional, Sequence, Tuple, Type, Union
55

66
import PIL.Image
77
import torch
@@ -11,8 +11,6 @@
1111
from torchvision.prototype.transforms import functional as F, InterpolationMode, Transform
1212
from torchvision.transforms.functional import _get_perspective_coeffs
1313

14-
from typing_extensions import Literal
15-
1614
from ._transform import _RandomApplyTransform
1715
from ._utils import (
1816
_check_padding_arg,

torchvision/prototype/transforms/_utils.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
import functools
22
import numbers
33
from collections import defaultdict
4-
from typing import Any, Dict, Sequence, Type, TypeVar, Union
4+
from typing import Any, Dict, Literal, Sequence, Type, TypeVar, Union
55

66
from torchvision.prototype import datapoints
77
from torchvision.prototype.datapoints._datapoint import FillType, FillTypeJIT
88

99
from torchvision.transforms.transforms import _check_sequence_input, _setup_angle, _setup_size # noqa: F401
1010

11-
from typing_extensions import Literal
12-
1311

1412
def _setup_float_or_seq(arg: Union[float, Sequence[float]], name: str, req_size: int = 2) -> Sequence[float]:
1513
if not isinstance(arg, (float, Sequence)):

torchvision/transforms/functional_pil.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
import numbers
2-
from typing import Any, Dict, List, Optional, Sequence, Tuple, Union
2+
from typing import Any, Dict, List, Literal, Optional, Sequence, Tuple, Union
33

44
import numpy as np
55
import torch
66
from PIL import Image, ImageEnhance, ImageOps
7-
from typing_extensions import Literal
87

98
try:
109
import accimage

0 commit comments

Comments
 (0)