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: creating mirror package #15105

Merged
merged 146 commits into from
Oct 27, 2022
Merged
Show file tree
Hide file tree
Changes from 40 commits
Commits
Show all changes
146 commits
Select commit Hold shift + click to select a range
c119c8c
placeholder
Borda Oct 12, 2022
1d178ed
mirror + prune
Borda Oct 13, 2022
19a6917
makedir
Borda Oct 13, 2022
a73ce2f
setup
Borda 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
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
3110638
replace
Borda Oct 13, 2022
3b4b535
clean
Borda Oct 13, 2022
d3d838d
Apply suggestions from code review
Borda Oct 13, 2022
254d474
Merge branch 'master' into pkg/lai-source
Borda Oct 13, 2022
0a7e804
re.sub
Borda Oct 13, 2022
c181544
fix UI path
Borda Oct 13, 2022
2285871
full replace
Borda Oct 13, 2022
d7f3c8a
ui path?
Borda Oct 13, 2022
f31153f
Merge branch 'master' into pkg/lai-source
Borda Oct 20, 2022
0a17aba
replace
Borda Oct 20, 2022
afdcbda
Merge branch 'master' into pkg/lai-source
Borda Oct 21, 2022
0e1ce58
Merge branch 'master' into pkg/lai-source
Borda Oct 22, 2022
12899be
Merge branch 'master' into pkg/lai-source
Borda Oct 22, 2022
995c6e9
Merge branch 'master' into pkg/lai-source
Borda Oct 23, 2022
128b577
updates
Borda Oct 23, 2022
5b1acfc
regex
Borda Oct 23, 2022
ac20d05
ci
Borda Oct 23, 2022
20b7045
fix
Borda Oct 23, 2022
f196539
ci
Borda Oct 23, 2022
27a223c
path
Borda Oct 23, 2022
a2dded9
ci
Borda Oct 23, 2022
db2af8b
replace
Borda Oct 23, 2022
85e3bb5
Merge branch 'master' into pkg/lai-source
Borda Oct 24, 2022
8bd7114
Update .actions/setup_tools.py
justusschock Oct 24, 2022
6a503f9
also convert lightning_lite tests for PL tests to adapt mocking paths
justusschock Oct 24, 2022
26801bc
fix app example test
manskx Oct 24, 2022
cba7e16
Merge branch 'pkg/lai-source' of github.com:Lightning-AI/lightning in…
manskx Oct 24, 2022
4ef9c8e
Merge branch 'master' into pkg/lai-source
justusschock Oct 24, 2022
de6b9b1
update logger propagation for PL tests
justusschock Oct 24, 2022
c1a5e11
update logger propagation for PL tests
justusschock Oct 24, 2022
352cc0e
Merge branch 'master' into pkg/lai-source
Borda Oct 24, 2022
3a55416
Apply suggestions from code review
Borda Oct 24, 2022
0ce862e
Revert "update logger propagation for PL tests"
justusschock Oct 24, 2022
543b197
Merge remote-tracking branch 'origin/pkg/lai-source' into pkg/lai-source
justusschock Oct 24, 2022
391d0c4
playwright
Borda Oct 24, 2022
1a63da2
py
Borda Oct 24, 2022
9330b9d
update import in tests
manskx Oct 24, 2022
67b6ea1
Merge branch 'master' into pkg/lai-source
justusschock Oct 24, 2022
cbb1658
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 24, 2022
c02f766
try edit import in overwrite
Borda Oct 24, 2022
70fca84
debug code
manskx Oct 24, 2022
d57ad8a
Merge remote-tracking branch 'origin/pkg/lai-source' into pkg/lai-source
manskx Oct 24, 2022
a97bfd6
rev playwright
Borda Oct 24, 2022
a3fbc75
Revert "try edit import in overwrite"
Borda Oct 24, 2022
da7c3ff
Merge branch 'master' into pkg/lai-source
Borda Oct 24, 2022
51879cd
ci: adjust examples
Borda Oct 24, 2022
43c63c8
adjust examples cloud
manskx Oct 24, 2022
bed45f0
Merge remote-tracking branch 'origin/pkg/lai-source' into pkg/lai-source
manskx Oct 24, 2022
65166d9
mock lightning_app
manskx Oct 24, 2022
4821742
Install assistant dependencies
manskx Oct 24, 2022
ed703f5
lightning
Borda Oct 24, 2022
8c5e8b2
setup
Borda Oct 24, 2022
7e99e8f
Merge branch 'master' into pkg/lai-source
carmocca Oct 24, 2022
831073a
Apply suggestions from code review
Borda Oct 24, 2022
ccfe7f8
Apply suggestions from code review
Borda Oct 24, 2022
68fea9d
Apply suggestions from code review
Borda Oct 24, 2022
bf375b4
disable cache
manskx Oct 25, 2022
80dab9d
move doctest to install
Borda Oct 25, 2022
3651cc7
Merge branch 'pkg/lai-source' of https://github.com/PyTorchLightning/…
Borda Oct 25, 2022
2ecc1d6
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 25, 2022
79362fd
)
Borda Oct 25, 2022
775bfdd
Merge branch 'pkg/lai-source' of https://github.com/PyTorchLightning/…
Borda Oct 25, 2022
7325f7d
Merge branch 'master' into pkg/lai-source
Borda Oct 25, 2022
75d080b
echo ./
Borda Oct 25, 2022
974b58f
ci
Borda Oct 25, 2022
5bdaeab
lru
Borda Oct 25, 2022
c682893
revert disabling cache, prints
manskx Oct 25, 2022
8602e72
Merge remote-tracking branch 'origin/pkg/lai-source' into pkg/lai-source
manskx Oct 25, 2022
29aca4c
ci
Borda Oct 25, 2022
f1630e0
prune ci jobs
Borda Oct 25, 2022
5f2b739
prune ci jobs
Borda Oct 25, 2022
69756af
training loop standalone tests
justusschock Oct 25, 2022
7e65a83
Merge branch 'master' into pkg/lai-source
Borda Oct 25, 2022
9ef3d4f
Merge branch 'master' into pkg/lai-source
Borda Oct 25, 2022
fb10b19
add sys modules cleanup fixture
justusschock Oct 25, 2022
c15efdd
make use of fixture
justusschock Oct 25, 2022
146599a
revert standalone
justusschock Oct 25, 2022
9297fd7
ci e2e
Borda Oct 25, 2022
5a2acb0
fix imports in lightning
manskx Oct 25, 2022
fec212a
fix imports of lightning in tests
manskx Oct 25, 2022
6c24a20
Revert "make use of fixture"
justusschock Oct 25, 2022
f4bcd48
Revert other commits for fixtures
justusschock Oct 25, 2022
12cbf7b
revert use of fixture
justusschock Oct 25, 2022
6849146
Merge branch 'master' into pkg/lai-source
Borda Oct 25, 2022
b00c70b
Merge branch 'master' into pkg/lai-source
Borda Oct 25, 2022
51a5a14
py3.9
Borda Oct 25, 2022
43b48be
fix mocking
Borda Oct 25, 2022
1093b05
Merge branch 'master' into pkg/lai-source
Borda Oct 25, 2022
1089c2a
fix paths
Borda Oct 25, 2022
da89285
Merge branch 'pkg/lai-source' of https://github.com/PyTorchLightning/…
Borda Oct 25, 2022
d4b0b1e
hack mocking
Borda Oct 25, 2022
11635ae
docs
Borda Oct 25, 2022
01e45b9
Apply suggestions from code review
Borda Oct 25, 2022
0fd1be6
rev suggestion
Borda Oct 25, 2022
3b7607a
Minor changes to the parametrizations
carmocca Oct 26, 2022
150d5eb
Update checkgroup with the new and changed jobs
carmocca Oct 26, 2022
570e2a0
include frontend dir
manskx Oct 26, 2022
939e2c9
Merge branch 'master' into pkg/lai-source
tchaton Oct 26, 2022
269a45c
cli
Borda Oct 26, 2022
bf81fe3
fix imports and entry point
tchaton Oct 26, 2022
b19dde5
Merge branch 'pkg/lai-source' of https://github.com/Lightning-AI/ligh…
tchaton Oct 26, 2022
29b6512
Merge branch 'master' into pkg/lai-source
Borda Oct 26, 2022
ac29eeb
Merge branch 'pkg/lai-source' of https://github.com/PyTorchLightning/…
Borda Oct 26, 2022
34b7001
Merge branch 'master' into pkg/lai-source
carmocca Oct 26, 2022
9df9668
Revert standalone
carmocca Oct 26, 2022
7bf2bcd
Merge branch 'master' into pkg/lai-source
Borda Oct 26, 2022
20be13a
rc1
Borda Oct 26, 2022
1402dc4
e2e on staging
Borda Oct 26, 2022
49bd50e
Merge branch 'master' into pkg/lai-source
Borda Oct 26, 2022
f5ad3f2
Merge branch 'master' into pkg/lai-source
Borda Oct 26, 2022
317d245
Merge branch 'master' into pkg/lai-source
carmocca Oct 26, 2022
a42f2ec
Revert "Revert standalone"
Borda Oct 26, 2022
bd4fb2e
Merge branch 'master' into pkg/lai-source
Borda Oct 26, 2022
8e39089
Merge branch 'master' into pkg/lai-source
Borda Oct 26, 2022
cda0898
groups
Borda Oct 26, 2022
30f4bbb
to
Borda Oct 26, 2022
8879195
ci: pt ver
Borda Oct 26, 2022
1f2c5d2
docker
Borda Oct 26, 2022
ef13dd8
Apply suggestions from code review
carmocca Oct 26, 2022
e47a07b
Copy over changes from previous commit to other groups
carmocca Oct 26, 2022
c2ec514
Add back changes from bad merge
carmocca Oct 26, 2022
2a4e9f8
Uppercase step name everywhere
carmocca Oct 26, 2022
247b58c
Merge branch 'master' into pkg/lai-source
carmocca Oct 26, 2022
cdcc76c
update
tchaton Oct 27, 2022
8fcf8a4
Merge branch 'pkg/lai-source' of https://github.com/Lightning-AI/ligh…
tchaton Oct 27, 2022
b491089
ci
Borda Oct 27, 2022
e0ba7ef
Merge branch 'master' into pkg/lai-source
lantiga Oct 27, 2022
7eb085f
ci: lai oldest
Borda Oct 27, 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
10 changes: 5 additions & 5 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 Expand Up @@ -212,7 +212,7 @@ def copy_replace_imports(

for source_import, target_import in zip(source_imports, target_imports):
for i, ln in enumerate(py):
py[i] = re.sub(rf"(?!_){source_import}(?!_)", target_import, ln)
py[i] = re.sub(rf"([^_]|^){source_import}([^_\w]|$)", rf"\1{target_import}\2", ln)

if target_dir:
fp_new = fp.replace(source_dir, target_dir)
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"
Borda marked this conversation as resolved.
Show resolved Hide resolved
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
Borda marked this conversation as resolved.
Show resolved Hide resolved
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
2 changes: 2 additions & 0 deletions .github/workflows/ci-app-examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ jobs:
run: npm install -g yarn

- name: Install Lightning as top-level
env:
PACKAGE_NAME: app
run: pip install -e .
shell: bash

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
Borda marked this conversation as resolved.
Show resolved Hide resolved
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
7 changes: 4 additions & 3 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
Borda marked this conversation as resolved.
Show resolved Hide resolved
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 Down
123 changes: 11 additions & 112 deletions .github/workflows/ci-pkg-install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,141 +17,40 @@ 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]
Borda marked this conversation as resolved.
Show resolved Hide resolved
pkg: ["app", "lite", "pytorch"]
python-version: [3.8] # , 3.9
pkg: ["app", "lite", "pytorch", ""]
carmocca marked this conversation as resolved.
Show resolved Hide resolved
python-version: ["3.7" , "3.10"]

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

