Skip to content

Commit 82f53d1

Browse files
committed
deps(python): drop Python 3.7 support
1 parent 14962cf commit 82f53d1

File tree

13 files changed

+39
-38
lines changed

13 files changed

+39
-38
lines changed

.github/workflows/build.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ jobs:
5656
- name: Set up Python
5757
uses: actions/setup-python@v4
5858
with:
59-
python-version: "3.7 - 3.10" # sync with requires-python in pyproject.toml
59+
python-version: "3.8 - 3.10" # sync with requires-python in pyproject.toml
6060
update-environment: true
6161

6262
- name: Set __release__
@@ -96,14 +96,14 @@ jobs:
9696
run: |
9797
make pytest
9898
99-
build-wheels-py37:
99+
build-wheels-py38:
100100
name: Build wheels for Python ${{ matrix.python-version }} on ubuntu-latest
101101
runs-on: ubuntu-latest
102102
needs: [build]
103103
if: github.repository == 'metaopt/torchopt' && (github.event_name != 'push' || startsWith(github.ref, 'refs/tags/'))
104104
strategy:
105105
matrix:
106-
python-version: ["3.7"] # sync with requires-python in pyproject.toml
106+
python-version: ["3.8"] # sync with requires-python in pyproject.toml
107107
fail-fast: false
108108
timeout-minutes: 60
109109
steps:
@@ -142,18 +142,18 @@ jobs:
142142

