Skip to content

Commit b019974

Browse files
committed
docs: add notes for python version requirements
1 parent 9fa0e4e commit b019974

File tree

10 files changed

+23
-14
lines changed

10 files changed

+23
-14
lines changed

.github/workflows/build.yml

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

6161
- name: Set __release__
@@ -95,7 +95,7 @@ jobs:
9595
id: py
9696
uses: actions/setup-python@v4
9797
with:
98-
python-version: "3.7 - 3.10"
98+
python-version: "3.7 - 3.10" # sync with requires-python in pyproject.toml
9999
update-environment: true
100100

101101
- name: Set __release__
@@ -107,7 +107,7 @@ jobs:
107107
run: python setup.py --version
108108

109109
- name: Build wheels
110-
uses: pypa/cibuildwheel@v2.10.0
110+
uses: pypa/cibuildwheel@v2.10.1
111111
with:
112112
package-dir: .
113113
output-dir: wheelhouse
@@ -138,7 +138,7 @@ jobs:
138138
uses: actions/setup-python@v4
139139
if: startsWith(github.ref, 'refs/tags/')
140140
with:
141-
python-version: "3.7 - 3.10"
141+
python-version: "3.7 - 3.10" # sync with requires-python in pyproject.toml
142142
update-environment: true
143143

144144
- name: Check consistency between the package version and release tag

.github/workflows/lint.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ jobs:
2626
submodules: "recursive"
2727
fetch-depth: 1
2828

29-
- name: Set up Python 3.7 # the lowest version we support
29+
- name: Set up Python 3.7
3030
uses: actions/setup-python@v4
3131
with:
32-
python-version: "3.7"
32+
python-version: "3.7" # the lowest version we support (sync with requires-python in pyproject.toml)
3333
update-environment: true
3434

3535
- name: Setup CUDA Toolkit

.github/workflows/tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ jobs:
3737
submodules: "recursive"
3838
fetch-depth: 1
3939

40-
- name: Set up Python 3.7 # the lowest version we support
40+
- name: Set up Python 3.7
4141
uses: actions/setup-python@v4
4242
with:
43-
python-version: "3.7"
43+
python-version: "3.7" # the lowest version we support (sync with requires-python in pyproject.toml)
4444
update-environment: true
4545

4646
- name: Setup CUDA Toolkit

.pylintrc

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

5454
# Minimum Python version to use for version dependent checks. Will default to
5555
# the version used to run pylint.
56-
py-version=3.7
56+
py-version=3.7 # the lowest version we support (sync with requires-python in pyproject.toml)
5757

5858
# Discover python modules and packages in the file system subtree.
5959
recursive=no

conda-recipe.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ dependencies:
1717
- pip
1818

1919
# Learning
20-
- pytorch::pytorch >= 1.12
20+
- pytorch::pytorch >= 1.12 # sync with project.dependencies
2121
- pytorch::torchvision
2222
- pytorch::pytorch-mutex = *=*cuda*
2323
- pip:
24-
- functorch >= 0.2
24+
- functorch >= 0.2 # sync with project.dependencies
2525
- torchviz
2626
- sphinxcontrib-katex # for documentation
2727
- jax # for tutorials

docs/conda-recipe.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ dependencies:
3030
- pip
3131

3232
# Learning
33-
- pytorch::pytorch >= 1.12
33+
- pytorch::pytorch >= 1.12 # sync with project.dependencies
3434
- pytorch::pytorch-mutex = *=*cpu*
3535
- pip:
36-
- functorch >= 0.2
36+
- functorch >= 0.2 # sync with project.dependencies
3737
- torchviz
3838
- sphinxcontrib-katex # for documentation
3939
- tensorboard

docs/requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
--extra-index-url https://download.pytorch.org/whl/cpu
2+
# Sync with project.dependencies
23
torch >= 1.12
34
functorch >= 0.2
45

pyproject.toml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
# Package ######################################################################
22

33
[build-system]
4+
# Sync with project.dependencies
45
requires = ["setuptools", "torch >= 1.12", "numpy", "pybind11"]
56
build-backend = "setuptools.build_meta"
67

78
[project]
89
name = "torchopt"
910
description = "A Jax-style optimizer for PyTorch."
1011
readme = "README.md"
12+
# Change this if wheels for `torch` is available
13+
# Search "requires-python" and update all corresponding items
1114
requires-python = ">= 3.7, < 3.11.0a0"
1215
authors = [
1316
{ name = "TorchOpt Contributors" },
@@ -29,6 +32,7 @@ keywords = [
2932
classifiers = [
3033
"Development Status :: 4 - Beta",
3134
"License :: OSI Approved :: Apache Software License",
35+
# Sync with requires-python
3236
"Programming Language :: Python :: 3",
3337
"Programming Language :: Python :: 3.7",
3438
"Programming Language :: Python :: 3.8",
@@ -44,7 +48,7 @@ classifiers = [
4448
"Topic :: Scientific/Engineering :: Artificial Intelligence",
4549
]
4650
dependencies = [
47-
"torch >= 1.12",
51+
"torch >= 1.12", # see also build-system.requires and project.requires-python
4852
"functorch >= 0.2",
4953
"optree >= 0.2.0",
5054
"numpy",
@@ -163,6 +167,7 @@ repair-wheel-command = """
163167
safe = true
164168
line-length = 100
165169
skip-string-normalization = true
170+
# Sync with requires-python
166171
target-version = ["py37", "py38", "py39", "py310"]
167172

168173
[tool.isort]
@@ -174,6 +179,7 @@ lines_after_imports = 2
174179
multi_line_output = 3
175180

176181
[tool.mypy]
182+
# Sync with requires-python
177183
python_version = 3.7
178184
pretty = true
179185
show_error_codes = true

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# Sync with project.dependencies
12
torch >= 1.12
23
functorch >= 0.2
34
optree >= 0.2.0

tutorials/requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
--extra-index-url https://download.pytorch.org/whl/cu116
2+
# Sync with project.dependencies
23
torch >= 1.12
34
torchvision
45
functorch >= 0.2

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