- name: Install pytest extensions
# TODO: for mono-package create & load requirements/test.txt
if: ${{ matrix.pkg != '' }}
run: grep 'pytest>' requirements/${{ matrix.pkg }}/test.txt | xargs -0 pip install

Borda marked this conversation as resolved.
Show resolved Hide resolved
- name: DocTests actions
carmocca marked this conversation as resolved.
Show resolved Hide resolved
working-directory: .actions/
run: |
grep 'pytest>' ../requirements/pytorch/test.txt | xargs -0 pip install
pip install pytest -q
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
Borda marked this conversation as resolved.
Show resolved Hide resolved
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
carmocca marked this conversation as resolved.
Show resolved Hide resolved
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
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
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`
Borda marked this conversation as resolved.
Show resolved Hide resolved

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
5 changes: 5 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 Down Expand Up @@ -39,6 +40,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
29 changes: 12 additions & 17 deletions src/lightning/__setup__.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,21 +30,16 @@ def _adjust_manifest(**kwargs: Any) -> None:
assert os.path.isfile(manifest_path)
with open(manifest_path) as fp:
lines = [ln.rstrip() for ln in fp.readlines()]
if kwargs["pkg_name"] == "lightning":
lines += [
"recursive-include src/lightning *.md",
"include requirements/base.txt",
# fixme: this is strange, this shall work with setup find package - include
"prune src/lightning_app",
"prune src/pytorch_lightning",
]
else:
lines += [
"recursive-include src *.md",
"recursive-include requirements *.txt",
"recursive-include src/lightning_app/ui *",
"recursive-include src/lightning_app/cli/*-template *", # Add templates as build-in
]
lines += [
"recursive-include src/lightning *.md",
"recursive-include requirements *.txt",
"recursive-include src/lightning/ui *",
"recursive-include src/lightning/cli/*-template *", # Add templates as build-in
# fixme: this is strange, this shall work with setup find package - include
"prune src/lightning_app",
"prune src/lightning_lite",
"prune src/pytorch_lightning",
]
with open(manifest_path, "w") as fp:
fp.writelines([ln + os.linesep for ln in lines])

Expand All @@ -55,12 +50,12 @@ def _setup_args(**kwargs: Any) -> Dict[str, Any]:
_long_description = _SETUP_TOOLS.load_readme_description(
_PROJECT_ROOT, homepage=_about.__homepage__, version=_version.version
)
_include_pkgs = ["lightning", "lightning.*"] if kwargs["pkg_name"] == "lightning" else ["*"]
_include_pkgs = ["lightning", "lightning.*"]

# TODO: consider invaliding some additional arguments from packages, for example if include data or safe to zip

# TODO: remove this once lightning-ui package is ready as a dependency
_SETUP_TOOLS._download_frontend(_PROJECT_ROOT)
_SETUP_TOOLS._download_frontend(os.path.join(_SOURCE_ROOT, "lightning", "app"))

return dict(
name="lightning",
Expand Down
2 changes: 1 addition & 1 deletion src/lightning/__version__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version = "YYYY.-M.-D"
version = "1.8.0rc0"
Loading