143143
- uses: actions/upload-artifact@v3
144144
with:
145-
name: wheels-py37
145+
name: wheels-py38
146146
path: wheelhouse/*.whl
147147
if-no-files-found: error
148148

149149
build-wheels:
150150
name: Build wheels for Python ${{ matrix.python-version }} on ubuntu-latest
151151
runs-on: ubuntu-latest
152-
needs: [build, build-wheels-py37]
152+
needs: [build, build-wheels-py38]
153153
if: github.repository == 'metaopt/torchopt' && (github.event_name != 'push' || startsWith(github.ref, 'refs/tags/'))
154154
strategy:
155155
matrix:
156-
python-version: ["3.8", "3.9", "3.10"] # sync with requires-python in pyproject.toml
156+
python-version: ["3.9", "3.10"] # sync with requires-python in pyproject.toml
157157
fail-fast: false
158158
timeout-minutes: 60
159159
steps:
@@ -198,7 +198,7 @@ jobs:
198198

199199
publish:
200200
runs-on: ubuntu-latest
201-
needs: [build, build-wheels-py37, build-wheels]
201+
needs: [build, build-wheels-py38, build-wheels]
202202
if: |
203203
github.repository == 'metaopt/torchopt' && github.event_name != 'pull_request' &&
204204
(github.event_name != 'workflow_dispatch' || github.event.inputs.task == 'build-and-publish') &&
@@ -215,7 +215,7 @@ jobs:
215215
uses: actions/setup-python@v4
216216
if: startsWith(github.ref, 'refs/tags/')
217217
with:
218-
python-version: "3.7 - 3.11" # sync with requires-python in pyproject.toml
218+
python-version: "3.8 - 3.11" # sync with requires-python in pyproject.toml
219219
update-environment: true
220220

221221
- name: Set __release__
@@ -249,7 +249,7 @@ jobs:
249249
with:
250250
# unpacks default artifact into dist/
251251
# if `name: artifact` is omitted, the action will create extra parent dir
252-
name: wheels-py37
252+
name: wheels-py38
253253
path: dist
254254

255255
- name: Download built wheels

.github/workflows/tests.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,10 @@ jobs:
4141
submodules: "recursive"
4242
fetch-depth: 1
4343

44-
- name: Set up Python 3.7
44+
- name: Set up Python 3.8
4545
uses: actions/setup-python@v4
4646
with:
47-
python-version: "3.7" # the lowest version we support (sync with requires-python in pyproject.toml)
47+
python-version: "3.8" # the lowest version we support (sync with requires-python in pyproject.toml)
4848
update-environment: true
4949

5050
- name: Setup CUDA Toolkit
@@ -111,10 +111,10 @@ jobs:
111111
submodules: "recursive"
112112
fetch-depth: 1
113113

114-
- name: Set up Python 3.7
114+
- name: Set up Python 3.8
115115
uses: actions/setup-python@v4
116116
with:
117-
python-version: "3.7" # the lowest version we support (sync with requires-python in pyproject.toml)
117+
python-version: "3.8" # the lowest version we support (sync with requires-python in pyproject.toml)
118118
update-environment: true
119119

120120
- name: Upgrade pip

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ repos:
4848
rev: v3.3.1
4949
hooks:
5050
- id: pyupgrade
51-
args: [--py37-plus] # sync with requires-python
51+
args: [--py38-plus] # sync with requires-python
5252
stages: [commit, push, manual]
5353
exclude: |
5454
(?x)(

.pylintrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ persistent=yes
8484

8585
# Minimum Python version to use for version dependent checks. Will default to
8686
# the version used to run pylint.
87-
py-version=3.7 # the lowest version we support (sync with requires-python in pyproject.toml)
87+
py-version=3.8 # the lowest version we support (sync with requires-python in pyproject.toml)
8888

8989
# Discover python modules and packages in the file system subtree.
9090
recursive=no

Makefile

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,7 @@ pre-commit-install:
6868

6969
docs-install:
7070
$(call check_pip_install_extra,pydocstyle,pydocstyle[toml])
71-
$(call check_pip_install_extra,doc8,"doc8<1.0.0a0")
72-
if ! $(PYTHON) -c "import sys; exit(sys.version_info < (3, 8))"; then \
73-
$(PYTHON) -m pip uninstall --yes importlib-metadata; \
74-
$(call check_pip_install_extra,importlib-metadata,"importlib-metadata<5.0.0a0"); \
75-
fi
71+
$(call check_pip_install,doc8)
7672
$(call check_pip_install,sphinx)
7773
$(call check_pip_install,sphinx-rtd-theme)
7874
$(call check_pip_install,sphinx-autoapi)

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
<div align="center">
1010

11-
<a>![Python 3.7+](https://img.shields.io/badge/Python-3.7%2B-brightgreen.svg)</a>
11+
<a>![Python 3.8+](https://img.shields.io/badge/Python-3.8%2B-brightgreen.svg)</a>
1212
<a href="https://pypi.org/project/torchopt">![PyPI](https://img.shields.io/pypi/v/torchopt?logo=pypi)</a>
1313
<a href="https://github.com/metaopt/torchopt/tree/HEAD/tests">![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/metaopt/torchopt/tests.yml?label=tests&logo=github)</a>
1414
<a href="https://codecov.io/gh/metaopt/torchopt">![CodeCov](https://img.shields.io/codecov/c/github/metaopt/torchopt/main?logo=codecov)</a>

docs/source/developer/contributing.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,9 @@ For example, the following command will build a wheel for Python 3.7:
102102

103103
.. code-block:: bash
104104
105-
CIBW_BUILD="cp37*manylinux*" python3 -m cibuildwheel --platform=linux --output-dir=wheelhouse --config-file=pyproject.toml
105+
CIBW_BUILD="cp38*manylinux*" python3 -m cibuildwheel --platform=linux --output-dir=wheelhouse --config-file=pyproject.toml
106106
107-
You can change ``cp37*`` to ``cp310*`` to build for Python 3.10. See https://cibuildwheel.readthedocs.io/en/stable/options for more options.
107+
You can change ``cp38*`` to ``cp310*`` to build for Python 3.10. See https://cibuildwheel.readthedocs.io/en/stable/options for more options.
108108

109109
.. |cibuildwheel| replace:: ``cibuildwheel``
110110
.. _cibuildwheel: https://github.com/pypa/cibuildwheel

pyproject.toml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ description = "An efficient library for differentiable optimization for PyTorch.
1111
readme = "README.md"
1212
# Change this if wheels for `torch` is available
1313
# Search "requires-python" and update all corresponding items
14-
requires-python = ">= 3.7"
14+
requires-python = ">= 3.8"
1515
authors = [
1616
{ name = "TorchOpt Contributors" },
1717
{ name = "Jie Ren", email = "jieren9806@gmail.com" },
@@ -34,7 +34,6 @@ classifiers = [
3434
"License :: OSI Approved :: Apache Software License",
3535
# Sync with requires-python
3636
"Programming Language :: Python :: 3",
37-
"Programming Language :: Python :: 3.7",
3837
"Programming Language :: Python :: 3.8",
3938
"Programming Language :: Python :: 3.9",
4039
"Programming Language :: Python :: 3.10",
@@ -79,7 +78,7 @@ lint = [
7978
"flake8-pyi",
8079
"flake8-simplify",
8180
"ruff",
82-
"doc8 < 1.0.0a0", # unpin this when we drop support for Python 3.7
81+
"doc8",
8382
"pydocstyle[toml]",
8483
"pyenchant",
8584
"cpplint",
@@ -175,7 +174,7 @@ safe = true
175174
line-length = 100
176175
skip-string-normalization = true
177176
# Sync with requires-python
178-
target-version = ["py37", "py38", "py39", "py310", "py311"]
177+
target-version = ["py38", "py39", "py310", "py311"]
179178

180179
[tool.isort]
181180
atomic = true
@@ -189,7 +188,7 @@ multi_line_output = 3
189188

190189
[tool.mypy]
191190
# Sync with requires-python
192-
python_version = 3.7
191+
python_version = 3.8
193192
pretty = true
194193
show_error_codes = true
195194
show_error_context = true

tests/requirements.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ flake8-docstrings
2121
flake8-pyi
2222
flake8-simplify
2323
ruff
24-
# https://github.com/PyCQA/doc8/issues/112
25-
doc8 < 1.0.0a0
24+
doc8
2625
pydocstyle[toml]
2726
pyenchant
2827
cpplint

torchopt/base.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,7 @@
3535

3636
import itertools
3737
from abc import abstractmethod
38-
from typing import TYPE_CHECKING, Callable, NamedTuple
39-
from typing_extensions import Protocol # Python 3.8+
38+
from typing import TYPE_CHECKING, Callable, NamedTuple, Protocol
4039

4140

4241
if TYPE_CHECKING: # pragma: no cover

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy