Skip to content

Commit

Permalink
refactor path to root preventing circular import (#18357)
Browse files Browse the repository at this point in the history
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
Borda and pre-commit-ci[bot] authored Aug 21, 2023
1 parent 3f73231 commit fbdbe63
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
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"
- "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"]

0 comments on commit fbdbe63

Please sign in to comment.