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

refactor path to root preventing circular import #18357

Merged
merged 10 commits into from
Aug 21, 2023
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
5 changes: 5 additions & 0 deletions .github/workflows/ci-tests-store.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ on:
paths:
- ".actions/*"
- "requirements/store/**"
- "src/lightning/__about__.py"
- "src/lightning/__init__.py"
- "src/lightning/__main__.py"
- "src/lightning/__setup__.py"
- "src/lightning/__version__.py"
Borda marked this conversation as resolved.
Show resolved Hide resolved
- "src/lightning/store/**"
- "tests/tests_store/**"
- "pyproject.toml" # includes pytest config
Expand Down
5 changes: 1 addition & 4 deletions src/lightning/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""Root package info."""
import logging
import os

# explicitly don't set root logger's propagation and leave this to subpackages to manage
_logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -29,9 +28,7 @@
from lightning.pytorch.trainer import Trainer # noqa: E402

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

lightning.app._PROJECT_ROOT = os.path.dirname(lightning.app._PROJECT_ROOT)
import lightning.store # isort: skip # noqa: E402, F401


__all__ = [
Expand Down
3 changes: 3 additions & 0 deletions src/lightning/app/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,8 @@

_PACKAGE_ROOT = os.path.dirname(__file__)
_PROJECT_ROOT = os.path.dirname(os.path.dirname(_PACKAGE_ROOT))
if __package_name__ == "lightning":
_PACKAGE_ROOT = os.path.dirname(_PACKAGE_ROOT)
_PROJECT_ROOT = os.path.dirname(_PROJECT_ROOT)

__all__ = ["LightningApp", "LightningFlow", "LightningWork", "LightningPlugin", "BuildConfig", "CloudCompute"]
Loading