diff --git a/.gitignore b/.gitignore index 6574c27..e26324d 100644 --- a/.gitignore +++ b/.gitignore @@ -8,4 +8,4 @@ examples/old publish.sh dist/ .env -test_pipedef.py +atest_pipedef.py diff --git a/pyproject.toml b/pyproject.toml index 17a54df..160d237 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -36,7 +36,12 @@ packages = ["src/vip_client"] [tool.hatch.version] path = "src/vip_client/__init__.py" +[tool.pytest.ini_options] +pythonpath = [ + "src" +] + [project.urls] Homepage = "https://vip.creatis.insa-lyon.fr" Source = "https://github.com/virtual-imaging-platform/VIP-python-client" -Tracker = "https://github.com/virtual-imaging-platform/VIP-python-client/issues" +Tracker = "https://github.com/virtual-imaging-platform/VIP-python-client/issues" \ No newline at end of file diff --git a/src/vip_client/__init__.py b/src/vip_client/__init__.py index 2ebe21e..001596c 100644 --- a/src/vip_client/__init__.py +++ b/src/vip_client/__init__.py @@ -8,18 +8,7 @@ """ # Informations -__version__ = "0.1.3" +__version__ = "0.1.4" __license__ = "CECILL-B" -# Import classes and packages to secure the namespace -if __package__ != "vip_client": - import sys - from pathlib import Path - SOURCE_ROOT = str(Path(__file__).parents[1]) # <=> /src/ - sys.path.append(SOURCE_ROOT) -# Run utils/__init__.py -import vip_client.utils -# Run classes/__init__.py -import vip_client.classes -# Shortcut to import the VipSession class -from vip_client.classes import VipSession \ No newline at end of file +from vip_client.classes import VipSession diff --git a/src/vip_client/classes/__init__.py b/src/vip_client/classes/__init__.py index 8274163..cc36a19 100644 --- a/src/vip_client/classes/__init__.py +++ b/src/vip_client/classes/__init__.py @@ -7,17 +7,9 @@ - VipLoader (planned): base class. """ -# Import classes and modules to secure the namespace -if __package__ != "vip_client.classes": - import sys - from pathlib import Path - SOURCE_ROOT = str(Path(__file__).parents[2]) # src/ - sys.path.append(SOURCE_ROOT) -# Import utilities -import vip_client.utils # Replace each class module by its class in the namespace from vip_client.classes.VipSession import VipSession from vip_client.classes.VipLauncher import VipLauncher from vip_client.classes.VipCI import VipCI from vip_client.classes.VipLoader import VipLoader -from vip_client.classes.VipClient import VipClient \ No newline at end of file +from vip_client.classes.VipClient import VipClient diff --git a/tests/test_VipCI.py b/tests/test_VipCI.py index 0c07205..92fa6b5 100644 --- a/tests/test_VipCI.py +++ b/tests/test_VipCI.py @@ -4,8 +4,8 @@ from pathlib import * import pytest_mock -from src.vip_client.utils import vip -from src.vip_client.classes import VipCI +from vip_client.utils import vip +from vip_client.classes import VipCI from mocked_services import mock_vip_api, mock_girder_client, mock_pathlib, mock_os from FakeGirderClient import FakeGirderClient diff --git a/tests/test_VipLauncher.py b/tests/test_VipLauncher.py index d5fe2a7..366fe86 100644 --- a/tests/test_VipLauncher.py +++ b/tests/test_VipLauncher.py @@ -2,8 +2,8 @@ import pytest from pathlib import * -from src.vip_client.utils import vip -from src.vip_client.classes import VipLauncher +from vip_client.utils import vip +from vip_client.classes import VipLauncher from mocked_services import mock_vip_api, mock_pathlib, mock_os diff --git a/tests/test_VipSession.py b/tests/test_VipSession.py index cc4fdaf..f1b2d9e 100644 --- a/tests/test_VipSession.py +++ b/tests/test_VipSession.py @@ -4,8 +4,8 @@ from pathlib import * import pytest_mock -from src.vip_client.utils import vip -from src.vip_client.classes import VipSession +from vip_client.utils import vip +from vip_client.classes import VipSession from mocked_services import mock_vip_api, mock_pathlib, mock_os def get_properties(obj) -> dict: diff --git a/tests/test_global.py b/tests/test_global.py index 1784bfd..d6beb14 100644 --- a/tests/test_global.py +++ b/tests/test_global.py @@ -1,4 +1,4 @@ -from src.vip_client.classes import VipSession, VipLauncher, VipCI +from vip_client.classes import VipSession, VipCI, VipLauncher from mocked_services import mock_vip_api, mock_pathlib, mock_os, mock_girder_client import pytest diff --git a/tests/test_vip_utils.py b/tests/test_vip_utils.py index f559c0e..683ec04 100644 --- a/tests/test_vip_utils.py +++ b/tests/test_vip_utils.py @@ -2,7 +2,7 @@ import time import os -from src.vip_client.utils.vip import * +from vip_client.utils.vip import * BASE_PATH_VIP = '/vip/Home/API/client_tests/' BASE_PATH_LOCAL = 'tests/data/'