arkitekt-next 0.8.2__py3-none-any.whl → 0.8.4__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/builders.py CHANGED
@@ -11,7 +11,7 @@ from arkitekt_next.apps.service.herre import build_arkitekt_next_herre
11
11
  from .utils import create_arkitekt_next_folder
12
12
  from .model import Manifest
13
13
  from .apps.types import App
14
- from .service_registry import ServiceBuilderRegistry, check_and_import_services
14
+ from .service_registry import ServiceBuilderRegistry, check_and_import_services, check_and_return_already_imported_services
15
15
  from arkitekt_next.constants import DEFAULT_ARKITEKT_URL
16
16
 
17
17
 
@@ -96,7 +96,7 @@ def easy(
96
96
  NextApp
97
97
  A built app, that can be used to interact with the ArkitektNext server
98
98
  """
99
- registry = registry or check_and_import_services()
99
+ registry = registry or check_and_return_already_imported_services()
100
100
 
101
101
  url = os.getenv("FAKTS_URL", url)
102
102
  token = os.getenv("FAKTS_TOKEN", token)
@@ -3,11 +3,11 @@ from arkitekt_next.cli.options import *
3
3
  import asyncio
4
4
  from arkitekt_next.cli.ui import construct_run_panel
5
5
  from importlib import import_module
6
- from rekuest.postmans.utils import arkiuse
6
+ from rekuest_next.postmans.utils import arkiuse
7
7
  from arkitekt_next.cli.utils import import_builder
8
- from rekuest.api.schema import (
8
+ from rekuest_next.api.schema import (
9
9
  NodeKind,
10
- ReserveBindsInput,
10
+ BindsInput
11
11
  )
12
12
  from rich.table import Table
13
13
  from rich.console import Console
@@ -21,45 +21,7 @@ async def call_app(
21
21
  arg: Dict[str, Any],
22
22
  ):
23
23
  async with app:
24
- await app.rekuest.agent.aregister_definitions()
25
-
26
- run_task = asyncio.create_task(app.rekuest.run())
27
-
28
- template = app.rekuest.agent.interface_template_map[template_string]
29
-
30
- async with arkiuse(
31
- hash=template.node.hash,
32
- binds=ReserveBindsInput(templates=[template.id], clients=[]),
33
- postman=app.rekuest.postman,
34
- ) as a:
35
- if template.node.kind == NodeKind.GENERATOR:
36
- async for i in a.astream(kwargs=arg):
37
- table = Table(title=f"Yields of {template.node.name}")
38
- table.add_column("key")
39
- table.add_column("value")
40
-
41
- for key, value in i.items():
42
- table.add_row(key, value)
43
-
44
- console.print(table)
45
-
46
- else:
47
- i = await a.aassign(kwargs=arg)
48
- table = Table(title=f"Returns of {template.node.name}")
49
- table.add_column("key")
50
- table.add_column("value")
51
-
52
- for key, value in i.items():
53
- table.add_row(key, value)
54
-
55
- console.print(table)
56
-
57
- run_task.cancel()
58
-
59
- try:
60
- await run_task
61
- except asyncio.CancelledError:
62
- pass
24
+ raise NotImplementedError("Not implemented yet")
63
25
 
64
26
 
65
27
  @click.command("prod")
@@ -36,13 +36,10 @@ def requirements(
36
36
  machine_readable: bool,
37
37
  builder: str = "arkitekt_next.builders.easy",
38
38
  ):
39
- """Runs the app in production mode
39
+ """Checks the requirements of the app
40
40
 
41
41
  \n
42
- You can specify the builder to use with the --builder flag. By default, the easy builder is used, which is designed to be easy to use and to get started with.
43
-
44
42
  """
45
- from rekuest.definition.registry import get_default_definition_registry
46
43
 
47
44
  manifest = get_manifest(ctx)
48
45
  console = get_console(ctx)
@@ -70,7 +67,7 @@ def requirements(
70
67
  )
71
68
 
72
69
  x = {
73
- key: item.dict(by_alias=True) for key, item in app.manifest.requirements.items()
70
+ key: item.model_dump(by_alias=True) for key, item in app.manifest.requirements.items()
74
71
  }
75
72
  if machine_readable:
76
73
  print("--START_REQUIREMENTS--" + json.dumps(x) + "--END_REQUIREMENTS--")
@@ -42,7 +42,7 @@ def templates(
42
42
  You can specify the builder to use with the --builder flag. By default, the easy builder is used, which is designed to be easy to use and to get started with.
43
43
 
44
44
  """
45
- from rekuest.definition.registry import get_default_definition_registry
45
+
46
46
 
47
47
  manifest = get_manifest(ctx)
48
48
  console = get_console(ctx)
@@ -87,7 +87,6 @@ def publish(ctx: Context, build: str, tag: str) -> None:
87
87
  deployment_run,
88
88
  build_model,
89
89
  tag,
90
- definitions=[],
91
90
  )
92
91
 
93
92
  md = Panel(
@@ -8,8 +8,8 @@ from watchfiles.filters import PythonFilter
8
8
  import os
9
9
  import sys
10
10
  import inspect
11
- from rekuest.definition.registry import get_default_definition_registry
12
- from rekuest.agents.hooks import get_default_hook_registry
11
+ from rekuest_next.definition.registry import get_default_definition_registry
12
+ from rekuest_next.agents.hooks import get_default_hook_registry
13
13
  from typing import MutableSet, Tuple, Any, Set
14
14
  from arkitekt_next.cli.ui import construct_changes_group, construct_app_group
15
15
  from arkitekt_next.cli.commands.run.utils import import_builder
@@ -109,3 +109,72 @@ def check_and_import_services() -> ServiceBuilderRegistry:
109
109
  traceback.print_exc()
110
110
 
111
111
  return service_builder_registry
112
+
113
+
114
+ def check_and_return_already_imported_services() -> ServiceBuilderRegistry:
115
+ service_builder_registry = ServiceBuilderRegistry()
116
+
117
+ # Function to load and call init_services from __arkitekt__.py
118
+ def load_and_call_init_services(module_name, arkitekt_path):
119
+ try:
120
+ # Compute the full module name of the __arkitekt__ module
121
+ arkitekt_module_name = f"{module_name}.__arkitekt__"
122
+
123
+
124
+ # Create a module spec
125
+ spec = importlib.util.spec_from_file_location(
126
+ arkitekt_module_name, arkitekt_path
127
+ )
128
+ arkitekt_module = importlib.util.module_from_spec(spec)
129
+
130
+ # Execute the module
131
+ spec.loader.exec_module(arkitekt_module)
132
+
133
+ # Now call init_services
134
+ if hasattr(arkitekt_module, "init_services"):
135
+ arkitekt_module.init_services(service_builder_registry)
136
+ logging.info(f"Called init_services function from {arkitekt_module_name}")
137
+ else:
138
+ logging.debug(f"No init_services function in {arkitekt_module_name}. Skipping.")
139
+ except Exception as e:
140
+ logging.critical(f"Failed to call init_services for {module_name}: {e}")
141
+ traceback.print_exc()
142
+
143
+ # Create a static list of sys.modules items to avoid RuntimeError
144
+ imported_modules = list(sys.modules.items())
145
+
146
+ # Keep track of processed top-level modules to avoid duplicates
147
+ processed_modules = set()
148
+
149
+ # Iterate over currently imported modules
150
+ for module_name, module in imported_modules:
151
+ if module is None:
152
+ continue
153
+
154
+ # Get the top-level parent module name
155
+ top_level_module_name = module_name.split('.')[0]
156
+
157
+ # Avoid processing the same top-level module multiple times
158
+ if top_level_module_name in processed_modules:
159
+ continue # Already processed
160
+
161
+ # Get the module from sys.modules
162
+ top_level_module = sys.modules.get(top_level_module_name)
163
+ if top_level_module is None:
164
+ continue
165
+
166
+ # Get the module's file location
167
+ module_file = getattr(top_level_module, '__file__', None)
168
+ if not module_file:
169
+ continue # Skip modules without a file attribute
170
+
171
+ # Get the module's directory
172
+ module_dir = os.path.dirname(module_file)
173
+ arkitekt_path = os.path.join(module_dir, '__arkitekt__.py')
174
+
175
+ # Check if __arkitekt__.py exists in the top-level module directory
176
+ if os.path.isfile(arkitekt_path):
177
+ load_and_call_init_services(top_level_module_name, arkitekt_path)
178
+ processed_modules.add(top_level_module_name)
179
+
180
+ return service_builder_registry
arkitekt_next/tqdm.py CHANGED
@@ -2,7 +2,7 @@
2
2
  assignation context"""
3
3
 
4
4
  from tqdm import tqdm as _tqdm
5
- from rekuest.actors.vars import current_assignation_helper
5
+ from rekuest_next.actors.vars import current_assignation_helper
6
6
 
7
7
 
8
8
  class tqdm(_tqdm):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: arkitekt-next
3
- Version: 0.8.2
3
+ Version: 0.8.4
4
4
  Summary: client for the arkitekt_next platform
5
5
  License: MIT
6
6
  Author: jhnnsrs
@@ -1,11 +1,7 @@
1
1
  arkitekt_next/__blok__.py,sha256=gQqlPrUPSeB-b3XkvXRwDoRWMfG-vYN-3a2pWHNjz_E,1563
2
2
  arkitekt_next/__init__.py,sha256=JOSPhxNLlQeHbwDI6HWYvuFqPJoh9Iz8okvbVl8jmU8,1545
3
3
  arkitekt_next/apps/__init__.py,sha256=cx_5Y-RkJFkSQJH-hUEC_L3eW1jU2E426c4e6_csIyM,42
4
- arkitekt_next/apps/easy.py,sha256=Nz7LzGua01bmLBiniEvnaSx_WPaNxq_sla4wYyTLaKQ,3235
5
- arkitekt_next/apps/next.py,sha256=GF4RPwJZ1Lyhcwf_EEZvrWvu5gD6NgD0UHnM1Vxmnmk,1049
6
- arkitekt_next/apps/qt.py,sha256=0y3TV0T2OtIgMJBbsdhNR5jZmyEHBFd1-ZmONz67omo,3306
7
4
  arkitekt_next/apps/service/__init__.py,sha256=p4iRwiFBKRq2lfbjDBzUR_GMhPWjkjWTa01ohuKz_L4,157
8
- arkitekt_next/apps/service/fakts.py,sha256=72EYMeO-M1O9auZ509FA7m08pSIZ-Df_6JyNHL1iMt0,2633
9
5
  arkitekt_next/apps/service/fakts_next.py,sha256=3Mh8CLt91Zf5Kt04mPr74ROj15jS2j3PoaUcT6kwJPY,2791
10
6
  arkitekt_next/apps/service/fakts_qt.py,sha256=ba7Er9EZeeR9loScbzLn_Fe7AqL3ksJBcAGd9QzjHcs,3053
11
7
  arkitekt_next/apps/service/grant_registry.py,sha256=3om8YoVf_HFWEJbpjQCin1Zvm8Sz3yw-mGvLKDDgbrc,851
@@ -47,10 +43,10 @@ arkitekt_next/bloks/services/secret.py,sha256=cnZsH09gN9YRXBbmalZaFD2LcmWLlfm52m
47
43
  arkitekt_next/bloks/services/socket.py,sha256=3MbENiJrwQbFKrpWxax56F24elnSD7S-olgycfuOX7s,423
48
44
  arkitekt_next/bloks/socket.py,sha256=IW4954Hgms_oZsDIk9SgLoVGz07gW3sHi7-WuhN074Q,1067
49
45
  arkitekt_next/bloks/tailscale.py,sha256=87cJv9m7N_I3y2ZRvv5WVepRhvIZk4ftUpwa0yUdwj4,2961
50
- arkitekt_next/builders.py,sha256=mzyvhDI9u73_6sn2tGL-ZJh7PwdL_M8PIKqPqgzd4z0,7273
46
+ arkitekt_next/builders.py,sha256=QtDYYcv6_73iCrZIctyyrvhnAD9_SnUa3w7eU_0e2s0,7334
51
47
  arkitekt_next/cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
52
48
  arkitekt_next/cli/commands/call/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
53
- arkitekt_next/cli/commands/call/local.py,sha256=YDummInGSb6lGKGiTlMSuXbE-Sz6dbfng6CsZaChCew,3338
49
+ arkitekt_next/cli/commands/call/local.py,sha256=XkNa2WGLf7YczRobjnQSWhRCtt6fs--2qeIa6tTMUvY,2114
54
50
  arkitekt_next/cli/commands/call/main.py,sha256=SdxlvSgA17-M_gwItiFU_srbh-CNdHpCTv_DkpOLojE,500
55
51
  arkitekt_next/cli/commands/call/remote.py,sha256=KNOBAg61kaapAgTl0dnv6LVD4d2p0GSuohK4r3OFxXQ,2092
56
52
  arkitekt_next/cli/commands/gen/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -62,14 +58,14 @@ arkitekt_next/cli/commands/init/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm
62
58
  arkitekt_next/cli/commands/init/main.py,sha256=1ZbZDBECZRxlcnulycdS15s-uQ5ngx4xP3T1v-gkJ3U,5435
63
59
  arkitekt_next/cli/commands/inspect/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
64
60
  arkitekt_next/cli/commands/inspect/main.py,sha256=Bu1vAZudkFCtjDnZAB8yQLDt-UKY9pJGhLBlEfDqtkw,626
65
- arkitekt_next/cli/commands/inspect/requirements.py,sha256=gQBx5OTsbLHTRwya4tMLOi8j_o28Gi4hRgvTWqGh5-4,2125
66
- arkitekt_next/cli/commands/inspect/templates.py,sha256=U99SLBYWiD-ZiIYV7pVWhQK3XWn1PLUIyTKzgSFF6MQ,2325
61
+ arkitekt_next/cli/commands/inspect/requirements.py,sha256=wj1-QTLY6rax-NxdDbctaS3tobo-W3g29FfnoM80Sr0,1894
62
+ arkitekt_next/cli/commands/inspect/templates.py,sha256=UjSqP7sirH6kG-s0h10augvUHI-sEGwgg4NNqcNCJBc,2254
67
63
  arkitekt_next/cli/commands/inspect/variables.py,sha256=LonDlbS2qH1v-jD6RfEhTv-mxmgeBMKqD3oO2iDJRjE,2698
68
64
  arkitekt_next/cli/commands/kabinet/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
69
65
  arkitekt_next/cli/commands/kabinet/build.py,sha256=JyMgvp5X0j2DE4w3aLPyM6ffSulfFZ1mNkS4--3wlZM,8671
70
66
  arkitekt_next/cli/commands/kabinet/init.py,sha256=T6D7Vz05PUyyJ6noNqrMhVjz8hyZUfKv4Vgi1JVxz_k,3599
71
67
  arkitekt_next/cli/commands/kabinet/main.py,sha256=U5EWekRTsMZZ34abWFfwilhzrd-zZtpZbl8RsLN_bC8,1008
72
- arkitekt_next/cli/commands/kabinet/publish.py,sha256=zbjnoMliowje1nEuKFolFX5pZA2D_DzLjXlSxBbD88k,3596
68
+ arkitekt_next/cli/commands/kabinet/publish.py,sha256=uPgDAlo-NBTL6wLyNWX55JJ7T5ZcRNKMLd9RRbhOod4,3568
73
69
  arkitekt_next/cli/commands/kabinet/stage.py,sha256=bXpC8fDmG6qFQVuLhqTCieOJnvFafj3Flg1BdIeciEw,2025
74
70
  arkitekt_next/cli/commands/kabinet/utils.py,sha256=a1lGmGwhiVxsxFDt19GddNwXmAwUAfclgTMe3ErA43c,1666
75
71
  arkitekt_next/cli/commands/kabinet/validate.py,sha256=MSSuwjdJKDtXB6rkjRmG-PPK6cVwTcOuCRpgPDQ0uVg,2490
@@ -81,7 +77,7 @@ arkitekt_next/cli/commands/manifest/scopes.py,sha256=sw0HRy8GliEcmx3Sh6cPRpBkf1v
81
77
  arkitekt_next/cli/commands/manifest/version.py,sha256=tA-a35QlcobUwoPsgGLQL9_D0E-HZvawsfO4l7DoX-Y,4832
82
78
  arkitekt_next/cli/commands/manifest/wizard.py,sha256=a8rIHgtmKuw-L4E3eO3kXwXv0TM2pN4Lq75y2QKXmcA,2498
83
79
  arkitekt_next/cli/commands/run/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
84
- arkitekt_next/cli/commands/run/dev.py,sha256=mobsKX155O6NXGzLK-c4_l2RN4vlM4-1lj2gQaX9HeA,10033
80
+ arkitekt_next/cli/commands/run/dev.py,sha256=pNl5KkMn413t7iLbkuWjA9qH_rApiODnk2CwacL6bXY,10043
85
81
  arkitekt_next/cli/commands/run/main.py,sha256=0bNO3DqwbZ4ddMsDWbCGmlPD6Cs3Jlg4yh2-zilsEbY,552
86
82
  arkitekt_next/cli/commands/run/prod.py,sha256=EqDMa_eYNaffHZOBHGQEGNJVKdq8NHCgfoqK8yH63B4,1637
87
83
  arkitekt_next/cli/commands/run/utils.py,sha256=zH-MNNEfKgyOYQvwP6Ph8KUHVqH48fw3ZI6tiQ9unwQ,325
@@ -133,11 +129,11 @@ arkitekt_next/qt/builders.py,sha256=S5XzxzH-Tq-OAvrbP9V8BtY34Et4Zgj_7RFmnWjRN_8,
133
129
  arkitekt_next/qt/magic_bar.py,sha256=o3Z9F2QutVd6JLEY4tEQ5-vfjIBXpgfYz8HXcWgaqfc,18308
134
130
  arkitekt_next/qt/types.py,sha256=jI9UHt1Rn-fxGZfeImTO9-yHh0zJPzk7CwvpnUXdirg,1085
135
131
  arkitekt_next/qt/utils.py,sha256=MgBPtPmCSBkIuATov3UgREESwxAHh77lWNNxyE7Qs48,773
136
- arkitekt_next/service_registry.py,sha256=oryaRLS2kalmV1Qf4_SWdLotBopTsdHNaVlnt1TGZyI,3607
137
- arkitekt_next/tqdm.py,sha256=FgrwpAwFTXBTEPY4rS7K4Gs8Wdjp74mUk4_OEU8hWZM,1526
132
+ arkitekt_next/service_registry.py,sha256=YH59EuGy_gKziWHjnU7tQrjKNchhNTurHbYzlGNCiCc,6314
133
+ arkitekt_next/tqdm.py,sha256=lQcJI5Q6Py7Gy88hOCiJujjPEEGd8G2k1mOVJJ6oYe8,1531
138
134
  arkitekt_next/utils.py,sha256=csBRBnxnErMRTilNBYAtIe0lPBb6E3uplqwsVGs5Wkk,2390
139
- arkitekt_next-0.8.2.dist-info/LICENSE,sha256=YZ2oRjC248t-GpoEyw7J13vwKYNG6zhYMaEAix6EzF0,1089
140
- arkitekt_next-0.8.2.dist-info/METADATA,sha256=5xGJosqJBHVY4l4675ZssX42wjIJEcoAeq51xmHddXs,6084
141
- arkitekt_next-0.8.2.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
142
- arkitekt_next-0.8.2.dist-info/entry_points.txt,sha256=-hxikQx4xZ6TiOnWVDOlTN_kcAISgGFvTHXIchsCHSc,60
143
- arkitekt_next-0.8.2.dist-info/RECORD,,
135
+ arkitekt_next-0.8.4.dist-info/LICENSE,sha256=YZ2oRjC248t-GpoEyw7J13vwKYNG6zhYMaEAix6EzF0,1089
136
+ arkitekt_next-0.8.4.dist-info/METADATA,sha256=aoeCJIWABr4uAuurpz5II9VnHRHhIr3LQmKS029Q9-Q,6084
137
+ arkitekt_next-0.8.4.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
138
+ arkitekt_next-0.8.4.dist-info/entry_points.txt,sha256=-hxikQx4xZ6TiOnWVDOlTN_kcAISgGFvTHXIchsCHSc,60
139
+ arkitekt_next-0.8.4.dist-info/RECORD,,
@@ -1,107 +0,0 @@
1
- from .types import EasyApp
2
- from typing import Optional, List
3
-
4
-
5
- def build_arkitekt_app(
6
- manifest: Manifest,
7
- url=None,
8
- no_cache=False,
9
- headless=False,
10
- instance_id=None,
11
- token=None,
12
- app_kind="development",
13
- redeem_token=None,
14
- ):
15
- if redeem_token:
16
- fakts = build_arkitekt_next_redeem_fakts_next(
17
- manifest=manifest,
18
- redeem_token=redeem_token,
19
- url=url,
20
- no_cache=no_cache,
21
- headless=headless,
22
- )
23
- else:
24
- fakts = build_arkitekt_next_fakts_next(
25
- manifest=manifest,
26
- url=url,
27
- no_cache=no_cache,
28
- headless=headless,
29
- client_kind=app_kind,
30
- )
31
-
32
- herre = build_arkitekt_next_herre(fakts=fakts)
33
-
34
- try:
35
- from arkitekt_next_next.apps.service.rekuest_next import (
36
- build_arkitekt_next_rekuest_next,
37
- )
38
-
39
- rekuest = build_arkitekt_next_rekuest_next(
40
- fakts=fakts, herre=herre, instance_id=instance_id
41
- )
42
- except ImportError as e:
43
- rekuest = ImportException(import_exception=e, install_library="rekuest_next")
44
-
45
- try:
46
- from arkitekt_next_next.apps.service.mikro_next import (
47
- build_arkitekt_next_mikro_next,
48
- )
49
-
50
- mikro = build_arkitekt_next_mikro_next(fakts=fakts, herre=herre)
51
- except ImportError as e:
52
- raise e
53
- mikro = ImportException(import_exception=e, install_library="mikro_next")
54
-
55
- try:
56
- from arkitekt_next_next.apps.service.fluss_next import build_arkitekt_next_fluss
57
-
58
- fluss = build_arkitekt_next_fluss(herre=herre, fakts=fakts)
59
- except ImportError as e:
60
- raise e
61
- fluss = ImportException(import_exception=e, install_library="fluss_next")
62
-
63
- try:
64
- from arkitekt_next_next.apps.service.unlok_next import (
65
- build_arkitekt_next_unlok_next,
66
- )
67
-
68
- unlok = build_arkitekt_next_unlok_next(herre=herre, fakts=fakts)
69
- except ImportError as e:
70
- raise e
71
- fluss = ImportException(import_exception=e, install_library="fluss_next")
72
-
73
- try:
74
- from arkitekt_next_next.apps.service.omero_ark import (
75
- build_arkitekt_next_omero_ark,
76
- )
77
-
78
- omero_ark = build_arkitekt_next_omero_ark(herre=herre, fakts=fakts)
79
- except ImportError as e:
80
- omero_ark = ImportException(import_exception=e, install_library="omero_ark")
81
-
82
- try:
83
- from arkitekt_next_next.apps.service.kluster import build_arkitekt_next_kluster
84
-
85
- kluster = build_arkitekt_next_kluster(herre=herre, fakts=fakts)
86
- except ImportError as e:
87
- kluster = ImportException(import_exception=e, install_library="kluster")
88
-
89
- try:
90
- from arkitekt_next_next.apps.service.kabinet import build_arkitekt_next_kabinet
91
-
92
- kabinet = build_arkitekt_next_kabinet(herre=herre, fakts=fakts)
93
- except ImportError as e:
94
- kabinet = ImportException(import_exception=e, install_library="kluster")
95
-
96
- return NextApp(
97
- manifest=manifest,
98
- fakts=fakts,
99
- herre=herre,
100
- rekuest=rekuest,
101
- mikro=mikro,
102
- kabinet=kabinet,
103
- unlok=unlok,
104
- fluss=fluss,
105
- kluster=kluster,
106
- omero_ark=omero_ark,
107
- )
@@ -1,39 +0,0 @@
1
- from arkitekt_next_next.apps.fallbacks import ImportException
2
- from arkitekt_next_next.apps.service.fakts_next import (
3
- build_arkitekt_next_fakts_next,
4
- build_arkitekt_next_redeem_fakts_next,
5
- )
6
- from arkitekt_next_next.apps.service.herre import build_arkitekt_next_herre
7
- from arkitekt_next_next.model import Manifest
8
-
9
- from .types import NextApp
10
-
11
-
12
- def build_next_app(
13
- manifest: Manifest,
14
- url=None,
15
- no_cache=False,
16
- headless=False,
17
- instance_id=None,
18
- token=None,
19
- app_kind="development",
20
- redeem_token=None,
21
- ):
22
- if redeem_token:
23
- fakts = build_arkitekt_next_redeem_fakts_next(
24
- manifest=manifest,
25
- redeem_token=redeem_token,
26
- url=url,
27
- no_cache=no_cache,
28
- headless=headless,
29
- )
30
- else:
31
- fakts = build_arkitekt_next_fakts_next(
32
- manifest=manifest,
33
- url=url,
34
- no_cache=no_cache,
35
- headless=headless,
36
- client_kind=app_kind,
37
- )
38
-
39
- herre = build_arkitekt_next_herre(fakts=fakts)
arkitekt_next/apps/qt.py DELETED
@@ -1,103 +0,0 @@
1
- from arkitekt_next_next.model import Manifest
2
- from arkitekt_next_next.apps.types import QtApp
3
- from arkitekt_next_next.apps.fallbacks import ImportException, InstallModuleException
4
- from typing import Any, Optional
5
-
6
-
7
- def build_arkitekt_next_qt_app(
8
- manifest: Manifest,
9
- no_cache: bool = False,
10
- instance_id: Optional[str] = None,
11
- beacon_widget: Any = None,
12
- login_widget: Any = None,
13
- parent: Any = None,
14
- settings: Any = None,
15
- ):
16
- try:
17
- from koil.composition.qt import QtPedanticKoil
18
- from qtpy import QtCore
19
-
20
- settings = settings or QtCore.QSettings()
21
- except ImportError as e:
22
- raise InstallModuleException(
23
- "Please install qtpy to use arkitekt_next_qt"
24
- ) from e
25
-
26
- try:
27
- from arkitekt_next_next.apps.service.fakts_qt import (
28
- build_arkitekt_next_qt_fakts,
29
- )
30
-
31
- fakts = build_arkitekt_next_qt_fakts(
32
- manifest=manifest,
33
- no_cache=no_cache,
34
- beacon_widget=beacon_widget,
35
- parent=parent,
36
- settings=settings,
37
- )
38
- except ImportError as e:
39
- fakts = ImportException(import_exception=e, install_library="qtpy")
40
-
41
- try:
42
- from arkitekt_next_next.apps.service.herre_qt import (
43
- build_arkitekt_next_qt_herre,
44
- )
45
-
46
- herre = build_arkitekt_next_qt_herre(
47
- manifest=manifest,
48
- fakts=fakts,
49
- login_widget=login_widget,
50
- parent=parent,
51
- settings=settings,
52
- )
53
- except ImportError as e:
54
- herre = ImportException(import_exception=e, install_library="qtpy")
55
-
56
- try:
57
- from arkitekt_next_next.apps.service.rekuest import build_arkitekt_next_rekuest
58
-
59
- rekuest = build_arkitekt_next_rekuest(
60
- fakts=fakts, herre=herre, instance_id=instance_id or "main"
61
- )
62
- except ImportError as e:
63
- rekuest = ImportException(import_exception=e, install_library="rekuest")
64
-
65
- try:
66
- from arkitekt_next_next.apps.service.mikro import build_arkitekt_next_mikro
67
-
68
- mikro = build_arkitekt_next_mikro(fakts=fakts, herre=herre)
69
- except ImportError as e:
70
- mikro = ImportException(import_exception=e, install_library="mikro")
71
-
72
- try:
73
- from arkitekt_next_next.apps.service.unlok import build_arkitekt_next_unlok
74
-
75
- unlok = build_arkitekt_next_unlok(herre=herre, fakts=fakts)
76
- except ImportError as e:
77
- unlok = ImportException(import_exception=e, install_library="unlok")
78
-
79
- try:
80
- from arkitekt_next_next.apps.service.fluss import build_arkitekt_next_fluss
81
-
82
- fluss = build_arkitekt_next_fluss(herre=herre, fakts=fakts)
83
- except ImportError as e:
84
- fluss = ImportException(import_exception=e, install_library="fluss")
85
-
86
- try:
87
- from arkitekt_next_next.apps.service.kluster import build_arkitekt_next_kluster
88
-
89
- kluster = build_arkitekt_next_kluster(herre=herre, fakts=fakts)
90
- except ImportError as e:
91
- kluster = ImportException(import_exception=e, install_library="kluster")
92
-
93
- return QtApp(
94
- koil=QtPedanticKoil(parent=parent),
95
- manifest=manifest,
96
- fakts=fakts,
97
- herre=herre,
98
- rekuest=rekuest,
99
- mikro=mikro,
100
- unlok=unlok,
101
- fluss=fluss,
102
- kluster=kluster,
103
- )
@@ -1,89 +0,0 @@
1
- from fakts.fakts import Fakts
2
- from fakts.fakts import Fakts
3
- from typing import Optional
4
- from fakts.grants.remote.discovery.well_known import WellKnownDiscovery
5
- from fakts.grants.remote import RemoteGrant
6
- from fakts.grants.remote.demanders.auto_save import AutoSaveDemander
7
- from fakts.grants.remote.demanders.cache import CacheTokenStore
8
- from fakts.grants.remote.demanders.static import StaticDemander
9
- from fakts.grants.remote.demanders.device_code import DeviceCodeDemander
10
- from fakts.grants.remote.claimers.post import ClaimEndpointClaimer
11
- from fakts.grants.remote.demanders.redeem import RedeemDemander
12
- from arkitekt_next_next.model import Manifest
13
-
14
-
15
- class ArkitektNextFaktsQt(Fakts):
16
- grant: RemoteGrant
17
-
18
-
19
- class ArkitektNextFakts(Fakts):
20
- pass
21
-
22
-
23
- def build_arkitekt_next_fakts(
24
- manifest: Manifest,
25
- url: Optional[str] = None,
26
- no_cache: bool = False,
27
- headless: bool = False,
28
- ) -> ArkitektNextFakts:
29
- identifier = manifest.identifier
30
- version = manifest.version
31
-
32
- if no_cache:
33
- demander = DeviceCodeDemander(
34
- manifest=manifest,
35
- redirect_uri="http://127.0.0.1:6767",
36
- open_browser=not headless,
37
- )
38
-
39
- else:
40
- demander = AutoSaveDemander(
41
- demander=DeviceCodeDemander(
42
- manifest=manifest,
43
- redirect_uri="http://127.0.0.1:6767",
44
- open_browser=not headless,
45
- ),
46
- store=CacheTokenStore(
47
- cache_file=f".arkitekt_next/cache/{identifier}-{version}_fakts_cache.json"
48
- ),
49
- )
50
-
51
- return ArkitektNextFakts(
52
- grant=RemoteGrant(
53
- demander=demander,
54
- discovery=WellKnownDiscovery(url=url, auto_protocols=["https", "http"]),
55
- claimer=ClaimEndpointClaimer(),
56
- )
57
- )
58
-
59
-
60
- def build_arkitekt_next_token_fakts(
61
- manifest: Manifest,
62
- token: str,
63
- url,
64
- no_cache: Optional[bool] = False,
65
- headless=False,
66
- ):
67
- return ArkitektNextFakts(
68
- grant=RemoteGrant(
69
- demander=StaticDemander(token=token),
70
- discovery=WellKnownDiscovery(url=url, auto_protocols=["https", "http"]),
71
- claimer=ClaimEndpointClaimer(),
72
- )
73
- )
74
-
75
-
76
- def build_arkitekt_next_redeem_fakts(
77
- manifest: Manifest,
78
- redeem_token: str,
79
- url,
80
- no_cache: Optional[bool] = False,
81
- headless=False,
82
- ):
83
- return ArkitektNextFakts(
84
- grant=RemoteGrant(
85
- demander=RedeemDemander(token=redeem_token, manifest=manifest),
86
- discovery=WellKnownDiscovery(url=url, auto_protocols=["https", "http"]),
87
- claimer=ClaimEndpointClaimer(),
88
- )
89
- )