Skip to content

Commit bc4e027

Browse files
authored
Merge branch 'master' into ci/drop-1.9
2 parents 149133e + dcfaa06 commit bc4e027

File tree

635 files changed

+3442
-2948
lines changed

Some content is hidden

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

635 files changed

+3442
-2948
lines changed

.actions/setup_tools.py

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -232,8 +232,10 @@ def create_mirror_package(src_folder: str, lit_pkg_mapping: dict) -> None:
232232
... {"pytorch": "pytorch_lightning", "app": "lightning_app", "lite": "lightning_lite"}
233233
... )
234234
"""
235-
for lit_name, pkg_name in lit_pkg_mapping.items():
236-
copy_adjusted_modules(src_folder, pkg_name, lit_name, lit_pkg_mapping)
235+
mapping = lit_pkg_mapping.copy()
236+
mapping.pop("lightning", None) # pop this key to avoid replacing `lightning` to `lightning.lightning`
237+
for lit_name, pkg_name in mapping.items():
238+
copy_adjusted_modules(src_folder, pkg_name, lit_name, mapping)
237239

238240

239241
def _download_frontend(pkg_path: str):
@@ -272,19 +274,3 @@ def _load_aggregate_requirements(req_dir: str = "requirements", freeze_requireme
272274
requires = list(chain(*requires))
273275
with open(os.path.join(req_dir, "base.txt"), "w") as fp:
274276
fp.writelines([ln + os.linesep for ln in requires])
275-
276-
277-
def set_actual_version_from_src(req_path: str, src_root: str, pkg_name: str) -> None:
278-
"""Setting actual version from source code for a given package."""
279-
with open(req_path, encoding="utf-8") as fo:
280-
lines = fo.readlines()
281-
ver = parse_version_from_file(os.path.join(src_root, pkg_name.replace("-", "_")))
282-
for i, ln in enumerate(lines):
283-
reqs = list(parse_requirements([ln]))
284-
if not reqs:
285-
continue
286-
if reqs[0].name == pkg_name:
287-
lines[i] = f"{pkg_name}=={ver}{os.linesep}"
288-
289-
with open(req_path, "w", encoding="utf-8") as fw:
290-
fw.writelines(lines)

.azure/app-cloud-e2e.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ jobs:
7575
name: "commands_and_api"
7676
# 'App: quick_start': # TODO: Failed during installation
7777
# name: "quick_start"
78-
timeoutInMinutes: "30"
78+
timeoutInMinutes: "20"
7979
cancelTimeoutInMinutes: "2"
8080
# values: https://docs.microsoft.com/en-us/azure/devops/pipelines/process/phases?view=azure-devops&tabs=yaml#workspace
8181
workspace:

.azure/gpu-benchmark.yml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -51,16 +51,6 @@ jobs:
5151
echo "##vso[task.setvariable variable=TORCH_URL]https://download.pytorch.org/whl/cu${cuda_ver}/torch_stable.html"
5252
displayName: 'set env. vars'
5353
54-
- bash: |
55-
pip install -e . --find-links ${TORCH_URL}
56-
git checkout -- setup.py MANIFEST.in
57-
env:
58-
PACKAGE_NAME: lite
59-
FREEZE_REQUIREMENTS: 1
60-
# Lite shall have pin version, so to keep development aligned we need to install lite from source not from pypi
61-
# also installing from source not from on-the-fly created package tp prevent accidental interaction with cache
62-
displayName: 'Install Lite pkg'
63-
6454
- bash: |
6555
pip install -e .[strategies] --find-links ${TORCH_URL}
6656
pip list

.azure/gpu-tests-pytorch.yml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -93,16 +93,6 @@ jobs:
9393
python ./requirements/pytorch/adjust-versions.py requirements/pytorch/examples.txt ${PYTORCH_VERSION}
9494
displayName: 'Adjust dependencies'
9595
96-
- bash: |
97-
pip install -e . --find-links ${TORCH_URL}
98-
git checkout -- setup.py MANIFEST.in
99-
env:
100-
PACKAGE_NAME: "lite"
101-
FREEZE_REQUIREMENTS: "1"
102-
# Lite shall have pin version, so to keep development aligned we need to install lite from source not from pypi
103-
# also installing from source not from on-the-fly created package to prevent accidental interaction with cache
104-
displayName: 'Install Lite pkg'
105-
10696
- bash: pip install -e .[strategies] -r requirements/pytorch/devel.txt -r requirements/pytorch/examples.txt --find-links ${TORCH_URL}
10797
env:
10898
PACKAGE_NAME: "pytorch"

.azure/hpu-tests.yml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -58,16 +58,6 @@ jobs:
5858
sudo pip install pip -U
5959
displayName: 'Instance HW info'
6060
61-
- bash: |
62-
pip install -e .
63-
git checkout -- setup.py MANIFEST.in
64-
env:
65-
PACKAGE_NAME: "lite"
66-
FREEZE_REQUIREMENTS: "1"
67-
# Lite shall have pin version, so to keep development aligned we need to install lite from source not from pypi
68-
# also installing from source not from on-the-fly created package to prevent accidental interaction with cache
69-
displayName: 'Install Lite pkg'
70-
7161
- bash: |
7262
set -e
7363
pip --version

.azure/ipu-tests.yml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -63,16 +63,6 @@ jobs:
6363
done
6464
displayName: "Reset IPU devices"
6565
66-
- bash: |
67-
pip install -e .
68-
git checkout -- setup.py MANIFEST.in
69-
env:
70-
PACKAGE_NAME: "lite"
71-
FREEZE_REQUIREMENTS: "1"
72-
# Lite shall have pin version, so to keep development aligned we need to install lite from source not from pypi
73-
# also installing from source not from on-the-fly created package tp prevent accidental interaction with cache
74-
displayName: 'Install Lite pkg'
75-
7666
- bash: |
7767
python ./requirements/pytorch/adjust-versions.py requirements/pytorch/extra.txt
7868
python ./requirements/pytorch/adjust-versions.py requirements/pytorch/examples.txt

.github/actions/pkg-check/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,13 @@ runs:
3939
shell: bash
4040

4141
- name: Unzip packages
42-
if: ${{ inputs.pkg-name != '' }}
42+
if: ${{ inputs.pkg-name != 'lightning' }}
4343
working-directory: dist
4444
run: for file in `ls *.gz`; do tar -xzf $file; done
4545
shell: bash
4646

4747
- name: Check single pkg/folder
48-
if: ${{ inputs.pkg-name != '' }}
48+
if: ${{ inputs.pkg-name != 'lightning' }}
4949
working-directory: dist
5050
run: |
5151
import os, glob, pathlib, shutil
Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,35 @@
1-
name: Install and check package
2-
description: installing and validationg the package
1+
name: Install and validate the package
2+
description: Install and validate the package
33

44
inputs:
55
pkg-name:
6-
description: package name for import
7-
required: false
8-
default: ""
6+
description: Package name to import
7+
required: true
98
pip-flags:
10-
description: additional pil install flags
9+
description: Additional pip install flags
1110
required: false
1211
default: ""
1312

1413
runs:
1514
using: "composite"
1615
steps:
17-
- name: Determine package name
18-
if: ${{ inputs.pkg-import == '' }}
19-
working-directory: ./dist
20-
run: python -c "import glob ; ls = glob.glob('*.tar.gz') ; name = '_'.join(ls[0].split('-')[:-1]) ; print(f'PKG_NAME={name}')" >> $GITHUB_ENV
21-
shell: bash
22-
23-
- name: Pass package name
24-
if: ${{ inputs.pkg-import != '' }}
25-
run: echo "PKG_NAME=${{ inputs.pkg-name }}" >> $GITHUB_ENV
16+
- name: Choose package import
17+
run: |
18+
python -c "print('PKG_IMPORT=' + {'app': 'lightning_app', 'lite': 'lightning_lite', 'pytorch': 'pytorch_lightning', 'lightning': 'lightning'}['${{matrix.pkg-name}}'])" >> $GITHUB_ENV
2619
shell: bash
2720

2821
- name: Install package - archive
2922
working-directory: ./dist
3023
run: |
3124
pip install *.tar.gz ${{ inputs.pip-flags }}
3225
pip list | grep lightning
33-
python -c "import ${PKG_NAME} ; print(${PKG_NAME}.__version__)"
26+
python -c "import ${{ env.PKG_IMPORT }}; print(${{ env.PKG_IMPORT }}.__version__)"
3427
shell: bash
3528

3629
- name: Install package - wheel
3730
working-directory: ./dist
3831
run: |
3932
pip install *.whl ${{ inputs.pip-flags }}
4033
pip list | grep lightning
41-
python -c "import ${PKG_NAME} ; print(${PKG_NAME}.__version__)"
34+
python -c "import ${{ env.PKG_IMPORT }}; print(${{ env.PKG_IMPORT }}.__version__)"
4235
shell: bash

.github/checkgroup.yml

Lines changed: 42 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ subprojects:
4848
- "pl-cpu (windows-2022, lightning, 3.7, 1.10, oldest)"
4949
- "make-doctest (pytorch)"
5050
- "make-html (pytorch)"
51-
- "mypy"
5251
- "pytorch-lightning (GPUs)"
5352
- "pytorch-lightning (HPUs)"
5453
- "pytorch-lightning (IPUs)"
@@ -58,7 +57,7 @@ subprojects:
5857
# TODO: since this job has intermittent availability, it cannot be required or it will block all PL PRs from forks
5958
#- "test-on-tpus"
6059

61-
- id: "pytorch_lightning: CPU"
60+
- id: "pytorch_lightning: CPU workflow"
6261
paths:
6362
- ".github/workflows/ci-pytorch-tests.yml"
6463
checks:
@@ -83,7 +82,7 @@ subprojects:
8382
- "pl-cpu (windows-2022, lightning, 3.10, 1.13)"
8483
- "pl-cpu (windows-2022, lightning, 3.7, 1.10, oldest)"
8584

86-
- id: "pytorch_lightning: Slow"
85+
- id: "pytorch_lightning: Slow workflow"
8786
paths:
8887
- ".github/workflows/ci-pytorch-tests-slow.yml"
8988
checks:
@@ -110,7 +109,7 @@ subprojects:
110109
checks:
111110
- "pytorch-lightning (IPUs)"
112111

113-
- id: "pytorch-lightning: TPU"
112+
- id: "pytorch-lightning: TPU workflow"
114113
paths:
115114
- ".github/workflows/tpu-tests.yml"
116115
checks:
@@ -176,7 +175,6 @@ subprojects:
176175
- "lite-cpu (ubuntu-20.04, lightning, 3.8, 1.12)"
177176
- "lite-cpu (windows-2022, lightning, 3.8, 1.12)"
178177
- "lightning-lite (GPUs)"
179-
- "mypy"
180178
# Lite also requires PL checks as it depends on Lite
181179
- "pl-cpu (macOS-11, pytorch, 3.8, 1.11)"
182180
- "pl-cpu (macOS-11, pytorch, 3.9, 1.12)"
@@ -244,8 +242,7 @@ subprojects:
244242
- "requirements/app/**"
245243
- "src/lightning_app/**"
246244
- "tests/tests_app/**"
247-
- "examples/app_*" # some tests_app tests call examples files
248-
- ".github/workflows/ci-app-tests.yml"
245+
- "examples/app_*/**" # some tests_app tests call examples files
249246
- "setup.py"
250247
- ".actions/**"
251248
checks:
@@ -262,13 +259,26 @@ subprojects:
262259
- "app-pytest (windows-2022, app, 3.8, oldest)"
263260
- "app-pytest (windows-2022, lightning, 3.8, latest)"
264261

262+
- id: "lightning_app: Tests workflow"
263+
paths:
264+
- ".github/workflows/ci-app-tests.yml"
265+
checks:
266+
- "app-pytest (macOS-11, app, 3.8, latest)"
267+
- "app-pytest (macOS-11, app, 3.8, oldest)"
268+
- "app-pytest (macOS-11, lightning, 3.9, latest)"
269+
- "app-pytest (ubuntu-20.04, app, 3.8, latest)"
270+
- "app-pytest (ubuntu-20.04, app, 3.8, oldest)"
271+
- "app-pytest (ubuntu-20.04, lightning, 3.9, latest)"
272+
- "app-pytest (windows-2022, app, 3.8, latest)"
273+
- "app-pytest (windows-2022, app, 3.8, oldest)"
274+
- "app-pytest (windows-2022, lightning, 3.8, latest)"
275+
265276
- id: "lightning_app: Examples"
266277
paths:
267278
- "requirements/app/**"
268279
- "src/lightning_app/**"
269280
- "tests/tests_app_examples/**"
270-
- "examples/app_*"
271-
- ".github/workflows/ci-app-examples.yml"
281+
- "examples/app_*/**"
272282
- "setup.py"
273283
- ".actions/**"
274284
checks:
@@ -282,6 +292,20 @@ subprojects:
282292
- "app-examples (windows-2022, app, 3.9, oldest)"
283293
- "app-examples (windows-2022, lightning, 3.9, latest)"
284294

295+
- id: "lightning_app: Examples workflow"
296+
paths:
297+
- ".github/workflows/ci-app-examples.yml"
298+
checks:
299+
- "app-examples (macOS-11, app, 3.9, latest)"
300+
- "app-examples (macOS-11, app, 3.9, oldest)"
301+
- "app-examples (macOS-11, lightning, 3.9, latest)"
302+
- "app-examples (ubuntu-20.04, app, 3.9, latest)"
303+
- "app-examples (ubuntu-20.04, app, 3.9, oldest)"
304+
- "app-examples (ubuntu-20.04, lightning, 3.9, latest)"
305+
- "app-examples (windows-2022, app, 3.9, latest)"
306+
- "app-examples (windows-2022, app, 3.9, oldest)"
307+
- "app-examples (windows-2022, lightning, 3.9, latest)"
308+
285309
- id: "lightning_app: Azure"
286310
paths:
287311
- ".azure/app-cloud-e2e.yml"
@@ -303,7 +327,10 @@ subprojects:
303327
- id: "mypy"
304328
paths:
305329
- ".github/workflows/code-checks.yml"
330+
- "requirements/**"
331+
- "src/**"
306332
- "pyproject.toml" # includes mypy config
333+
- ".actions/**"
307334
checks:
308335
- "mypy"
309336

@@ -321,21 +348,21 @@ subprojects:
321348
- "install-pkg (ubuntu-22.04, lite, 3.10)"
322349
- "install-pkg (ubuntu-22.04, pytorch, 3.7)"
323350
- "install-pkg (ubuntu-22.04, pytorch, 3.10)"
324-
- "install-pkg (ubuntu-22.04, 3.7)"
325-
- "install-pkg (ubuntu-22.04, 3.10)"
351+
- "install-pkg (ubuntu-22.04, lightning, 3.7)"
352+
- "install-pkg (ubuntu-22.04, lightning, 3.10)"
326353
- "install-pkg (macOS-12, app, 3.7)"
327354
- "install-pkg (macOS-12, app, 3.10)"
328355
- "install-pkg (macOS-12, lite, 3.7)"
329356
- "install-pkg (macOS-12, lite, 3.10)"
330357
- "install-pkg (macOS-12, pytorch, 3.7)"
331358
- "install-pkg (macOS-12, pytorch, 3.10)"
332-
- "install-pkg (macOS-12, 3.7)"
333-
- "install-pkg (macOS-12, 3.10)"
359+
- "install-pkg (macOS-12, lightning, 3.7)"
360+
- "install-pkg (macOS-12, lightning, 3.10)"
334361
- "install-pkg (windows-2022, app, 3.7)"
335362
- "install-pkg (windows-2022, app, 3.10)"
336363
- "install-pkg (windows-2022, lite, 3.7)"
337364
- "install-pkg (windows-2022, lite, 3.10)"
338365
- "install-pkg (windows-2022, pytorch, 3.7)"
339366
- "install-pkg (windows-2022, pytorch, 3.10)"
340-
- "install-pkg (windows-2022, 3.7)"
341-
- "install-pkg (windows-2022, 3.10)"
367+
- "install-pkg (windows-2022, lightning, 3.7)"
368+
- "install-pkg (windows-2022, lightning, 3.10)"

.github/workflows/ci-app-examples.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,14 @@ on:
66
branches: [master, "release/*"]
77
pull_request:
88
branches: [master, "release/*"]
9-
types: [opened, reopened, ready_for_review, synchronize] # add `ready_for_review` since draft is skipped
9+
types: [opened, reopened, ready_for_review, synchronize] # added `ready_for_review` since draft is skipped
1010
paths:
1111
- ".github/workflows/ci-app-examples.yml"
1212
- "src/lightning_app/**"
1313
- "tests/tests_app_examples/**"
1414
- "examples/app_*"
15-
- "requirements/app/**"
15+
- "requirements/app/*"
16+
- "!requirements/app/docs.txt"
1617
- "setup.py"
1718
- ".actions/**"
1819

@@ -98,8 +99,7 @@ jobs:
9899
- name: Adjust examples
99100
if: ${{ matrix.pkg-name != 'lightning' }}
100101
run: |
101-
python .actions/assistant.py copy_replace_imports --source_dir="./examples" --source_import="lightning.app" --target_import="lightning_app"
102-
python .actions/assistant.py copy_replace_imports --source_dir="./examples" --source_import="lightning" --target_import="lightning_app"
102+
python .actions/assistant.py copy_replace_imports --source_dir="./examples" --source_import="lightning.app,lightning" --target_import="lightning_app,lightning_app"
103103
104104
- name: Switch coverage scope
105105
run: python -c "print('COVERAGE_SCOPE=' + str('lightning' if '${{matrix.pkg-name}}' == 'lightning' else 'lightning_app'))" >> $GITHUB_ENV

0 commit comments

Comments
 (0)