Skip to content

Commit e96020f

Browse files
authored
Merge branch 'master' into master
2 parents 0a4cac5 + 60289d7 commit e96020f

File tree

276 files changed

+2726
-1531
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

276 files changed

+2726
-1531
lines changed

.actions/assistant.py

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,11 @@
1818
import shutil
1919
import tempfile
2020
import urllib.request
21+
from collections.abc import Iterable, Iterator, Sequence
2122
from itertools import chain
2223
from os.path import dirname, isfile
2324
from pathlib import Path
24-
from typing import Any, Dict, Iterable, Iterator, List, Optional, Sequence, Tuple
25+
from typing import Any, Optional
2526

2627
from packaging.requirements import Requirement
2728
from packaging.version import Version
@@ -127,7 +128,7 @@ def _parse_requirements(lines: Iterable[str]) -> Iterator[_RequirementWithCommen
127128
pip_argument = None
128129

129130

130-
def load_requirements(path_dir: str, file_name: str = "base.txt", unfreeze: str = "all") -> List[str]:
131+
def load_requirements(path_dir: str, file_name: str = "base.txt", unfreeze: str = "all") -> list[str]:
131132
"""Loading requirements from a file.
132133
133134
>>> path_req = os.path.join(_PROJECT_ROOT, "requirements")
@@ -222,7 +223,7 @@ def _load_aggregate_requirements(req_dir: str = "requirements", freeze_requireme
222223
fp.writelines([ln + os.linesep for ln in requires] + [os.linesep])
223224

224225

225-
def _retrieve_files(directory: str, *ext: str) -> List[str]:
226+
def _retrieve_files(directory: str, *ext: str) -> list[str]:
226227
all_files = []
227228
for root, _, files in os.walk(directory):
228229
for fname in files:
@@ -232,7 +233,7 @@ def _retrieve_files(directory: str, *ext: str) -> List[str]:
232233
return all_files
233234

234235

235-
def _replace_imports(lines: List[str], mapping: List[Tuple[str, str]], lightning_by: str = "") -> List[str]:
236+
def _replace_imports(lines: list[str], mapping: list[tuple[str, str]], lightning_by: str = "") -> list[str]:
236237
"""Replace imports of standalone package to lightning.
237238
238239
>>> lns = [
@@ -320,7 +321,7 @@ def copy_replace_imports(
320321
fo.writelines(lines)
321322

322323

323-
def create_mirror_package(source_dir: str, package_mapping: Dict[str, str]) -> None:
324+
def create_mirror_package(source_dir: str, package_mapping: dict[str, str]) -> None:
324325
"""Create a mirror package with adjusted imports."""
325326
# replace imports and copy the code
326327
mapping = package_mapping.copy()
@@ -482,6 +483,21 @@ def convert_version2nightly(ver_file: str = "src/version.info") -> None:
482483

483484

484485
if __name__ == "__main__":
486+
import sys
487+
485488
import jsonargparse
489+
from jsonargparse import ArgumentParser
490+
491+
def patch_jsonargparse_python_3_12_8():
492+
if sys.version_info < (3, 12, 8):
493+
return
494+
495+
def _parse_known_args_patch(self: ArgumentParser, args: Any = None, namespace: Any = None) -> tuple[Any, Any]:
496+
namespace, args = super(ArgumentParser, self)._parse_known_args(args, namespace, intermixed=False) # type: ignore
497+
return namespace, args
498+
499+
setattr(ArgumentParser, "_parse_known_args", _parse_known_args_patch)
500+
501+
patch_jsonargparse_python_3_12_8() # Required until fix https://github.com/omni-us/jsonargparse/issues/641
486502

487503
jsonargparse.CLI(AssistantCLI, as_positional=False)

.azure/gpu-benchmarks.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,9 @@ jobs:
7575
pip list
7676
displayName: "Image info & NVIDIA"
7777
78-
- bash: pip install -e .[dev] --find-links ${TORCH_URL}
78+
- bash: |
79+
pip install -e .[dev] --find-links ${TORCH_URL}
80+
pip install setuptools==75.6.0
7981
env:
8082
FREEZE_REQUIREMENTS: "1"
8183
displayName: "Install package"

.azure/gpu-tests-fabric.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ jobs:
107107
- bash: |
108108
extra=$(python -c "print({'lightning': 'fabric-'}.get('$(PACKAGE_NAME)', ''))")
109109
pip install -e ".[${extra}dev]" pytest-timeout -U --find-links="${TORCH_URL}" --find-links="${TORCHVISION_URL}"
110+
pip install setuptools==75.6.0
110111
displayName: "Install package & dependencies"
111112
112113
- bash: |
@@ -134,13 +135,13 @@ jobs:
134135
condition: and(succeeded(), eq(variables['PACKAGE_NAME'], 'fabric'))
135136
displayName: "Adjust tests & examples"
136137
137-
- bash: python -m coverage run --source ${COVERAGE_SOURCE} -m pytest . -v --durations=50
138-
workingDirectory: tests/tests_fabric/
138+
- bash: python -m coverage run --source ${COVERAGE_SOURCE} -m pytest tests_fabric/ -v --durations=50
139+
workingDirectory: tests/
139140
displayName: "Testing: fabric standard"
140141
timeoutInMinutes: "10"
141142

142-
- bash: bash ../run_standalone_tests.sh "."
143-
workingDirectory: tests/tests_fabric/
143+
- bash: bash ./run_standalone_tests.sh "tests_fabric"
144+
workingDirectory: tests/
144145
env:
145146
PL_STANDALONE_TESTS_SOURCE: $(COVERAGE_SOURCE)
146147
displayName: "Testing: fabric standalone"
@@ -157,7 +158,7 @@ jobs:
157158
./codecov --token=$(CODECOV_TOKEN) --commit=$(Build.SourceVersion) \
158159
--flags=gpu,pytest,${COVERAGE_SOURCE} --name="GPU-coverage" --env=linux,azure
159160
ls -l
160-
workingDirectory: tests/tests_fabric/
161+
workingDirectory: tests/
161162
displayName: "Statistics"
162163
163164
- script: |

.azure/gpu-tests-pytorch.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ jobs:
111111
- bash: |
112112
extra=$(python -c "print({'lightning': 'pytorch-'}.get('$(PACKAGE_NAME)', ''))")
113113
pip install -e ".[${extra}dev]" pytest-timeout -U --find-links="${TORCH_URL}" --find-links="${TORCHVISION_URL}"
114+
pip install setuptools==75.6.0
114115
displayName: "Install package & dependencies"
115116
116117
- bash: pip uninstall -y lightning
@@ -155,13 +156,13 @@ jobs:
155156
ls -l checkpoints/
156157
displayName: "Get legacy checkpoints"
157158
158-
- bash: python -m coverage run --source ${COVERAGE_SOURCE} -m pytest -v --durations=50
159-
workingDirectory: tests/tests_pytorch
159+
- bash: python -m coverage run --source ${COVERAGE_SOURCE} -m pytest tests_pytorch/ -v --durations=50
160+
workingDirectory: tests/
160161
displayName: "Testing: PyTorch standard"
161162
timeoutInMinutes: "35"
162163

163-
- bash: bash ../run_standalone_tests.sh "."
164-
workingDirectory: tests/tests_pytorch
164+
- bash: bash ./run_standalone_tests.sh "tests_pytorch"
165+
workingDirectory: tests/
165166
env:
166167
PL_USE_MOCKED_MNIST: "1"
167168
PL_STANDALONE_TESTS_SOURCE: $(COVERAGE_SOURCE)

.github/CODEOWNERS

Lines changed: 4 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -5,39 +5,16 @@
55
# the repo. Unless a later match takes precedence,
66
# @global-owner1 and @global-owner2 will be requested for
77
# review when someone opens a pull request.
8-
* @lantiga @borda @tchaton @awaelchli @justusschock
9-
10-
# CI/CD and configs
11-
/.actions/ @borda @ethanwharris @justusschock
12-
/.github/ @borda @ethanwharris @justusschock
13-
/.azure/ @borda @ethanwharris @justusschock
14-
/dockers/ @borda @ethanwharris @justusschock
15-
*.yml @borda @ethanwharris @justusschock
8+
* @lantiga @borda @tchaton @justusschock @ethanwharris
169

1710
# Docs
18-
/docs/ @lantiga @borda @awaelchli
19-
/docs/*/conf.py @borda @awaelchli
2011
/.github/*.md @williamfalcon @lantiga @borda
21-
/.github/ISSUE_TEMPLATE/ @borda @tchaton @awaelchli
22-
/docs/source-fabric/conf.py @borda @awaelchli
23-
/docs/source-fabric/index.rst @awaelchli @lantiga
24-
/docs/source-pytorch/conf.py @borda @awaelchli
12+
/docs/source-fabric/index.rst @williamfalcon @lantiga
2513
/docs/source-pytorch/index.rst @williamfalcon @lantiga
2614
/docs/source-pytorch/levels @williamfalcon @lantiga
2715

28-
# PyTorch Lightning
29-
/src/lightning/pytorch @lantiga @borda @tchaton @awaelchli @justusschock
30-
31-
# Lightning Data
32-
/src/lightning/data/ @tchaton @lantiga
33-
34-
# Lightning Fabric
35-
/src/lightning/fabric @lantiga @borda @tchaton @awaelchli @justusschock
36-
3716
/.github/CODEOWNERS @williamfalcon
3817
/SECURITY.md @williamfalcon @lantiga
3918
/README.md @williamfalcon @lantiga
40-
/setup.py @williamfalcon @borda
41-
/src/pytorch_lightning/__about__.py @williamfalcon @borda
42-
/src/lightning_fabric/__about__.py @williamfalcon @borda @awaelchli
43-
/src/*/__setup__.py @borda @justusschock
19+
/src/pytorch_lightning/__about__.py @williamfalcon @lantiga @borda
20+
/src/lightning_fabric/__about__.py @williamfalcon @lantiga @borda

.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
- uses: actions/setup-python@v5
6161
with:
6262
# Python version here needs to be supported by all PL versions listed in back-compatible-versions.txt.
63-
python-version: 3.8
63+
python-version: "3.9"
6464

6565
- name: Install PL from source
6666
env:

.github/workflows/call-clear-cache.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ on:
2323
jobs:
2424
cron-clear:
2525
if: github.event_name == 'schedule' || github.event_name == 'pull_request'
26-
uses: Lightning-AI/utilities/.github/workflows/[email protected].8
26+
uses: Lightning-AI/utilities/.github/workflows/[email protected].9
2727
with:
2828
scripts-ref: v0.11.8
2929
dry-run: ${{ github.event_name == 'pull_request' }}
@@ -32,7 +32,7 @@ jobs:
3232

3333
direct-clear:
3434
if: github.event_name == 'workflow_dispatch' || github.event_name == 'pull_request'
35-
uses: Lightning-AI/utilities/.github/workflows/[email protected].8
35+
uses: Lightning-AI/utilities/.github/workflows/[email protected].9
3636
with:
3737
scripts-ref: v0.11.8
3838
dry-run: ${{ github.event_name == 'pull_request' }}

.github/workflows/ci-check-md-links.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ on:
1414

1515
jobs:
1616
check-md-links:
17-
uses: Lightning-AI/utilities/.github/workflows/[email protected].8
17+
uses: Lightning-AI/utilities/.github/workflows/[email protected].9
1818
with:
1919
config-file: ".github/markdown-links-config.json"
2020
base-branch: "master"

.github/workflows/ci-schema.yml

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

99
jobs:
1010
check:
11-
uses: Lightning-AI/utilities/.github/workflows/[email protected].8
11+
uses: Lightning-AI/utilities/.github/workflows/[email protected].9
1212
with:
1313
# skip azure due to the wrong schema file by MSFT
1414
# https://github.com/Lightning-AI/lightning-flash/pull/1455#issuecomment-1244793607

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ jobs:
177177
coverage xml
178178
179179
- name: Upload coverage to Codecov
180-
uses: codecov/codecov-action@v4
180+
uses: codecov/codecov-action@v5
181181
# see: https://github.com/actions/toolkit/issues/399
182182
continue-on-error: true
183183
with:

0 commit comments

Comments
 (0)