Skip to content

Commit e729db2

Browse files
committed
remove dev features completely from client. was done in e2e tests in #206
1 parent 795182b commit e729db2

File tree

4 files changed

+2
-34
lines changed

4 files changed

+2
-34
lines changed

clients/python/src/osparc/_api_files_api.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
DEFAULT_TIMEOUT_SECONDS,
3434
PaginationGenerator,
3535
compute_sha256,
36-
dev_features_enabled,
3736
file_chunk_generator,
3837
)
3938

@@ -60,11 +59,6 @@ def __init__(self, api_client: ApiClient):
6059
else None
6160
)
6261

63-
def __getattr__(self, name: str) -> Any:
64-
if (name in FilesApi._dev_features) and (not dev_features_enabled()):
65-
raise NotImplementedError(f"FilesApi.{name} is still under development")
66-
return super().__getattribute__(name)
67-
6862
def download_file(
6963
self,
7064
file_id: str,

clients/python/src/osparc/_api_solvers_api.py

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Wraps osparc_client.api.solvers_api
22

3-
from typing import Any, List, Optional
3+
from typing import List, Optional
44

55
import httpx
66
from osparc_client.api.solvers_api import SolversApi as _SolversApi
@@ -12,8 +12,6 @@
1212
_DEFAULT_PAGINATION_LIMIT,
1313
_DEFAULT_PAGINATION_OFFSET,
1414
PaginationGenerator,
15-
dev_feature,
16-
dev_features_enabled,
1715
)
1816

1917
import warnings
@@ -41,11 +39,6 @@ def __init__(self, api_client: ApiClient):
4139
else None
4240
)
4341

44-
def __getattr__(self, name: str) -> Any:
45-
if (name in SolversApi._dev_features) and (not dev_features_enabled()):
46-
raise NotImplementedError(f"SolversApi.{name} is still under development")
47-
return super().__getattribute__(name)
48-
4942
def list_solver_ports(
5043
self, solver_key: str, version: str, **kwargs
5144
) -> List[SolverPort]:
@@ -54,7 +47,6 @@ def list_solver_ports(
5447
)
5548
return page.items if page.items else []
5649

57-
@dev_feature
5850
def iter_jobs(self, solver_key: str, version: str, **kwargs) -> PaginationGenerator:
5951
"""Returns an iterator through which one can iterate over
6052
all Jobs submitted to the solver
@@ -87,7 +79,6 @@ def _pagination_method():
8779
auth=self._auth,
8880
)
8981

90-
@dev_feature
9182
def jobs(self, solver_key: str, version: str, **kwargs) -> PaginationGenerator:
9283
warnings.warn(
9384
"The 'jobs' method is deprecated and will be removed in a future version. "

clients/python/src/osparc/_api_studies_api.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import logging
55
from pathlib import Path
66
from tempfile import mkdtemp
7-
from typing import Any, Optional
7+
from typing import Optional
88

99
import httpx
1010
from .models import JobInputs, JobLogsMap, PageStudy
@@ -18,7 +18,6 @@
1818
_DEFAULT_PAGINATION_LIMIT,
1919
_DEFAULT_PAGINATION_OFFSET,
2020
PaginationGenerator,
21-
dev_features_enabled,
2221
)
2322
import warnings
2423

@@ -58,11 +57,6 @@ def __init__(self, api_client: ApiClient):
5857
else None
5958
)
6059

61-
def __getattr__(self, name: str) -> Any:
62-
if (name in StudiesApi._dev_features) and (not dev_features_enabled()):
63-
raise NotImplementedError(f"StudiesApi.{name} is still under development")
64-
return super().__getattribute__(name)
65-
6660
def create_study_job(self, study_id: str, job_inputs: JobInputs, **kwargs):
6761
kwargs = {**kwargs, **ParentProjectInfo().model_dump(exclude_none=True)}
6862
return super().create_study_job(study_id, job_inputs, **kwargs)

clients/python/src/osparc/_utils.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import asyncio
22
import hashlib
33
import os
4-
from functools import wraps
54
from pathlib import Path
65
from typing import AsyncGenerator, Callable, Generator, Optional, Tuple, TypeVar, Union
76

@@ -123,13 +122,3 @@ async def compute_sha256(file: Path) -> str:
123122

124123
def dev_features_enabled() -> bool:
125124
return os.environ.get("OSPARC_DEV_FEATURES_ENABLED") == "1"
126-
127-
128-
def dev_feature(func: Callable):
129-
@wraps(func)
130-
def _wrapper(*args, **kwargs):
131-
if not dev_features_enabled():
132-
raise NotImplementedError(f"{func.__name__} is still under development")
133-
return func(*args, **kwargs)
134-
135-
return _wrapper

0 commit comments

Comments
 (0)