Skip to content

Commit 6446896

Browse files
committed
deps(python): drop Python 3.7 support
1 parent f5b292c commit 6446896

File tree

14 files changed

+40
-39
lines changed

14 files changed

+40
-39
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.11" # 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
@@ -42,7 +42,7 @@ repos:
4242
rev: v3.3.1
4343
hooks:
4444
- id: pyupgrade
45-
args: [--py37-plus] # sync with requires-python
45+
args: [--py38-plus] # sync with requires-python
4646
stages: [commit, push, manual]
4747
exclude: |
4848
(?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
@@ -61,11 +61,7 @@ pre-commit-install:
6161

6262
docs-install:
6363
$(call check_pip_install_extra,pydocstyle,pydocstyle[toml])
64-
$(call check_pip_install_extra,doc8,"doc8<1.0.0a0")
65-
if ! $(PYTHON) -c "import sys; exit(sys.version_info < (3, 8))"; then \
66-
$(PYTHON) -m pip uninstall --yes importlib-metadata; \
67-
$(call check_pip_install_extra,importlib-metadata,"importlib-metadata<5.0.0a0"); \
68-
fi
64+
$(call check_pip_install,doc8)
6965
$(call check_pip_install,sphinx)
7066
$(call check_pip_install,sphinx-rtd-theme)
7167
$(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/gh/metaopt/torchopt)</a>

conda-recipe.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ dependencies:
9090
- mypy >= 0.990
9191
- flake8
9292
- flake8-bugbear
93-
- doc8 < 1.0.0a0
93+
- doc8
9494
- pydocstyle
9595
- clang-format >= 14
9696
- clang-tools >= 14 # clang-tidy

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",
@@ -74,7 +73,7 @@ lint = [
7473
"mypy >= 0.990",
7574
"flake8",
7675
"flake8-bugbear",
77-
"doc8 < 1.0.0a0", # unpin this when we drop support for Python 3.7
76+
"doc8",
7877
"pydocstyle[toml]",
7978
"pyenchant",
8079
"cpplint",
@@ -170,7 +169,7 @@ safe = true
170169
line-length = 100
171170
skip-string-normalization = true
172171
# Sync with requires-python
173-
target-version = ["py37", "py38", "py39", "py310", "py311"]
172+
target-version = ["py38", "py39", "py310", "py311"]
174173

175174
[tool.isort]
176175
atomic = true
@@ -184,7 +183,7 @@ multi_line_output = 3
184183

185184
[tool.mypy]
186185
# Sync with requires-python
187-
python_version = 3.7
186+
python_version = 3.8
188187
pretty = true
189188
show_error_codes = true
190189
show_error_context = true

tests/requirements.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ pylint[spelling] >= 2.15.0
1616
mypy >= 0.990
1717
flake8
1818
flake8-bugbear
19-
# https://github.com/PyCQA/doc8/issues/112
20-
doc8 < 1.0.0a0
19+
doc8
2120
pydocstyle[toml]
2221
pyenchant
2322
cpplint

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