Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LAI [wip] #15122

Closed
wants to merge 243 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
243 commits
Select commit Hold shift + click to select a range
8bcfe51
CI: add pytest for LAI
Borda Oct 12, 2022
80f11ee
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 12, 2022
c119c8c
placeholder
Borda Oct 12, 2022
d656c7f
Merge branch 'master' into ci/pytest-lai
Borda Oct 12, 2022
5f5b554
replace
Borda Oct 12, 2022
5071871
-tqdm
Borda Oct 12, 2022
abc92b4
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 12, 2022
52f6333
adjust
Borda Oct 12, 2022
575a44d
pt
Borda Oct 12, 2022
41c4179
pt
Borda Oct 12, 2022
deccee7
req
Borda Oct 12, 2022
e864a69
req
Borda Oct 12, 2022
820ddff
install
Borda Oct 12, 2022
44efebb
-oldest
Borda Oct 12, 2022
d2c627b
app
Borda Oct 12, 2022
7863972
fsspec
Borda Oct 12, 2022
832f2b1
pl
Borda Oct 12, 2022
9071927
typing
Borda Oct 12, 2022
2e6d7b5
names
Borda Oct 12, 2022
46d79af
encode
Borda Oct 12, 2022
348f3ad
fix imports
Borda Oct 12, 2022
ba8f500
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 12, 2022
00fc2a7
matrix
Borda Oct 13, 2022
bf5b64c
Merge branch 'ci/pytest-lai' of https://github.com/PyTorchLightning/p…
Borda Oct 13, 2022
dbbdb29
more general replace imports
Oct 13, 2022
d1fa7dc
proper import
Oct 13, 2022
ce1ea5a
ensure PROJECT_ROOT is correct
Oct 13, 2022
1d178ed
mirror + prune
Borda Oct 13, 2022
19a6917
makedir
Borda Oct 13, 2022
a73ce2f
setup
Borda Oct 13, 2022
40d1db8
wtf, windows?
Oct 13, 2022
873847f
update testing
justusschock Oct 13, 2022
dfbf32b
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 13, 2022
e1ab776
missing '
justusschock Oct 13, 2022
dff7b2c
only sanity check pytorch deps when running pytorch tests
justusschock Oct 13, 2022
52154ff
proper package pruning
Oct 13, 2022
3e62c64
I'm stupid again
justusschock Oct 13, 2022
721ca3c
messing with requirements
justusschock Oct 13, 2022
d152da9
Revert "wtf, windows?"
Oct 13, 2022
7ea449b
messing with requirements part 2
justusschock Oct 13, 2022
414055f
comment out doctests for now as there are only imports
justusschock Oct 13, 2022
6a39110
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 13, 2022
fc01887
ci
Borda Oct 13, 2022
df8794a
ci
Borda Oct 13, 2022
ccbe4fd
name
Borda Oct 13, 2022
11744df
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 13, 2022
c6d4d91
ci clean
Borda Oct 13, 2022
f6feaaa
Merge branch 'pkg/lai-source' of https://github.com/PyTorchLightning/…
Borda Oct 13, 2022
36e9c04
empty
Borda Oct 13, 2022
972b509
py
Borda Oct 13, 2022
4acc2df
parallel
Borda Oct 13, 2022
47f0386
yolo
Oct 13, 2022
d4294b6
doctest
Borda Oct 13, 2022
b7a6469
flake8
Borda Oct 13, 2022
4fc4fc5
ci
Borda Oct 13, 2022
f03aa13
typo
Borda Oct 13, 2022
170858d
Merge branch 'master' into pkg/lai-source
Borda Oct 13, 2022
7c8f1c4
Merge branch 'ci/pytest-lai' into LAI
Borda Oct 13, 2022
3110638
replace
Borda Oct 13, 2022
c7b4c69
replace
Borda Oct 13, 2022
3b4b535
clean
Borda Oct 13, 2022
d3d838d
Apply suggestions from code review
Borda Oct 13, 2022
8575b6d
rename files with .in
Borda Oct 13, 2022
f5c947b
resolve circular
Oct 13, 2022
a433400
Revert "rename files with .in"
Borda Oct 13, 2022
50cbe84
OTA!
Borda Oct 13, 2022
81462e8
first part
Oct 13, 2022
64b8949
another one
Oct 13, 2022
70a2c77
Update __init__.py
justusschock Oct 13, 2022
2d99119
Revert "Update __init__.py"
Oct 13, 2022
13904e9
JUSTUS!
Oct 13, 2022
254d474
Merge branch 'master' into pkg/lai-source
Borda Oct 13, 2022
b7227a3
Update ci-lai-test-full.yml
justusschock Oct 13, 2022
155274e
replace everything, all the time
Oct 13, 2022
6d1831f
rename offending things
Oct 13, 2022
947247f
fix app pytest
Oct 13, 2022
b7c0432
rename offenders
Oct 13, 2022
b2af92b
maybe last offender?
Oct 13, 2022
5559f76
maybe last offender?
Oct 13, 2022
935434f
re.sub
Borda Oct 13, 2022
2e62e7e
fix UI path
Borda Oct 13, 2022
0a7e804
re.sub
Borda Oct 13, 2022
c181544
fix UI path
Borda Oct 13, 2022
c33482c
full replace
Borda Oct 13, 2022
aca890b
ci: cleaning
Borda Oct 13, 2022
2285871
full replace
Borda Oct 13, 2022
d69301e
ui path?
Borda Oct 13, 2022
d7f3c8a
ui path?
Borda Oct 13, 2022
9ee65d6
test pkg
Borda Oct 18, 2022
cdc7ae7
comment out doctests for now as there are only imports
justusschock Oct 18, 2022
0442cdc
ignore?
Borda Oct 18, 2022
d942e53
fix assistant.py
justusschock Oct 18, 2022
739822c
hide app state, so that it doesn't triggereed on import and we don't …
Oct 18, 2022
cb5dc71
Merge branch 'master' into LAI
justusschock Oct 18, 2022
04bce78
package tests passing
Oct 18, 2022
ccc04f7
properly guard bagua
Oct 18, 2022
1214a93
compile byte-code
Oct 18, 2022
59e428e
Merge branch 'master' into LAI
Oct 18, 2022
9f35f9a
force ompile byte-code
Oct 18, 2022
e150b97
remove bytecompiling
Oct 18, 2022
c2b06b1
no offenders on app side
Oct 18, 2022
9fdc68d
ugly hacks, ugly hack everywhere
Oct 18, 2022
2e28045
we need to copy everything, including templates
Oct 18, 2022
bdbd621
fix assistant.py
justusschock Oct 18, 2022
0f262ba
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 18, 2022
4b667af
why, assistant, why
Oct 18, 2022
2f18c18
jsonargparse in actions requirements
Oct 18, 2022
a73d572
underscore
Oct 18, 2022
8ecb680
fix assistant
Oct 18, 2022
5218ab2
copy only if different
Oct 18, 2022
631cc94
i'm stupid
Oct 18, 2022
c42fd99
fix assistant
Oct 18, 2022
71eb6e3
fix paths
Oct 18, 2022
146f776
I feel stupid
Oct 18, 2022
f7b2290
I feel stupid, vol2
Oct 18, 2022
1b92fc6
panel <0.12.7 is broken due to jinja https://github.com/holoviz/panel…
Oct 18, 2022
ae7bfc0
redis==4.0.0 is broken for tests
Oct 19, 2022
9bf0698
Merge branch 'master' into LAI
justusschock Oct 19, 2022
1471d4c
prune packages correctly
Oct 19, 2022
8bb8c00
remove offending test
Oct 19, 2022
cde5a37
JIRKA!!!
justusschock Oct 19, 2022
6370fd9
revert init logger names
justusschock Oct 19, 2022
dbfafb4
adapt offending test
Oct 19, 2022
14780a1
comment
Oct 19, 2022
c20f581
collective barriers
Oct 19, 2022
c06db3d
Merge branch 'master' into LAI
Oct 19, 2022
14d7e53
Revert "collective barriers"
Oct 19, 2022
6d14d93
explicit backend for cpu stuff
justusschock Oct 19, 2022
66f2979
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 19, 2022
5f200ab
no barrier at all
Oct 19, 2022
36b2ba3
next try
justusschock Oct 19, 2022
3b7fb78
run lite tests
Oct 19, 2022
c75ec8f
DEBUG - run groups test separately
carmocca Oct 19, 2022
0db2e13
readd barrier
justusschock Oct 19, 2022
98c2e73
Barrier Comment
carmocca Oct 19, 2022
554d852
Merge branch 'master' into LAI
Borda Oct 19, 2022
0be666b
Merge branch 'master' into LAI
justusschock Oct 20, 2022
85b04d1
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 20, 2022
f31153f
Merge branch 'master' into pkg/lai-source
Borda Oct 20, 2022
0a17aba
replace
Borda Oct 20, 2022
c553d50
Merge branch 'master' into LAI
otaj Oct 20, 2022
597b91a
lite
Borda Oct 20, 2022
311cbb2
app
Borda Oct 20, 2022
e6698b7
pytorch
Borda Oct 20, 2022
2f8072e
Merge branch 'master' into ci/monolitic
Borda Oct 20, 2022
9cebc1e
LAI
Borda Oct 20, 2022
202e9a9
Merge branch 'ci/monolitic' of https://github.com/PyTorchLightning/py…
Borda Oct 20, 2022
83c9aed
prune
Borda Oct 20, 2022
6d2f762
cache
Borda Oct 20, 2022
162e68f
adjust
Borda Oct 20, 2022
349597a
Merge branch 'master' into LAI
otaj Oct 20, 2022
823a4a0
Merge branch 'master' into ci/monolitic
Borda Oct 20, 2022
c3a11b9
Merge branch 'master' into LAI
Oct 20, 2022
50d5e71
do all the things automatic merge didn't finish
Oct 20, 2022
d606e0c
fire
Borda Oct 20, 2022
61569db
Revert "fire"
Borda Oct 20, 2022
ee46182
silly jsonparser
Borda Oct 20, 2022
1b4fc76
if
Borda Oct 20, 2022
ac2e4e9
''
Borda Oct 20, 2022
ea446f8
Merge branch 'master' into LAI
awaelchli Oct 21, 2022
77504c8
Merge branch 'master' into ci/monolitic
otaj Oct 21, 2022
74d0898
Merge branch 'master' into LAI
Oct 21, 2022
e86f347
finalize merge
Oct 21, 2022
9aed564
iff
Borda Oct 21, 2022
4f114aa
devel
Borda Oct 21, 2022
4689ddb
splits
Borda Oct 21, 2022
7343218
str
Borda Oct 21, 2022
0482d0a
kwargs
Borda Oct 21, 2022
2c33c80
fsspec
Borda Oct 21, 2022
1f2cb5b
ifff
Borda Oct 21, 2022
29c835c
bash
Borda Oct 21, 2022
ff713d8
skip
Borda Oct 21, 2022
a203d28
cache
Borda Oct 21, 2022
717e209
group
Borda Oct 21, 2022
98d107a
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 21, 2022
ad95f9e
sanity
Borda Oct 21, 2022
24299db
Merge branch 'ci/monolitic' of https://github.com/PyTorchLightning/py…
Borda Oct 21, 2022
d8acded
type
Borda Oct 21, 2022
c46b733
docs
Borda Oct 21, 2022
4a3d0ed
import
Borda Oct 21, 2022
672920a
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 21, 2022
b763f64
PL
Borda Oct 21, 2022
90a4db6
Merge branch 'ci/monolitic' of https://github.com/PyTorchLightning/py…
Borda Oct 21, 2022
aebaa8e
CI: apps
Borda Oct 21, 2022
67d5251
fix imports
Borda Oct 21, 2022
29bc29c
req
Borda Oct 21, 2022
80314df
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 21, 2022
eb67adc
Apply suggestions from code review
Borda Oct 21, 2022
740c6e3
url
Borda Oct 21, 2022
172d1b8
Merge branch 'ci/monolitic' of https://github.com/PyTorchLightning/py…
Borda Oct 21, 2022
69b3961
doctest
Borda Oct 21, 2022
b00fa8f
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 21, 2022
1fce8e6
pytest
Borda Oct 21, 2022
2f742ef
Merge branch 'ci/app' of https://github.com/PyTorchLightning/pytorch-…
Borda Oct 21, 2022
e4a9c6d
pytest
Borda Oct 21, 2022
6ae1da7
app
Borda Oct 21, 2022
a733b98
SQLModel
Borda Oct 21, 2022
ee3fb8e
pl
Borda Oct 21, 2022
c1bbf4a
pkg
Borda Oct 21, 2022
ecf80ff
pkg
Borda Oct 21, 2022
7a47ddc
-
Borda Oct 21, 2022
26ef213
fsspec
Borda Oct 21, 2022
e769be4
ci
Borda Oct 21, 2022
042da03
tp
Borda Oct 21, 2022
fab0bc1
Merge branch 'ci/app' into ci/monolitic
Borda Oct 21, 2022
d91ce64
drop test
Borda Oct 21, 2022
e619571
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 21, 2022
39e8121
Merge branch 'master' into ci/app
Borda Oct 21, 2022
02e6fc8
azure
Borda Oct 21, 2022
2d9fe23
Merge branch 'ci/app' of https://github.com/PyTorchLightning/pytorch-…
Borda Oct 21, 2022
227ba27
docs
Borda Oct 21, 2022
68574f9
falek8
Borda Oct 21, 2022
7be8754
Merge branch 'ci/app' into ci/monolitic
Borda Oct 21, 2022
646807c
url
Borda Oct 21, 2022
22f5fe6
cat
Borda Oct 21, 2022
b4186dc
!=
Borda Oct 21, 2022
9264861
drop
Borda Oct 21, 2022
1ff3c6e
Merge branch 'ci/monolitic' into LAI
Borda Oct 21, 2022
92cbfd7
bash
Borda Oct 21, 2022
102aa26
Merge branch 'pkg/lai-source' into LAI
Borda Oct 21, 2022
afdcbda
Merge branch 'master' into pkg/lai-source
Borda Oct 21, 2022
8218752
Merge branch 'master' into ci/monolitic
Borda Oct 22, 2022
0e1ce58
Merge branch 'master' into pkg/lai-source
Borda Oct 22, 2022
f574a75
order
Borda Oct 22, 2022
73e0051
TO
Borda Oct 22, 2022
7c12f82
LAI
Borda Oct 22, 2022
12899be
Merge branch 'master' into pkg/lai-source
Borda Oct 22, 2022
c57b767
Merge branch 'ci/monolitic' into LAI
Borda Oct 22, 2022
35b4495
Merge branch 'pkg/lai-source' into LAI
Borda Oct 22, 2022
dcfb222
scope
Borda Oct 22, 2022
cf28463
Merge branch 'ci/monolitic' into LAI
Borda Oct 22, 2022
8d072df
scope
Borda Oct 22, 2022
6d7d867
run
Borda Oct 22, 2022
63eb2df
flag
Borda Oct 22, 2022
7e633e4
Merge branch 'ci/monolitic' into LAI
Borda Oct 22, 2022
995c6e9
Merge branch 'master' into pkg/lai-source
Borda Oct 23, 2022
c2b88b8
Merge branch 'master' into LAI
Borda Oct 23, 2022
128b577
updates
Borda Oct 23, 2022
5b1acfc
regex
Borda Oct 23, 2022
ac20d05
ci
Borda Oct 23, 2022
3272080
Merge branch 'pkg/lai-source' into LAI
Borda Oct 23, 2022
ba4d216
fix
Borda Oct 23, 2022
9bebf19
Merge branch 'master' into LAI
Oct 24, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .actions/assistant.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,10 @@ def prepare_nightly_version(proj_root: str = _PATH_ROOT) -> None:
now_date = now.strftime("%Y%m%d")

