Skip to content

Commit

Permalink
Lightning: make type hints public (#17100)
Browse files Browse the repository at this point in the history
* Add missing MANIFESTs

* move

* one more

* Ignore version.info properly

* move

* manifest

---------

Co-authored-by: Carlos Mocholí <[email protected]>
Co-authored-by: Jirka Borovec <[email protected]>
Co-authored-by: Jirka <[email protected]>
Co-authored-by: Adrian Wälchli <[email protected]>
(cherry picked from commit 3d7360a)
  • Loading branch information
adamjstewart authored and Borda committed May 9, 2023
1 parent f8c1499 commit b314ee8
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 6 deletions.
8 changes: 4 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -53,17 +53,17 @@ wheels/
.installed.cfg
*.egg
src/*/version.info
src/lightning_app/
src/lightning_fabric/
src/pytorch_lightning/
src/lightning_app/*
src/lightning_fabric/*
src/pytorch_lightning/*
!src/*/__about__.py
!src/*/__main__.py
!src/*/__setup__.py
!src/*/__version__.py
!src/*/MANIFEST.in
!src/*/py.typed
!src/*/README.md
!src/*/*.info
!src/*/shell-folder_code-lives-lightning.info

# PyInstaller
# Usually these files are written by a python script from a template
Expand Down
6 changes: 5 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,11 @@ def _set_manifest_path(manifest_dir: str, aggregate: bool = False, mapping: Mapp
if aggregate:
# aggregate all MANIFEST.in contents into a single temporary file
manifest_path = _named_temporary_file(manifest_dir)
lines = ["include src/lightning/version.info\n", "include requirements/base.txt\n"]
lines = [
"include src/lightning/version.info\n",
"include src/lightning/py.typed\n",
"include requirements/base.txt\n",
]
# load manifest and aggregated all manifests
for pkg in mapping.values():
pkg_manifest = os.path.join(_PATH_SRC, pkg, "MANIFEST.in")
Expand Down
2 changes: 1 addition & 1 deletion src/lightning/app/cli/lightning_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,7 @@ def ssh(app_name: Optional[str] = None, component_name: Optional[str] = None) ->
raise click.ClickException(
"Unable to find the ssh binary. You must install ssh first to use this functionality."
)
os.execv(ssh_path, ["-tt", f"{component_id}@{ssh_endpoint}"]) # noqa: S606
os.execv(ssh_path, ["-tt", f"{component_id}@{ssh_endpoint}"])


@_main.group()
Expand Down
Empty file added src/lightning/py.typed
Empty file.
1 change: 1 addition & 0 deletions src/lightning_app/MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ recursive-include src/lightning_app/cli/*-template *
# TODO: remove this once lightning-ui package is ready as a dependency
recursive-include src/lightning_app/ui *
include src/lightning_app/components/serve/catimage.png
include src/lightning_app/py.typed # marker file for PEP 561
Empty file added src/lightning_app/py.typed
Empty file.
1 change: 1 addition & 0 deletions src/lightning_fabric/MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ include src/lightning_fabric/CHANGELOG.md
include src/lightning_fabric/README.md
recursive-include requirements/fabric *.txt
include .actions/assistant.py
include src/lightning_fabric/py.typed # marker file for PEP 561
Empty file added src/lightning_fabric/py.typed
Empty file.

0 comments on commit b314ee8

Please sign in to comment.