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

Moving lightning_api_access out of base requirements #15844

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 0 additions & 1 deletion requirements/app/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,3 @@ beautifulsoup4>=4.8.0, <4.11.2
inquirer>=2.10.0
psutil<5.9.4
click<=8.1.3
lightning_api_access>=0.0.3
2 changes: 2 additions & 0 deletions requirements/app/components.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# deps required by components in the lightning app repository (src/lightning_app/components)
lightning_api_access>=0.0.3
3 changes: 3 additions & 0 deletions requirements/app/devel.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,7 @@
# extended list of dependencies for UI
-r ./ui.txt

# extended list of dependencies for UI
-r ./components.txt

-r ./examples.txt
10 changes: 8 additions & 2 deletions src/lightning_app/components/serve/python_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import uvicorn
from fastapi import FastAPI
from lightning_utilities.core.imports import module_available
from pydantic import BaseModel
from starlette.staticfiles import StaticFiles

Expand All @@ -17,9 +18,14 @@

logger = Logger(__name__)

__doctest_skip__ = []
# Skip doctests if requirements aren't available
if not module_available("lightning_api_access"):
__doctest_skip__ += ["PythonServer", "PythonServer.*"]

# Skip doctests if requirements aren't available
if not _is_torch_available():
__doctest_skip__ = ["PythonServer", "PythonServer.*"]
__doctest_skip__ += ["PythonServer", "PythonServer.*"]


class _PyTorchSpawnRunExecutor(WorkRunExecutor):
Expand Down Expand Up @@ -90,7 +96,7 @@ def _get_sample_data() -> Dict[Any, Any]:


class PythonServer(LightningWork, abc.ABC):
@requires("torch")
@requires(["torch", "lightning_api_access"])
def __init__( # type: ignore
self,
host: str = "127.0.0.1",
Expand Down