arkitekt-next 0.13.0__py3-none-any.whl → 0.14.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of arkitekt-next might be problematic. Click here for more details.
- arkitekt_next/__blok__.py +4 -0
- arkitekt_next/__init__.py +1 -1
- arkitekt_next/app/__init__.py +3 -0
- arkitekt_next/{apps/protocols.py → app/app.py} +8 -4
- arkitekt_next/{apps/service/fakts_next.py → app/fakts.py} +7 -5
- arkitekt_next/bloks/admin.py +1 -1
- arkitekt_next/bloks/alpaka.py +74 -42
- arkitekt_next/bloks/arkitekt.py +4 -1
- arkitekt_next/bloks/gateway.py +6 -0
- arkitekt_next/bloks/l.py +136 -0
- arkitekt_next/bloks/livekit.py +4 -3
- arkitekt_next/bloks/lovekit.py +199 -0
- arkitekt_next/bloks/ollama.py +12 -7
- arkitekt_next/bloks/services/admin.py +5 -6
- arkitekt_next/bloks/services/livekit.py +6 -3
- arkitekt_next/bloks/services/ollama.py +7 -2
- arkitekt_next/bloks/services/secret.py +1 -3
- arkitekt_next/builders.py +10 -17
- arkitekt_next/cli/commands/inspect/implementations.py +1 -1
- arkitekt_next/cli/commands/inspect/requirements.py +1 -1
- arkitekt_next/cli/commands/kabinet/build.py +0 -1
- arkitekt_next/cli/commands/kabinet/types.py +3 -5
- arkitekt_next/cli/commands/run/dev.py +6 -22
- arkitekt_next/cli/commands/run/utils.py +6 -6
- arkitekt_next/cli/types.py +1 -2
- arkitekt_next/cli/ui.py +2 -2
- arkitekt_next/cli/utils.py +1 -1
- arkitekt_next/init_registry.py +32 -27
- arkitekt_next/protocols.py +7 -24
- arkitekt_next/qt/__init__.py +2 -2
- arkitekt_next/qt/builders.py +11 -118
- arkitekt_next/qt/magic_bar.py +1 -1
- arkitekt_next/qt/types.py +1 -1
- arkitekt_next/service_registry.py +13 -29
- arkitekt_next/utils.py +1 -1
- {arkitekt_next-0.13.0.dist-info → arkitekt_next-0.14.0.dist-info}/METADATA +2 -3
- {arkitekt_next-0.13.0.dist-info → arkitekt_next-0.14.0.dist-info}/RECORD +40 -45
- arkitekt_next/apps/__init__.py +0 -3
- arkitekt_next/apps/service/__init__.py +0 -3
- arkitekt_next/apps/service/fakts_qt.py +0 -57
- arkitekt_next/apps/service/grant_registry.py +0 -27
- arkitekt_next/apps/service/herre.py +0 -26
- arkitekt_next/apps/service/herre_qt.py +0 -57
- arkitekt_next/apps/service/local_fakts.py +0 -95
- arkitekt_next/base_models.py +0 -104
- {arkitekt_next-0.13.0.dist-info → arkitekt_next-0.14.0.dist-info}/WHEEL +0 -0
- {arkitekt_next-0.13.0.dist-info → arkitekt_next-0.14.0.dist-info}/entry_points.txt +0 -0
- {arkitekt_next-0.13.0.dist-info → arkitekt_next-0.14.0.dist-info}/licenses/LICENSE +0 -0
arkitekt_next/init_registry.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import contextvars
|
|
2
2
|
from functools import wraps
|
|
3
3
|
from typing import Callable, Dict, Optional, TypeVar, overload
|
|
4
|
-
from
|
|
4
|
+
from .app import App
|
|
5
5
|
|
|
6
6
|
Params = Dict[str, str]
|
|
7
7
|
|
|
@@ -11,25 +11,23 @@ current_init_hook_registry = contextvars.ContextVar(
|
|
|
11
11
|
)
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
|
|
15
14
|
InitHook = Callable[[App], None]
|
|
16
15
|
|
|
17
16
|
|
|
18
17
|
class InitHookRegistry:
|
|
19
|
-
"""
|
|
18
|
+
"""A registry for init hooks. This is used to register init hooks that
|
|
20
19
|
are called when the app is initialized. The init hooks are called in
|
|
21
20
|
the order they are registered
|
|
22
|
-
|
|
23
|
-
The purpose of init hooks is to allow specific initialization
|
|
24
|
-
code to be run when the app is initialized. This is useful if you
|
|
21
|
+
|
|
22
|
+
The purpose of init hooks is to allow specific initialization
|
|
23
|
+
code to be run when the app is initialized. This is useful if you
|
|
25
24
|
plan to add some custom configuration or setup code that needs to be
|
|
26
25
|
run before the app is getting conneted to the server.
|
|
27
|
-
|
|
26
|
+
|
|
28
27
|
"""
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
def __init__(self):
|
|
28
|
+
|
|
29
|
+
def __init__(self) -> None:
|
|
30
|
+
"""Initialize the InitHookRegistry."""
|
|
33
31
|
self.init_hooks: Dict[str, InitHook] = {}
|
|
34
32
|
self.cli_only_hooks: Dict[str, InitHook] = {}
|
|
35
33
|
|
|
@@ -38,18 +36,18 @@ class InitHookRegistry:
|
|
|
38
36
|
function: InitHook,
|
|
39
37
|
name: Optional[str] = None,
|
|
40
38
|
only_cli: bool = False,
|
|
41
|
-
):
|
|
42
|
-
"""
|
|
43
|
-
|
|
44
|
-
|
|
39
|
+
) -> None:
|
|
40
|
+
"""Register a function as an init hook. This function will be called
|
|
41
|
+
|
|
42
|
+
|
|
45
43
|
when the app is initialized. The init hooks are called in the order
|
|
46
|
-
|
|
47
|
-
|
|
44
|
+
|
|
45
|
+
|
|
48
46
|
"""
|
|
49
|
-
|
|
47
|
+
|
|
50
48
|
if name is None:
|
|
51
49
|
name = function.__name__
|
|
52
|
-
|
|
50
|
+
|
|
53
51
|
if only_cli:
|
|
54
52
|
if name not in self.cli_only_hooks:
|
|
55
53
|
self.cli_only_hooks[name] = function
|
|
@@ -61,10 +59,11 @@ class InitHookRegistry:
|
|
|
61
59
|
else:
|
|
62
60
|
raise ValueError(f"Init Hook {name} already registered")
|
|
63
61
|
|
|
64
|
-
def run_all(self, app: App, is_cli: bool = False):
|
|
62
|
+
def run_all(self, app: App, is_cli: bool = False) -> None:
|
|
63
|
+
""" Run all registered init hooks."""
|
|
65
64
|
for hook in self.init_hooks.values():
|
|
66
65
|
hook(app)
|
|
67
|
-
|
|
66
|
+
|
|
68
67
|
if is_cli:
|
|
69
68
|
for hook in self.cli_only_hooks.values():
|
|
70
69
|
hook(app)
|
|
@@ -78,7 +77,10 @@ def init(func: T) -> T: ...
|
|
|
78
77
|
|
|
79
78
|
|
|
80
79
|
@overload
|
|
81
|
-
def init(
|
|
80
|
+
def init(
|
|
81
|
+
*, only_cli: bool = False, init_hook_registry: InitHookRegistry | None = None
|
|
82
|
+
) -> Callable[[T], T]: ...
|
|
83
|
+
|
|
82
84
|
|
|
83
85
|
def init(
|
|
84
86
|
func: T | None = None,
|
|
@@ -96,7 +98,7 @@ def init(
|
|
|
96
98
|
|
|
97
99
|
def decorator(inner: T) -> T:
|
|
98
100
|
@wraps(inner)
|
|
99
|
-
def wrapped(app: App):
|
|
101
|
+
def wrapped(app: App) -> None:
|
|
100
102
|
return inner(app)
|
|
101
103
|
|
|
102
104
|
init_hook_registry.register(wrapped, only_cli=only_cli)
|
|
@@ -106,12 +108,15 @@ def init(
|
|
|
106
108
|
return decorator
|
|
107
109
|
|
|
108
110
|
|
|
109
|
-
|
|
110
111
|
GLOBAL_INIT_HOOK_REGISTRY = None
|
|
111
112
|
|
|
112
113
|
|
|
113
|
-
def get_default_init_hook_registry():
|
|
114
|
+
def get_default_init_hook_registry()-> InitHookRegistry:
|
|
115
|
+
"""Get the default init hook registry. This is used to register init hooks
|
|
116
|
+
that are called when the app is initialized. If no registry is set, a new
|
|
117
|
+
registry is created and returned.
|
|
118
|
+
"""
|
|
114
119
|
global GLOBAL_INIT_HOOK_REGISTRY
|
|
115
120
|
if GLOBAL_INIT_HOOK_REGISTRY is None:
|
|
116
|
-
GLOBAL_INIT_HOOK_REGISTRY = InitHookRegistry()
|
|
117
|
-
return GLOBAL_INIT_HOOK_REGISTRY
|
|
121
|
+
GLOBAL_INIT_HOOK_REGISTRY = InitHookRegistry() # type: ignore
|
|
122
|
+
return GLOBAL_INIT_HOOK_REGISTRY
|
arkitekt_next/protocols.py
CHANGED
|
@@ -9,14 +9,11 @@ an import exception to the app.
|
|
|
9
9
|
|
|
10
10
|
"""
|
|
11
11
|
|
|
12
|
-
from typing import Any, Protocol
|
|
12
|
+
from typing import Any, Protocol
|
|
13
13
|
import logging
|
|
14
14
|
from typing import Dict, TYPE_CHECKING
|
|
15
|
-
from koil import unkoil
|
|
16
15
|
from koil.composition import KoiledModel
|
|
17
|
-
from arkitekt_next.base_models import Manifest
|
|
18
16
|
from fakts_next import Fakts
|
|
19
|
-
from herre_next import Herre
|
|
20
17
|
|
|
21
18
|
|
|
22
19
|
if TYPE_CHECKING:
|
|
@@ -30,22 +27,16 @@ class App(Protocol):
|
|
|
30
27
|
"""An app that is built with the easy builder"""
|
|
31
28
|
|
|
32
29
|
fakts: Fakts
|
|
33
|
-
herre: Herre
|
|
34
|
-
manifest: Manifest
|
|
35
30
|
services: Dict[str, KoiledModel]
|
|
36
31
|
|
|
37
32
|
@property
|
|
38
33
|
def rekuest(self) -> "RekuestNext":
|
|
39
34
|
"""Get the rekuest service"""
|
|
40
|
-
|
|
41
|
-
raise ValueError("Rekuest service is not available")
|
|
42
|
-
return cast("RekuestNext", self.services["rekuest"])
|
|
35
|
+
...
|
|
43
36
|
|
|
44
|
-
def run(self):
|
|
45
|
-
return unkoil(self.rekuest.arun)
|
|
37
|
+
def run(self): ...
|
|
46
38
|
|
|
47
|
-
async def arun(self):
|
|
48
|
-
return await self.rekuest.arun()
|
|
39
|
+
async def arun(self): ...
|
|
49
40
|
|
|
50
41
|
def run_detached(self):
|
|
51
42
|
"""Run the app detached"""
|
|
@@ -53,19 +44,11 @@ class App(Protocol):
|
|
|
53
44
|
|
|
54
45
|
def register(self, *args, **kwargs):
|
|
55
46
|
"""Register a service"""
|
|
47
|
+
...
|
|
56
48
|
|
|
57
|
-
|
|
49
|
+
async def __aenter__(self): ...
|
|
58
50
|
|
|
59
|
-
async def
|
|
60
|
-
await super().__aenter__()
|
|
61
|
-
for service in self.services.values():
|
|
62
|
-
await service.__aenter__()
|
|
63
|
-
|
|
64
|
-
return self
|
|
65
|
-
|
|
66
|
-
async def __aexit__(self, exc_type, exc_value, traceback):
|
|
67
|
-
for service in self.services.values():
|
|
68
|
-
await service.__aexit__(exc_type, exc_value, traceback)
|
|
51
|
+
async def __aexit__(self, exc_type, exc_value, traceback): ...
|
|
69
52
|
|
|
70
53
|
|
|
71
54
|
class Builder(Protocol):
|
arkitekt_next/qt/__init__.py
CHANGED
|
@@ -9,7 +9,7 @@ to ArkitektNext, and configure settings.
|
|
|
9
9
|
"""
|
|
10
10
|
|
|
11
11
|
from .magic_bar import MagicBar
|
|
12
|
-
from .builders import
|
|
12
|
+
from .builders import qt
|
|
13
13
|
from .types import *
|
|
14
14
|
|
|
15
|
-
__all__ = ["MagicBar", "
|
|
15
|
+
__all__ = ["MagicBar", "qt", "QtApp"]
|
arkitekt_next/qt/builders.py
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
from arkitekt_next.
|
|
2
|
-
|
|
1
|
+
from arkitekt_next.app.fakts import (
|
|
2
|
+
build_device_code_fakts,
|
|
3
|
+
build_redeem_fakts,
|
|
4
|
+
build_token_fakts,
|
|
3
5
|
)
|
|
4
|
-
from arkitekt_next.apps.service.fakts_qt import build_arkitekt_next_qt_fakts_next
|
|
5
|
-
from arkitekt_next.apps.service.herre_qt import build_arkitekt_next_qt_herre_next
|
|
6
6
|
from arkitekt_next.utils import create_arkitekt_next_folder
|
|
7
|
-
from
|
|
8
|
-
from arkitekt_next.apps.protocols import App
|
|
7
|
+
from fakts_next.models import Manifest
|
|
9
8
|
from arkitekt_next.service_registry import (
|
|
10
9
|
ServiceBuilderRegistry,
|
|
11
10
|
get_default_service_registry,
|
|
@@ -15,26 +14,10 @@ from qtpy import QtWidgets, QtCore
|
|
|
15
14
|
from typing import List, Optional
|
|
16
15
|
import os
|
|
17
16
|
import logging
|
|
18
|
-
from typing import List, Optional
|
|
19
|
-
import logging
|
|
20
|
-
import os
|
|
21
17
|
from arkitekt_next.qt.types import QtApp
|
|
22
|
-
from arkitekt_next.apps.service.fakts_next import (
|
|
23
|
-
build_arkitekt_next_fakts_next,
|
|
24
|
-
build_arkitekt_next_redeem_fakts_next,
|
|
25
|
-
build_arkitekt_next_token_fakts_next,
|
|
26
|
-
)
|
|
27
|
-
from arkitekt_next.apps.service.herre import build_arkitekt_next_herre_next
|
|
28
|
-
from arkitekt_next.utils import create_arkitekt_next_folder
|
|
29
|
-
from arkitekt_next.base_models import Manifest
|
|
30
|
-
from arkitekt_next.apps.protocols import App
|
|
31
|
-
from arkitekt_next.service_registry import (
|
|
32
|
-
ServiceBuilderRegistry,
|
|
33
|
-
)
|
|
34
|
-
from arkitekt_next.constants import DEFAULT_ARKITEKT_URL
|
|
35
18
|
|
|
36
19
|
|
|
37
|
-
def
|
|
20
|
+
def qt(
|
|
38
21
|
identifier: str,
|
|
39
22
|
version: str = "0.0.1",
|
|
40
23
|
logo: Optional[str] = None,
|
|
@@ -131,31 +114,23 @@ def devqt(
|
|
|
131
114
|
description=description,
|
|
132
115
|
)
|
|
133
116
|
if token:
|
|
134
|
-
fakts_next =
|
|
117
|
+
fakts_next = build_token_fakts(
|
|
135
118
|
manifest=manifest,
|
|
136
119
|
token=token,
|
|
137
120
|
url=url,
|
|
138
121
|
)
|
|
139
122
|
|
|
140
123
|
elif redeem_token:
|
|
141
|
-
fakts_next =
|
|
142
|
-
manifest=manifest,
|
|
143
|
-
redeem_token=redeem_token,
|
|
144
|
-
url=url,
|
|
145
|
-
no_cache=no_cache,
|
|
146
|
-
headless=headless,
|
|
124
|
+
fakts_next = build_redeem_fakts(
|
|
125
|
+
manifest=manifest, redeem_token=redeem_token, url=url
|
|
147
126
|
)
|
|
148
127
|
else:
|
|
149
|
-
fakts_next =
|
|
128
|
+
fakts_next = build_device_code_fakts(
|
|
150
129
|
manifest=manifest,
|
|
151
130
|
url=url,
|
|
152
131
|
no_cache=no_cache,
|
|
153
|
-
headless=headless,
|
|
154
|
-
client_kind=app_kind,
|
|
155
132
|
)
|
|
156
133
|
|
|
157
|
-
herre_next = build_arkitekt_next_herre_next(fakts_next=fakts_next)
|
|
158
|
-
|
|
159
134
|
params = kwargs
|
|
160
135
|
|
|
161
136
|
create_arkitekt_next_folder(with_cache=True)
|
|
@@ -169,89 +144,7 @@ def devqt(
|
|
|
169
144
|
|
|
170
145
|
app = QtApp(
|
|
171
146
|
fakts=fakts_next,
|
|
172
|
-
|
|
173
|
-
manifest=manifest,
|
|
174
|
-
services=registry.build_service_map(
|
|
175
|
-
fakts=fakts_next, herre=herre_next, params=params, manifest=manifest
|
|
176
|
-
),
|
|
177
|
-
)
|
|
178
|
-
|
|
179
|
-
app.enter()
|
|
180
|
-
|
|
181
|
-
return app
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
def publicqt(
|
|
185
|
-
identifier: str,
|
|
186
|
-
version: str = "latest",
|
|
187
|
-
logo: Optional[str] = None,
|
|
188
|
-
scopes: Optional[List[str]] = None,
|
|
189
|
-
log_level: str = "ERROR",
|
|
190
|
-
registry: Optional[ServiceBuilderRegistry] = None,
|
|
191
|
-
parent: Optional[QtWidgets.QWidget] = None,
|
|
192
|
-
beacon_widget: Optional[QtWidgets.QWidget] = None,
|
|
193
|
-
login_widget: Optional[QtWidgets.QWidget] = None,
|
|
194
|
-
settings: Optional[QtCore.QSettings] = None,
|
|
195
|
-
**kwargs,
|
|
196
|
-
) -> QtApp:
|
|
197
|
-
"""Public QtApp creation
|
|
198
|
-
|
|
199
|
-
A simple way to create an Arkitekt app with a public grant (allowing users to sign
|
|
200
|
-
in with the application ) utlizing a retrieve grant (necessating a previous configuration
|
|
201
|
-
of the application on the server side)
|
|
202
|
-
|
|
203
|
-
Args:
|
|
204
|
-
identifier (str): The apps identifier
|
|
205
|
-
version (str, optional): The apps verion. Defaults to "latest".
|
|
206
|
-
parent (QtWidget, optional): The QtParent (for the login and server select widget). Defaults to None.
|
|
207
|
-
|
|
208
|
-
Returns:
|
|
209
|
-
Arkitekt: The Arkitekt app
|
|
210
|
-
"""
|
|
211
|
-
|
|
212
|
-
registry = registry or check_and_import_services()
|
|
213
|
-
|
|
214
|
-
settings = settings or QtCore.QSettings("arkitekt_next", f"{identifier}:{version}")
|
|
215
|
-
|
|
216
|
-
manifest = Manifest(
|
|
217
|
-
version=version,
|
|
218
|
-
identifier=identifier,
|
|
219
|
-
scopes=scopes if scopes else ["openid"],
|
|
220
|
-
logo=logo,
|
|
221
|
-
requirements=registry.get_requirements(),
|
|
222
|
-
)
|
|
223
|
-
|
|
224
|
-
fakts_next = build_arkitekt_next_qt_fakts_next(
|
|
225
|
-
manifest=manifest,
|
|
226
|
-
beacon_widget=beacon_widget,
|
|
227
|
-
parent=parent,
|
|
228
|
-
settings=settings,
|
|
229
|
-
)
|
|
230
|
-
|
|
231
|
-
herre_next = build_arkitekt_next_qt_herre_next(
|
|
232
|
-
manifest,
|
|
233
|
-
fakts=fakts_next,
|
|
234
|
-
login_widget=login_widget,
|
|
235
|
-
parent=parent,
|
|
236
|
-
settings=settings,
|
|
237
|
-
)
|
|
238
|
-
|
|
239
|
-
params = kwargs
|
|
240
|
-
|
|
241
|
-
try:
|
|
242
|
-
from rich.logging import RichHandler
|
|
243
|
-
|
|
244
|
-
logging.basicConfig(level=log_level, handlers=[RichHandler()])
|
|
245
|
-
except ImportError:
|
|
246
|
-
logging.basicConfig(level=log_level)
|
|
247
|
-
|
|
248
|
-
app = QtApp(
|
|
249
|
-
fakts=fakts_next,
|
|
250
|
-
herre=herre_next,
|
|
251
|
-
manifest=manifest,
|
|
252
|
-
services=registry.build_service_map(
|
|
253
|
-
fakts=fakts_next, herre=herre_next, params=params, manifest=manifest
|
|
254
|
-
),
|
|
147
|
+
services=registry.build_service_map(fakts=fakts_next, params=params),
|
|
255
148
|
)
|
|
256
149
|
|
|
257
150
|
app.enter()
|
arkitekt_next/qt/magic_bar.py
CHANGED
|
@@ -3,7 +3,7 @@ from qtpy import QtWidgets, QtGui, QtCore
|
|
|
3
3
|
from arkitekt_next.qt.types import QtApp
|
|
4
4
|
from koil.qt import async_to_qt
|
|
5
5
|
|
|
6
|
-
from arkitekt_next.
|
|
6
|
+
from arkitekt_next.app.app import App
|
|
7
7
|
from .utils import get_image_path
|
|
8
8
|
from typing import Optional, Callable
|
|
9
9
|
import logging
|
arkitekt_next/qt/types.py
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import contextvars
|
|
2
|
-
from herre_next import Herre
|
|
3
2
|
from fakts_next import Fakts
|
|
4
3
|
from koil.composition.base import KoiledModel
|
|
5
|
-
from .
|
|
4
|
+
from fakts_next.models import Manifest, Requirement
|
|
6
5
|
from typing import Any, Callable, Dict, Optional, Protocol, Set, TypeVar
|
|
7
6
|
from typing import runtime_checkable
|
|
8
7
|
from pydantic import BaseModel
|
|
@@ -18,7 +17,7 @@ current_service_registry = contextvars.ContextVar(
|
|
|
18
17
|
class Registration(BaseModel):
|
|
19
18
|
name: str
|
|
20
19
|
requirement: Requirement
|
|
21
|
-
builder: Callable[[
|
|
20
|
+
builder: Callable[[Fakts, Params], object]
|
|
22
21
|
schema_loader: Callable[[str], object]
|
|
23
22
|
|
|
24
23
|
|
|
@@ -30,9 +29,7 @@ class ArkitektService(Protocol):
|
|
|
30
29
|
"""
|
|
31
30
|
...
|
|
32
31
|
|
|
33
|
-
def build_service(
|
|
34
|
-
self, fakts: Fakts, herre: Herre, params: Params, manifest: Manifest
|
|
35
|
-
) -> Optional[KoiledModel]:
|
|
32
|
+
def build_service(self, fakts: Fakts, params: Params) -> Optional[KoiledModel]:
|
|
36
33
|
"""Build the service. This is used to build the service and return
|
|
37
34
|
the service instance. The service instance should be a KoiledModel
|
|
38
35
|
that is used to interact with the service.
|
|
@@ -70,9 +67,7 @@ class BaseArkitektService:
|
|
|
70
67
|
def get_service_name(self) -> str:
|
|
71
68
|
raise NotImplementedError("get_service_name not implemented")
|
|
72
69
|
|
|
73
|
-
def build_service(
|
|
74
|
-
self, fakts: Fakts, herre: Herre, params: Params, manifest: Manifest
|
|
75
|
-
) -> Optional[KoiledModel]:
|
|
70
|
+
def build_service(self, fakts: Fakts, params: Params) -> Optional[KoiledModel]:
|
|
76
71
|
raise NotImplementedError("build_service not implemented")
|
|
77
72
|
|
|
78
73
|
def get_requirements(self) -> list[Requirement]:
|
|
@@ -89,13 +84,7 @@ class BaseArkitektService:
|
|
|
89
84
|
return None
|
|
90
85
|
|
|
91
86
|
|
|
92
|
-
basic_requirements = [
|
|
93
|
-
Requirement(
|
|
94
|
-
key="lok",
|
|
95
|
-
service="live.arkitekt.lok",
|
|
96
|
-
description="An instance of ArkitektNext Lok to authenticate the user",
|
|
97
|
-
)
|
|
98
|
-
]
|
|
87
|
+
basic_requirements = []
|
|
99
88
|
|
|
100
89
|
|
|
101
90
|
class ServiceBuilderRegistry:
|
|
@@ -122,11 +111,9 @@ class ServiceBuilderRegistry:
|
|
|
122
111
|
def get(self, name: str) -> Optional[ArkitektService]:
|
|
123
112
|
return self.service_builders.get(name)
|
|
124
113
|
|
|
125
|
-
def build_service_map(
|
|
126
|
-
self, fakts: Fakts, herre: Herre, params: Params, manifest: Manifest
|
|
127
|
-
):
|
|
114
|
+
def build_service_map(self, fakts: Fakts, params: Params):
|
|
128
115
|
potentially_needed_services = {
|
|
129
|
-
name: service.build_service(fakts,
|
|
116
|
+
name: service.build_service(fakts, params)
|
|
130
117
|
for name, service in self.service_builders.items()
|
|
131
118
|
}
|
|
132
119
|
|
|
@@ -162,8 +149,6 @@ class ServiceBuilderRegistry:
|
|
|
162
149
|
return sorted_requirements
|
|
163
150
|
|
|
164
151
|
|
|
165
|
-
|
|
166
|
-
|
|
167
152
|
T = TypeVar("T")
|
|
168
153
|
|
|
169
154
|
|
|
@@ -174,25 +159,25 @@ def require(
|
|
|
174
159
|
service_registry: Optional[ServiceBuilderRegistry] = None,
|
|
175
160
|
) -> Requirement:
|
|
176
161
|
"""Register a requirement with the service registry
|
|
177
|
-
|
|
162
|
+
|
|
178
163
|
Parameters
|
|
179
164
|
----------
|
|
180
165
|
key : str
|
|
181
166
|
The key for the requirement. This should be unique across all
|
|
182
167
|
requirements.
|
|
183
|
-
|
|
168
|
+
|
|
184
169
|
service : str
|
|
185
170
|
The service that you require. This should be a uinque fakts
|
|
186
171
|
service name. I.e `live.arkitekt.lok` or `live.arkitekt.lok:0.0.1`
|
|
187
|
-
|
|
172
|
+
|
|
188
173
|
description : str | None
|
|
189
174
|
The description for the requirement. This should be a short
|
|
190
175
|
description of the requirement that gets displayed to the user.
|
|
191
|
-
|
|
176
|
+
|
|
192
177
|
service_registry : ServiceBuilderRegistry | None
|
|
193
178
|
The service registry to register the requirement with. If
|
|
194
179
|
None, the default service registry will be used.
|
|
195
|
-
|
|
180
|
+
|
|
196
181
|
Returns
|
|
197
182
|
-------
|
|
198
183
|
Requirement
|
|
@@ -208,12 +193,11 @@ def require(
|
|
|
208
193
|
return requirement
|
|
209
194
|
|
|
210
195
|
|
|
211
|
-
|
|
212
196
|
GLOBAL_SERVICE_REGISTRY = None
|
|
213
197
|
|
|
214
198
|
|
|
215
199
|
def get_default_service_registry() -> "ServiceBuilderRegistry":
|
|
216
200
|
global GLOBAL_SERVICE_REGISTRY
|
|
217
201
|
if GLOBAL_SERVICE_REGISTRY is None:
|
|
218
|
-
GLOBAL_SERVICE_REGISTRY = ServiceBuilderRegistry()
|
|
202
|
+
GLOBAL_SERVICE_REGISTRY = ServiceBuilderRegistry() # type: ignore
|
|
219
203
|
return GLOBAL_SERVICE_REGISTRY
|
arkitekt_next/utils.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: arkitekt-next
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.14.0
|
|
4
4
|
Summary: client for the arkitekt_next platform
|
|
5
5
|
Author-email: jhnnsrs <jhnnsrs@gmail.com>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -8,8 +8,7 @@ License-File: LICENSE
|
|
|
8
8
|
Requires-Python: <4,>=3.11
|
|
9
9
|
Requires-Dist: click>=8.2.0
|
|
10
10
|
Requires-Dist: dokker>=2.1.2
|
|
11
|
-
Requires-Dist: fakts-next>=
|
|
12
|
-
Requires-Dist: herre-next>=1.3
|
|
11
|
+
Requires-Dist: fakts-next>=2
|
|
13
12
|
Requires-Dist: kabinet>=0.5
|
|
14
13
|
Requires-Dist: koil>=2.0.4
|
|
15
14
|
Requires-Dist: rath>=3.4
|