From 2a70e93bff1823d7e9f9a824654422116f2554e5 Mon Sep 17 00:00:00 2001 From: Tibi Daniel Date: Wed, 1 Apr 2026 12:32:07 +0200 Subject: [PATCH 1/2] Install STL package warning --- tests/test_2D_FFT_Torch.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/test_2D_FFT_Torch.py b/tests/test_2D_FFT_Torch.py index e9a4fef..7c04220 100644 --- a/tests/test_2D_FFT_Torch.py +++ b/tests/test_2D_FFT_Torch.py @@ -14,6 +14,7 @@ print(f"Parent directory already in sys.path: ...\\{PARENT_DIR.name}") DATA_TEST_PATH = Path(__file__).parent.parent / "data" / "test" +import STL_main from STL_main.STL_2D_FFT_Torch import STL_2D_FFT_Torch as DataClass From c65135bb1e80239fc86f5dc3aad5ac94b1899308 Mon Sep 17 00:00:00 2001 From: Tibi Daniel Date: Wed, 1 Apr 2026 12:35:21 +0200 Subject: [PATCH 2/2] Add STL package installation warning --- .github/workflows/ci.yaml | 3 ++- STL_main/__init__.py | 13 +++++++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index ed155de..9187348 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -29,7 +29,8 @@ jobs: python -m pip install --upgrade pip pip install -r requirements.txt pip install pytest pytest-cov - + pip install . + - name: Run tests run: | pytest --cov=STL_main tests/ diff --git a/STL_main/__init__.py b/STL_main/__init__.py index ab09bc6..4cc0f26 100644 --- a/STL_main/__init__.py +++ b/STL_main/__init__.py @@ -1,3 +1,12 @@ -from importlib.metadata import version +import warnings +from importlib.metadata import PackageNotFoundError, version -__version__ = version("STL") +try: + __version__ = version("STL") +except PackageNotFoundError: + __version__ = None + + warnings.warn( + "In development mode: Please run 'pip install -e .' in the root directory of the STL repository to properly install the package, its dependencies and enable proper version tracking.", + UserWarning, + )