print(f"prepare init '{path_info}' - replace version by {now_date}")
with open(path_info) as fp:
with open(path_info, encoding="utf-8") as fp:
init = fp.read()
init = re.sub(r'__version__ = [\d\.\w\'"]+', f'__version__ = "{now_date}"', init)
with open(path_info, "w") as fp:
with open(path_info, "w", encoding="utf-8") as fp:
fp.write(init)

@staticmethod
Expand Down Expand Up @@ -118,8 +118,8 @@ def _prune_packages(req_file: str, packages: Sequence[str]) -> None:

@staticmethod
def _replace_min(fname: str) -> None:
req = open(fname).read().replace(">=", "==")
open(fname, "w").write(req)
req = open(fname, encoding="utf-8").read().replace(">=", "==")
open(fname, "w", encoding="utf-8").write(req)

@staticmethod
def replace_oldest_ver(requirement_fnames: Sequence[str] = REQUIREMENT_FILES_ALL) -> None:
Expand Down
343 changes: 58 additions & 285 deletions .actions/setup_tools.py

Large diffs are not rendered by default.

10 changes: 2 additions & 8 deletions .github/actions/pkg-check/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ inputs:
pkg-name:
description: package name inside lightning.*
required: true
default: "lightning"
nb-dirs:
description: nb of packages in the wrap/distribution
required: false
Expand All @@ -21,10 +22,7 @@ runs:
- name: Source check
env:
PACKAGE_NAME: ${{ inputs.pkg-name }}
run: |
python setup.py check --metadata --strict
# TODO: fix reimporting (F811) which is aftefact after rplacing var assigne with import in meta package
flake8 src/lightning/ --ignore E402,F401,E501,W391,E303,F811
run: python setup.py check --metadata --strict
shell: bash

