pkg: include lite in PL (#14536)

* pkg: include lite in PL
* Apply suggestions from code review
* ci: nb dirs

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Carlos Mocholí <carlossmocholi@gmail.com>
This commit is contained in:
Jirka Borovec 2022-09-05 15:18:38 +02:00 committed by GitHub
parent f3d4d83462
commit 6773df9387
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 20 additions and 2 deletions

View File

@ -5,6 +5,10 @@ inputs:
pkg-name:
description: package name inside lightning.*
required: true
nb-dirs:
description: nb of packages in the wrap/distribution
required: false
default: "1"
runs:
using: "composite"
@ -54,7 +58,7 @@ runs:
# list folders without ending .egg-info
dirs = [d for d in glob.glob(os.path.join("*", "src", "*")) if not d.endswith(".egg-info")]
print(dirs)
assert len(dirs) == 1
assert len(dirs) == ${{ inputs.nb-dirs }}
# cleaning
shutil.rmtree(pathlib.Path(dirs[0]).parent.parent)
shell: python

View File

@ -49,9 +49,11 @@ jobs:
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:

View File

@ -53,6 +53,10 @@ def _adjust_manifest(**__: Any) -> None:
lines += [
"recursive-exclude src *.md" + os.linesep,
"recursive-exclude requirements *.txt" + os.linesep,
# TODO: remove after the first standalone Lite release
"recursive-include requirements/lite *.txt" + os.linesep,
# TODO: remove after the first standalone Lite release
"recursive-include src/lightning_lite *.md" + os.linesep,
"recursive-include src/pytorch_lightning *.md" + os.linesep,
"recursive-include requirements/pytorch *.txt" + os.linesep,
"include src/pytorch_lightning/py.typed" + os.linesep, # marker file for PEP 561
@ -78,7 +82,15 @@ def _setup_args(**__: Any) -> Dict[str, Any]:
url=_about.__homepage__,
download_url="https://github.com/Lightning-AI/lightning",
license=_about.__license__,
packages=find_packages(where="src", include=["pytorch_lightning", "pytorch_lightning.*"]),
packages=find_packages(
where="src",
include=[
"pytorch_lightning",
"pytorch_lightning.*",
"lightning_lite", # TODO: remove after the first standalone Lite release
"lightning_lite.*", # TODO: remove after the first standalone Lite release
],
),
package_dir={"": "src"},
include_package_data=True,
long_description=_long_description,