Skip to content

Commit 8ff43d4

Browse files
authored
switch to lightning_utilities.cli requirements set-oldest (#21077)
1 parent 2c74bee commit 8ff43d4

File tree

7 files changed

+20
-20
lines changed

7 files changed

+20
-20
lines changed

.actions/assistant.py

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -368,20 +368,6 @@ def _prune_packages(req_file: str, packages: Sequence[str]) -> None:
368368
print(final)
369369
path.write_text("\n".join(final) + "\n")
370370

371-
@staticmethod
372-
def _replace_min(fname: str) -> None:
373-
with open(fname, encoding="utf-8") as fopen:
374-
req = fopen.read().replace(">=", "==")
375-
with open(fname, "w", encoding="utf-8") as fwrite:
376-
fwrite.write(req)
377-
378-
@staticmethod
379-
def replace_oldest_ver(requirement_fnames: Sequence[str] = REQUIREMENT_FILES_ALL) -> None:
380-
"""Replace the min package version by fixed one."""
381-
for fname in requirement_fnames:
382-
print(fname)
383-
AssistantCLI._replace_min(fname)
384-
385371
@staticmethod
386372
def copy_replace_imports(
387373
source_dir: str,

.azure/gpu-tests-fabric.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,9 @@ jobs:
9999
displayName: "Image info & NVIDIA"
100100
101101
- bash: |
102-
python .actions/assistant.py replace_oldest_ver
102+
cd requirements/fabric
103+
pip install -U "lightning-utilities[cli]"
104+
python -m lightning_utilities.cli requirements set-oldest --req_files "['base.txt', 'strategies.txt']"
103105
pip install "cython<3.0" wheel # for compatibility
104106
condition: contains(variables['Agent.JobName'], 'oldest')
105107
displayName: "setting oldest dependencies"

.azure/gpu-tests-pytorch.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,9 @@ jobs:
103103
displayName: "Image info & NVIDIA"
104104
105105
- bash: |
106-
python .actions/assistant.py replace_oldest_ver
106+
cd requirements/pytorch
107+
pip install -U "lightning-utilities[cli]"
108+
python -m lightning_utilities.cli requirements set-oldest --req_files "['base.txt', 'extra.txt', 'strategies.txt', 'examples.txt']"
107109
pip install "cython<3.0" wheel # for compatibility
108110
condition: contains(variables['Agent.JobName'], 'oldest')
109111
displayName: "setting oldest dependencies"

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,9 @@ jobs:
9494
- name: Set min. dependencies
9595
if: ${{ matrix.requires == 'oldest' }}
9696
run: |
97-
python .actions/assistant.py replace_oldest_ver
97+
cd requirements/fabric
98+
pip install -U "lightning-utilities[cli]"
99+
python -m lightning_utilities.cli requirements set-oldest --req_files "['base.txt', 'strategies.txt']"
98100
pip install "cython<3.0" wheel
99101
pip install "pyyaml==5.4" --no-build-isolation
100102

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,9 @@ jobs:
9999
- name: Set min. dependencies
100100
if: ${{ matrix.requires == 'oldest' }}
101101
run: |
102-
python .actions/assistant.py replace_oldest_ver
102+
cd requirements/pytorch
103+
pip install -U "lightning-utilities[cli]"
104+
python -m lightning_utilities.cli requirements set-oldest --req_files "['base.txt', 'extra.txt', 'strategies.txt', 'examples.txt']"
103105
pip install "cython<3.0" wheel
104106
pip install "pyyaml==5.4" --no-build-isolation
105107

.lightning/workflows/fabric.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,10 @@ run: |
4343
4444
if [ "${TORCH_VER}" == "2.1" ]; then
4545
echo "Set oldest versions"
46-
python .actions/assistant.py replace_oldest_ver
46+
cd requirements/fabric
47+
pip install -U "lightning-utilities[cli]"
48+
python -m lightning_utilities.cli requirements set-oldest --req_files "['base.txt', 'strategies.txt']"
49+
cd ../..
4750
pip install "cython<3.0" wheel # for compatibility
4851
fi
4952

.lightning/workflows/pytorch.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,10 @@ run: |
4343
4444
if [ "${TORCH_VER}" == "2.1" ]; then
4545
recho "Set oldest versions"
46-
python .actions/assistant.py replace_oldest_ver
46+
cd requirements/pytorch
47+
pip install -U "lightning-utilities[cli]"
48+
python -m lightning_utilities.cli requirements set-oldest --req_files "['base.txt', 'extra.txt', 'strategies.txt', 'examples.txt']"
49+
cd ../..
4750
pip install "cython<3.0" wheel # for compatibility
4851
fi
4952

0 commit comments

Comments
 (0)