- name: Create package
Expand All @@ -40,10 +38,6 @@ runs:
# python setup.py clean
shell: bash

- name: copy/export pkg
run: cp dist/* pypi/
shell: bash

- name: Unzip packages
if: ${{ inputs.pkg-name != '' }}
working-directory: dist
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/ci-app-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,11 @@ jobs:
pip list

- name: DocTests App
# todo: run doctest laos on mono-package
if: ${{ matrix.pkg-name != 'LAI' }}
working-directory: src
run: python -m pytest lightning_app --ignore-glob="**/cli/*-template/**"
run: |
pip install pytest -q
scope=$(python -c "print('lightning/app' if '${{matrix.pkg-name}}' == 'LAI' else 'lightning_app')")
python -m pytest $scope --ignore-glob="**/cli/*-template/**"

- name: Get pip cache
id: pip-cache
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/ci-lite-test-full.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,11 @@ jobs:
pip list

- name: DocTests Lite
# todo: run docstest laos on mono-package
if: ${{ matrix.pkg-name != 'LAI' }}
working-directory: src
run: python -m pytest lightning_lite
run: |
pip install pytest -q
scope=$(python -c "print('lightning/lite' if '${{matrix.pkg-name}}' == 'LAI' else 'lightning_lite')")
python -m pytest $scope

# Note: This uses an internal pip API and may not always work
# https://github.com/actions/cache/blob/master/examples.md#multiple-oss-in-a-workflow
Expand All @@ -102,7 +103,7 @@ jobs:
restore-keys: |
${{ runner.os }}-pip-py${{ matrix.python-version }}-${{ matrix.pkg-name }}-${{ matrix.release }}-${{ matrix.requires }}-

- name: Install dependencies
- name: Install package & dependencies
run: |
pip install -r requirements/lite/devel.txt --upgrade --find-links ${TORCH_URL}
pip list
Expand Down
116 changes: 5 additions & 111 deletions .github/workflows/ci-pkg-install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,25 +17,14 @@ defaults:

jobs:

init-temp:
runs-on: ubuntu-20.04
steps:
- run: mkdir pypi && touch pypi/.placeholder
- uses: actions/upload-artifact@v3
with:
name: ci-packages-${{ github.sha }}
path: pypi

install-standalone:
needs: init-temp
install-pkg:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
max-parallel: 1
fail-fast: false
matrix:
os: [ubuntu-20.04, ubuntu-22.04, macOS-11, macOS-12, windows-2022]
pkg: ["app", "lite", "pytorch"]
python-version: [3.8] # , 3.9
pkg: ["app", "lite", "pytorch", ""]
python-version: ["3.7" , "3.10"]

steps:
- uses: actions/checkout@v3
Expand All @@ -49,109 +38,14 @@ jobs:
grep 'pytest>' ../requirements/pytorch/test.txt | xargs -0 pip install
python -m pytest setup_tools.py

- uses: actions/download-artifact@v3
with:
name: ci-packages-${{ github.sha }}
path: pypi
- run: ls -lh pypi/

- run: python -c "print('NB_DIRS=' + str(2 if '${{ matrix.pkg }}' == 'pytorch' else 1))" >> $GITHUB_ENV
- uses: ./.github/actions/pkg-check
with:
pkg-name: ${{ matrix.pkg }}
nb-dirs: ${{ env.NB_DIRS }}

- uses: actions/upload-artifact@v3
with:
name: ci-packages-${{ github.sha }}
path: pypi

- uses: ./.github/actions/pkg-install

install-meta-src:
needs: install-standalone
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
# max-parallel: 1
matrix:
os: [ubuntu-20.04, ubuntu-22.04, macOS-11, macOS-12, windows-2022]
pkg: ["", "lightning"]
python-version: [3.8] # , 3.9

steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- run: mkdir -p pypi
- uses: actions/download-artifact@v3
if: matrix.pkg != ''
with:
name: ci-packages-${{ github.sha }}
path: pypi
- run: ls -lh pypi/

- uses: ./.github/actions/pkg-check
with:
pkg-name: ${{ matrix.pkg }}

- uses: ./.github/actions/pkg-install
with:
pkg-name: "lightning"
pip-flags: "-U --pre --find-links ../pypi/"

- name: Run CLI
run: python -m lightning --version

install-meta-pypi:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
# max-parallel: 1
matrix:
os: [ubuntu-20.04, ubuntu-22.04, macOS-11, macOS-12, windows-2022]
python-version: [3.8] # , 3.9

steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Dowload package
# todo: download also lite after it is fist published
run: |
pip install -q -r .actions/requirements.txt
for pkg in 'app' 'pytorch' ; do
python .actions/assistant.py download_package --package "$pkg" --folder pypi
done
ls -lh pypi/

- name: Unzip packages
working-directory: pypi
run: for file in `ls *.gz`; do tar -xzf $file; done
- name: Show upacked pkgs
if: runner.os == 'linux'
run: |
sudo apt install -y tree
tree pypi/ -L 3

- name: Miror source
run: |
pip install -q -r .actions/requirements.txt
python .actions/assistant.py mirror_pkg2source --pypi_folder pypi --src_folder src
ls -R src/

- uses: ./.github/actions/pkg-check
with:
pkg-name: "lightning"

- uses: ./.github/actions/pkg-install
with:
pkg-name: "lightning"
pip-flags: "-U --pre --find-links ../pypi/"

- name: Run CLI
if: matrix.pkg == ''
run: python -m lightning --version
9 changes: 5 additions & 4 deletions .github/workflows/ci-pytorch-test-full.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,14 +111,15 @@ jobs:
env:
PACKAGE_NAME: ${{ matrix.pkg-name }}
run: |
pip install -e . pytest --upgrade --find-links ${TORCH_URL}
pip install -e . --upgrade --find-links ${TORCH_URL}
pip list

- name: DocTests PL
# todo: run docstest laos on mono-package
if: ${{ matrix.pkg-name != 'LAI' }}
working-directory: ./src
run: python -m pytest pytorch_lightning
run: |
pip install pytest -q
scope=$(python -c "print('lightning/pytorch' if '${{matrix.pkg-name}}' == 'LAI' else 'pytorch_lightning')")
python -m pytest $scope

- name: Get pip cache dir
id: pip-cache
Expand Down
10 changes: 5 additions & 5 deletions docs/source-lit/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -398,13 +398,13 @@ def find_source():
from typing import Optional

import torch
import pytorch_lightning as pl
import lightning.pytorch as pl
from torch import nn
from torch.utils.data import IterableDataset, DataLoader, Dataset
from pytorch_lightning import LightningDataModule, LightningModule, Trainer, seed_everything
from pytorch_lightning.callbacks import Callback
from pytorch_lightning.cli import LightningCLI
from pytorch_lightning.utilities import (
from lightning.pytorch import LightningDataModule, LightningModule, Trainer, seed_everything
from lightning.pytorch.callbacks import Callback
from lightning.pytorch.cli import LightningCLI
from lightning.pytorch.utilities import (
_APEX_AVAILABLE,
_TORCHVISION_AVAILABLE,
_TORCH_GREATER_EQUAL_1_10,
Expand Down
2 changes: 1 addition & 1 deletion requirements/app/base.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
lightning-cloud>=0.5.10
packaging
typing-extensions>=4.0.0, <4.3.1
deepdiff>=5.7.0, <=5.8.1
starsessions>=1.2.1, <2.0 # strict
fsspec>=2022.5.0, <=2022.7.1
Expand Down
7 changes: 6 additions & 1 deletion requirements/app/test.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
coverage>=6.4, <=6.4.2
codecov>=2.1, <=2.1.12
pytest>=7.0, <=7.1.2
pytest-timeout <=2.1.0
pytest-cov <=3.0.0
pytest-forked <=1.4.0
pytest-rerunfailures>=10.2
pre-commit>=1.0
mypy==0.971

pytest-timeout <=2.1.0
playwright==1.27.1
# pytest-flake8
httpx
Expand Down
2 changes: 0 additions & 2 deletions requirements/base.txt
Original file line number Diff line number Diff line change
@@ -1,2 +0,0 @@
pytorch_lightning>=1.6.5
lightning_app>=0.5.2
11 changes: 11 additions & 0 deletions requirements/lite/devel.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
# install all mandatory dependencies
-r ./base.txt


# install all test utilities
coverage>=6.4, <=6.4.2
codecov>=2.1, <=2.1.12
pytest>=7.0, <=7.1.2
pytest-cov <=3.0.0
pytest-forked <=1.4.0
pytest-rerunfailures>=10.2
pre-commit>=1.0
mypy==0.971

-r ./test.txt
7 changes: 3 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,13 @@
In case you want to install just one package you need to export env. variable before calling `pip`

- for `pytorch-lightning` use `export PACKAGE_NAME=pytorch ; pip install .`
- for `lightning-lite` use `export PACKAGE_NAME=lite ; pip install .`
- for `lightning-app` use `export PACKAGE_NAME=app ; pip install .`

3. Building packages as sdist or binary wheel and installing or publish to PyPI afterwords you use command
`python setup.py sdist` or `python setup.py bdist_wheel` accordingly.
In case you want to build just a particular package you would use exporting env. variable as above:
`export PACKAGE_NAME=pytorch|app ; python setup.py sdist bdist_wheel`
`export PACKAGE_NAME=pytorch|app|lite ; python setup.py sdist bdist_wheel`

4. Automated releasing with GitHub action is natural extension of 3) is composed of three consecutive steps:
a) determine which packages shall be released based on version increment in `__version__.py` and eventually
Expand Down Expand Up @@ -102,9 +103,7 @@ def _load_py_module(name: str, location: str) -> ModuleType:
if _PACKAGE_NAME not in _PACKAGE_MAPPING:
_SETUP_TOOLS.set_version_today(os.path.join(_PATH_SRC, "lightning", "__version__.py"))

for lit_name, pkg_name in _PACKAGE_MAPPING.items():
# fixme: if we run creation of meta pkg against stable we shall pull the source
_SETUP_TOOLS.create_meta_package(os.path.join(_PATH_ROOT, "src"), pkg_name, lit_name)
_SETUP_TOOLS.create_mirror_package(os.path.join(_PATH_ROOT, "src"), _PACKAGE_MAPPING)

_SETUP_MODULE = _load_py_module(name="pkg_setup", location=_PATH_SETUP)
_SETUP_MODULE._adjust_manifest(pkg_name=_REAL_PKG_NAME)
Expand Down
6 changes: 6 additions & 0 deletions src/lightning/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""Root package info."""
import logging
import os
from typing import Any

_DETAIL = 15 # between logging.INFO and logging.DEBUG, used for logging in production use cases
Expand All @@ -15,6 +16,7 @@ def _detail(self: Any, message: str, *args: Any, **kwargs: Any) -> None:
logging.detail = _detail
logging.Logger.detail = _detail


# explicitly don't set root logger's propagation and leave this to subpackages to manage
_logger = logging.getLogger(__name__)
_logger.setLevel(logging.INFO)
Expand All @@ -39,6 +41,10 @@ def _detail(self: Any, message: str, *args: Any, **kwargs: Any) -> None:
from lightning.pytorch.trainer import Trainer # noqa: E402
from lightning.pytorch.utilities.seed import seed_everything # noqa: E402

import lightning.app # isort: skip # noqa: E402

lightning.app._PROJECT_ROOT = os.path.dirname(lightning.app._PROJECT_ROOT)

__all__ = [
"LightningApp",
"LightningFlow",
Expand Down
Loading