Skip to content

Commit 61fa5c5

Browse files
authored
Merge branch 'Lightning-AI:master' into update-pyproject-py310
2 parents cdde7a2 + 2337948 commit 61fa5c5

File tree

11 files changed

+18
-19
lines changed

11 files changed

+18
-19
lines changed

.actions/assistant.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,14 @@
4646

4747

4848
class _RequirementWithComment(Requirement):
49-
strict_string = "# strict"
49+
strict_cmd = "strict"
5050

5151
def __init__(self, *args: Any, comment: str = "", pip_argument: str | None = None, **kwargs: Any) -> None:
5252
super().__init__(*args, **kwargs)
5353
self.comment = comment
5454
assert pip_argument is None or pip_argument # sanity check that it's not an empty str
5555
self.pip_argument = pip_argument
56-
self.strict = self.strict_string in comment.lower()
56+
self.strict = self.strict_cmd in comment.lower()
5757

5858
def adjust(self, unfreeze: str) -> str:
5959
"""Remove version restrictions unless they are strict.
@@ -62,25 +62,26 @@ def adjust(self, unfreeze: str) -> str:
6262
'arrow<=1.2.2,>=1.2.0'
6363
>>> _RequirementWithComment("arrow<=1.2.2,>=1.2.0", comment="# strict").adjust("none")
6464
'arrow<=1.2.2,>=1.2.0 # strict'
65-
>>> _RequirementWithComment("arrow<=1.2.2,>=1.2.0", comment="# my name").adjust("all")
66-
'arrow>=1.2.0'
65+
>>> _RequirementWithComment('arrow<=1.2.2,>=1.2.0; python_version >= "3.10"', comment="# my name").adjust("all")
66+
'arrow>=1.2.0; python_version >= "3.10"'
6767
>>> _RequirementWithComment("arrow>=1.2.0, <=1.2.2", comment="# strict").adjust("all")
6868
'arrow<=1.2.2,>=1.2.0 # strict'
69-
>>> _RequirementWithComment("arrow").adjust("all")
70-
'arrow'
69+
>>> _RequirementWithComment('arrow; python_version >= "3.10"').adjust("all")
70+
'arrow; python_version >= "3.10"'
7171
>>> _RequirementWithComment("arrow>=1.2.0, <=1.2.2", comment="# cool").adjust("major")
7272
'arrow<2.0,>=1.2.0'
7373
>>> _RequirementWithComment("arrow>=1.2.0, <=1.2.2", comment="# strict").adjust("major")
7474
'arrow<=1.2.2,>=1.2.0 # strict'
75-
>>> _RequirementWithComment("arrow>=1.2.0").adjust("major")
76-
'arrow>=1.2.0'
75+
>>> _RequirementWithComment('arrow>=1.2.0; python_version >= "3.10"').adjust("major")
76+
'arrow>=1.2.0; python_version >= "3.10"'
7777
>>> _RequirementWithComment("arrow").adjust("major")
7878
'arrow'
7979
8080
"""
8181
out = str(self)
8282
if self.strict:
83-
return f"{out} {self.strict_string}"
83+
return f"{out} # {self.strict_cmd}"
84+
8485
specs = [(spec.operator, spec.version) for spec in self.specifier]
8586
if unfreeze == "major":
8687
for operator, version in specs:

.github/workflows/_legacy-checkpoints.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ jobs:
6060
- name: Install uv and set Python version
6161
uses: astral-sh/setup-uv@v7
6262
with:
63-
python-version: "3.9"
63+
python-version: "3.10"
6464
# TODO: Avoid activating environment like this
6565
# see: https://github.com/astral-sh/setup-uv/tree/v6/?tab=readme-ov-file#activate-environment
6666
activate-environment: true

.github/workflows/ci-pkg-install.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444
matrix:
4545
os: ["ubuntu-22.04", "macOS-14", "windows-2022"]
4646
pkg-name: ["fabric", "pytorch", "lightning", "notset"]
47-
python-version: ["3.9", "3.11"]
47+
python-version: ["3.10", "3.11"]
4848
steps:
4949
- uses: actions/checkout@v5
5050
- uses: actions/setup-python@v6

.github/workflows/ci-tests-fabric.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ jobs:
7373
- name: Install uv and set Python version
7474
uses: astral-sh/setup-uv@v7
7575
with:
76-
python-version: ${{ matrix.config.python-version || '3.9' }}
76+
python-version: ${{ matrix.config.python-version || '3.10' }}
7777
# TODO: Avoid activating environment like this
7878
# see: https://github.com/astral-sh/setup-uv/tree/v6/?tab=readme-ov-file#activate-environment
7979
activate-environment: true

.github/workflows/ci-tests-pytorch.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ jobs:
7878
- name: Install uv and set Python version
7979
uses: astral-sh/setup-uv@v7
8080
with:
81-
python-version: ${{ matrix.config.python-version || '3.9' }}
81+
python-version: ${{ matrix.config.python-version || '3.10' }}
8282
# TODO: Avoid activating environment like this
8383
# see: https://github.com/astral-sh/setup-uv/tree/v6/?tab=readme-ov-file#activate-environment
8484
activate-environment: true

.github/workflows/release-nightly.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
- uses: actions/checkout@v5
2727
- uses: actions/setup-python@v6
2828
with:
29-
python-version: 3.9
29+
python-version: "3.10"
3030

3131
- name: Convert actual version to nightly
3232
run: |

.github/workflows/release-pkg.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ defaults:
2424
env:
2525
FREEZE_REQUIREMENTS: 1
2626
TORCH_URL: "https://download.pytorch.org/whl/cpu/"
27-
PYTHON_VER: "3.9"
27+
PYTHON_VER: "3.10"
2828

2929
jobs:
3030
build-packages:

.readthedocs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ sphinx:
3131
build:
3232
os: ubuntu-20.04
3333
tools:
34-
python: "3.9"
34+
python: "3.10"
3535
apt_packages:
3636
- texlive-latex-extra
3737
- dvipng

requirements/pytorch/test.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ numpy >1.20.0, <1.27.0
1414
onnx >1.12.0, <1.20.0
1515
onnxruntime >=1.12.0, <1.24.0
1616
onnxscript >= 0.1.0, < 0.6.0
17-
psutil <7.1.2 # for `DeviceStatsMonitor`
17+
psutil <7.2.0 # for `DeviceStatsMonitor`
1818
pandas >2.0, <2.4.0 # needed in benchmarks
1919
fastapi # for `ServableModuleValidator` # not setting version as re-defined in App
2020
uvicorn # for `ServableModuleValidator` # not setting version as re-defined in App

tests/legacy/generate_checkpoints.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ do
3636
source $ENV_PATH/bin/activate
3737

3838
uv pip install "pytorch_lightning==$pl_ver" \
39-
-r $LEGACY_FOLDER/requirements.txt \
4039
-r "$(dirname $TESTS_FOLDER)/requirements/pytorch/test.txt" \
4140
-f https://download.pytorch.org/whl/cpu/torch_stable.html
4241

@@ -52,7 +51,6 @@ if [[ -z "$@" ]]; then
5251
printf "\n\n processing local version\n"
5352

5453
uv pip install \
55-
-r $LEGACY_FOLDER/requirements.txt \
5654
-r "$(dirname $TESTS_FOLDER)/requirements/pytorch/test.txt" \
5755
-f https://download.pytorch.org/whl/cpu/torch_stable.html
5856
pl_ver="local"

0 commit comments

Comments
 (0)