Skip to content
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
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ examples/old
publish.sh
dist/
.env
test_pipedef.py
atest_pipedef.py
7 changes: 6 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
15 changes: 2 additions & 13 deletions src/vip_client/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
from vip_client.classes import VipSession
10 changes: 1 addition & 9 deletions src/vip_client/classes/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
from vip_client.classes.VipClient import VipClient
4 changes: 2 additions & 2 deletions tests/test_VipCI.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions tests/test_VipLauncher.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down
4 changes: 2 additions & 2 deletions tests/test_VipSession.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion tests/test_global.py
Original file line number Diff line number Diff line change
@@ -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

Expand Down
2 changes: 1 addition & 1 deletion tests/test_vip_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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/'
Expand Down