arkitekt-next 0.7.8__tar.gz → 0.7.9__tar.gz

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.

Files changed (119) hide show
  1. {arkitekt_next-0.7.8 → arkitekt_next-0.7.9}/PKG-INFO +1 -1
  2. {arkitekt_next-0.7.8 → arkitekt_next-0.7.9}/arkitekt_next/apps/types.py +1 -10
  3. {arkitekt_next-0.7.8 → arkitekt_next-0.7.9}/arkitekt_next/builders.py +18 -33
  4. {arkitekt_next-0.7.8 → arkitekt_next-0.7.9}/arkitekt_next/cli/commands/run/dev.py +3 -0
  5. {arkitekt_next-0.7.8 → arkitekt_next-0.7.9}/arkitekt_next/cli/commands/run/prod.py +4 -1
  6. {arkitekt_next-0.7.8 → arkitekt_next-0.7.9}/arkitekt_next/cli/templates/filter.py +1 -1
  7. {arkitekt_next-0.7.8 → arkitekt_next-0.7.9}/arkitekt_next/cli/templates/simple.py +1 -1
  8. {arkitekt_next-0.7.8 → arkitekt_next-0.7.9}/arkitekt_next/cli/ui.py +7 -1
  9. arkitekt_next-0.7.9/arkitekt_next/service_registry.py +99 -0
  10. {arkitekt_next-0.7.8 → arkitekt_next-0.7.9}/pyproject.toml +1 -1
  11. arkitekt_next-0.7.8/arkitekt_next/service_registry.py +0 -51
  12. {arkitekt_next-0.7.8 → arkitekt_next-0.7.9}/LICENSE +0 -0
  13. {arkitekt_next-0.7.8 → arkitekt_next-0.7.9}/README.md +0 -0
  14. {arkitekt_next-0.7.8 → arkitekt_next-0.7.9}/arkitekt_next/__init__.py +0 -0
  15. {arkitekt_next-0.7.8 → arkitekt_next-0.7.9}/arkitekt_next/apps/__init__.py +0 -0
  16. {arkitekt_next-0.7.8 → arkitekt_next-0.7.9}/arkitekt_next/apps/easy.py +0 -0
  17. {arkitekt_next-0.7.8 → arkitekt_next-0.7.9}/arkitekt_next/apps/next.py +0 -0
  18. {arkitekt_next-0.7.8 → arkitekt_next-0.7.9}/arkitekt_next/apps/qt.py +0 -0
  19. {arkitekt_next-0.7.8 → arkitekt_next-0.7.9}/arkitekt_next/apps/service/__init__.py +0 -0
  20. {arkitekt_next-0.7.8 → arkitekt_next-0.7.9}/arkitekt_next/apps/service/fakts.py +0 -0
  21. {arkitekt_next-0.7.8 → arkitekt_next-0.7.9}/arkitekt_next/apps/service/fakts_next.py +0 -0
  22. {arkitekt_next-0.7.8 → arkitekt_next-0.7.9}/arkitekt_next/apps/service/fakts_qt.py +0 -0
  23. {arkitekt_next-0.7.8 → arkitekt_next-0.7.9}/arkitekt_next/apps/service/fluss_next.py +0 -0
  24. {arkitekt_next-0.7.8 → arkitekt_next-0.7.9}/arkitekt_next/apps/service/grant_registry.py +0 -0
  25. {arkitekt_next-0.7.8 → arkitekt_next-0.7.9}/arkitekt_next/apps/service/herre.py +0 -0
  26. {arkitekt_next-0.7.8 → arkitekt_next-0.7.9}/arkitekt_next/apps/service/herre_qt.py +0 -0
  27. {arkitekt_next-0.7.8 → arkitekt_next-0.7.9}/arkitekt_next/apps/service/kabinet.py +0 -0
  28. {arkitekt_next-0.7.8 → arkitekt_next-0.7.9}/arkitekt_next/apps/service/mikro_next.py +0 -0
  29. {arkitekt_next-0.7.8 → arkitekt_next-0.7.9}/arkitekt_next/apps/service/rekuest_next.py +0 -0
  30. {arkitekt_next-0.7.8 → arkitekt_next-0.7.9}/arkitekt_next/apps/service/unlok_next.py +0 -0
  31. {arkitekt_next-0.7.8 → arkitekt_next-0.7.9}/arkitekt_next/cli/__init__.py +0 -0
  32. {arkitekt_next-0.7.8 → arkitekt_next-0.7.9}/arkitekt_next/cli/commands/call/__init__.py +0 -0
  33. {arkitekt_next-0.7.8 → arkitekt_next-0.7.9}/arkitekt_next/cli/commands/call/local.py +0 -0
  34. {arkitekt_next-0.7.8 → arkitekt_next-0.7.9}/arkitekt_next/cli/commands/call/main.py +0 -0
  35. {arkitekt_next-0.7.8 → arkitekt_next-0.7.9}/arkitekt_next/cli/commands/call/remote.py +0 -0
  36. {arkitekt_next-0.7.8 → arkitekt_next-0.7.9}/arkitekt_next/cli/commands/gen/__init__.py +0 -0
  37. {arkitekt_next-0.7.8 → arkitekt_next-0.7.9}/arkitekt_next/cli/commands/gen/compile.py +0 -0
  38. {arkitekt_next-0.7.8 → arkitekt_next-0.7.9}/arkitekt_next/cli/commands/gen/init.py +0 -0
  39. {arkitekt_next-0.7.8 → arkitekt_next-0.7.9}/arkitekt_next/cli/commands/gen/main.py +0 -0
  40. {arkitekt_next-0.7.8 → arkitekt_next-0.7.9}/arkitekt_next/cli/commands/gen/watch.py +0 -0
  41. {arkitekt_next-0.7.8 → arkitekt_next-0.7.9}/arkitekt_next/cli/commands/init/__init__.py +0 -0
  42. {arkitekt_next-0.7.8 → arkitekt_next-0.7.9}/arkitekt_next/cli/commands/init/main.py +0 -0
  43. {arkitekt_next-0.7.8 → arkitekt_next-0.7.9}/arkitekt_next/cli/commands/inspect/__init__.py +0 -0
  44. {arkitekt_next-0.7.8 → arkitekt_next-0.7.9}/arkitekt_next/cli/commands/inspect/definitions.py +0 -0
  45. {arkitekt_next-0.7.8 → arkitekt_next-0.7.9}/arkitekt_next/cli/commands/inspect/main.py +0 -0
  46. {arkitekt_next-0.7.8 → arkitekt_next-0.7.9}/arkitekt_next/cli/commands/inspect/variables.py +0 -0
  47. {arkitekt_next-0.7.8 → arkitekt_next-0.7.9}/arkitekt_next/cli/commands/manifest/__init__.py +0 -0
  48. {arkitekt_next-0.7.8 → arkitekt_next-0.7.9}/arkitekt_next/cli/commands/manifest/inspect.py +0 -0
  49. {arkitekt_next-0.7.8 → arkitekt_next-0.7.9}/arkitekt_next/cli/commands/manifest/main.py +0 -0
  50. {arkitekt_next-0.7.8 → arkitekt_next-0.7.9}/arkitekt_next/cli/commands/manifest/scopes.py +0 -0
  51. {arkitekt_next-0.7.8 → arkitekt_next-0.7.9}/arkitekt_next/cli/commands/manifest/version.py +0 -0
  52. {arkitekt_next-0.7.8 → arkitekt_next-0.7.9}/arkitekt_next/cli/commands/manifest/wizard.py +0 -0
  53. {arkitekt_next-0.7.8 → arkitekt_next-0.7.9}/arkitekt_next/cli/commands/port/__init__.py +0 -0
  54. {arkitekt_next-0.7.8 → arkitekt_next-0.7.9}/arkitekt_next/cli/commands/port/build.py +0 -0
  55. {arkitekt_next-0.7.8 → arkitekt_next-0.7.9}/arkitekt_next/cli/commands/port/init.py +0 -0
  56. {arkitekt_next-0.7.8 → arkitekt_next-0.7.9}/arkitekt_next/cli/commands/port/main.py +0 -0
  57. {arkitekt_next-0.7.8 → arkitekt_next-0.7.9}/arkitekt_next/cli/commands/port/publish.py +0 -0
  58. {arkitekt_next-0.7.8 → arkitekt_next-0.7.9}/arkitekt_next/cli/commands/port/stage.py +0 -0
  59. {arkitekt_next-0.7.8 → arkitekt_next-0.7.9}/arkitekt_next/cli/commands/port/utils.py +0 -0
  60. {arkitekt_next-0.7.8 → arkitekt_next-0.7.9}/arkitekt_next/cli/commands/port/validate.py +0 -0
  61. {arkitekt_next-0.7.8 → arkitekt_next-0.7.9}/arkitekt_next/cli/commands/port/wizard.py +0 -0
  62. {arkitekt_next-0.7.8 → arkitekt_next-0.7.9}/arkitekt_next/cli/commands/run/__init__.py +0 -0
  63. {arkitekt_next-0.7.8 → arkitekt_next-0.7.9}/arkitekt_next/cli/commands/run/main.py +0 -0
  64. {arkitekt_next-0.7.8 → arkitekt_next-0.7.9}/arkitekt_next/cli/commands/run/utils.py +0 -0
  65. {arkitekt_next-0.7.8 → arkitekt_next-0.7.9}/arkitekt_next/cli/commands/server/__init__.py +0 -0
  66. {arkitekt_next-0.7.8 → arkitekt_next-0.7.9}/arkitekt_next/cli/commands/server/down.py +0 -0
  67. {arkitekt_next-0.7.8 → arkitekt_next-0.7.9}/arkitekt_next/cli/commands/server/init.py +0 -0
  68. {arkitekt_next-0.7.8 → arkitekt_next-0.7.9}/arkitekt_next/cli/commands/server/inspect.py +0 -0
  69. {arkitekt_next-0.7.8 → arkitekt_next-0.7.9}/arkitekt_next/cli/commands/server/main.py +0 -0
  70. {arkitekt_next-0.7.8 → arkitekt_next-0.7.9}/arkitekt_next/cli/commands/server/open.py +0 -0
  71. {arkitekt_next-0.7.8 → arkitekt_next-0.7.9}/arkitekt_next/cli/commands/server/remove.py +0 -0
  72. {arkitekt_next-0.7.8 → arkitekt_next-0.7.9}/arkitekt_next/cli/commands/server/stop.py +0 -0
  73. {arkitekt_next-0.7.8 → arkitekt_next-0.7.9}/arkitekt_next/cli/commands/server/up.py +0 -0
  74. {arkitekt_next-0.7.8 → arkitekt_next-0.7.9}/arkitekt_next/cli/commands/server/utils.py +0 -0
  75. {arkitekt_next-0.7.8 → arkitekt_next-0.7.9}/arkitekt_next/cli/configs/base.yaml +0 -0
  76. {arkitekt_next-0.7.8 → arkitekt_next-0.7.9}/arkitekt_next/cli/constants.py +0 -0
  77. {arkitekt_next-0.7.8 → arkitekt_next-0.7.9}/arkitekt_next/cli/dockerfiles/vanilla.dockerfile +0 -0
  78. {arkitekt_next-0.7.8 → arkitekt_next-0.7.9}/arkitekt_next/cli/errors.py +0 -0
  79. {arkitekt_next-0.7.8 → arkitekt_next-0.7.9}/arkitekt_next/cli/inspect.py +0 -0
  80. {arkitekt_next-0.7.8 → arkitekt_next-0.7.9}/arkitekt_next/cli/io.py +0 -0
  81. {arkitekt_next-0.7.8 → arkitekt_next-0.7.9}/arkitekt_next/cli/main.py +0 -0
  82. {arkitekt_next-0.7.8 → arkitekt_next-0.7.9}/arkitekt_next/cli/options.py +0 -0
  83. {arkitekt_next-0.7.8 → arkitekt_next-0.7.9}/arkitekt_next/cli/schemas/fluss.schema.graphql +0 -0
  84. {arkitekt_next-0.7.8 → arkitekt_next-0.7.9}/arkitekt_next/cli/schemas/gucker.schema.graphql +0 -0
  85. {arkitekt_next-0.7.8 → arkitekt_next-0.7.9}/arkitekt_next/cli/schemas/kabinet.schema.graphql +0 -0
  86. {arkitekt_next-0.7.8 → arkitekt_next-0.7.9}/arkitekt_next/cli/schemas/kluster.schema.graphql +0 -0
  87. {arkitekt_next-0.7.8 → arkitekt_next-0.7.9}/arkitekt_next/cli/schemas/konviktion.schema.graphql +0 -0
  88. {arkitekt_next-0.7.8 → arkitekt_next-0.7.9}/arkitekt_next/cli/schemas/kuay.schema.graphql +0 -0
  89. {arkitekt_next-0.7.8 → arkitekt_next-0.7.9}/arkitekt_next/cli/schemas/mikro.schema.graphql +0 -0
  90. {arkitekt_next-0.7.8 → arkitekt_next-0.7.9}/arkitekt_next/cli/schemas/mikro_next.schema.graphql +0 -0
  91. {arkitekt_next-0.7.8 → arkitekt_next-0.7.9}/arkitekt_next/cli/schemas/napari.schema.graphql +0 -0
  92. {arkitekt_next-0.7.8 → arkitekt_next-0.7.9}/arkitekt_next/cli/schemas/omero_ark.schema.graphql +0 -0
  93. {arkitekt_next-0.7.8 → arkitekt_next-0.7.9}/arkitekt_next/cli/schemas/port.schema.graphql +0 -0
  94. {arkitekt_next-0.7.8 → arkitekt_next-0.7.9}/arkitekt_next/cli/schemas/rekuest.schema.graphql +0 -0
  95. {arkitekt_next-0.7.8 → arkitekt_next-0.7.9}/arkitekt_next/cli/schemas/rekuest_next.schema.graphql +0 -0
  96. {arkitekt_next-0.7.8 → arkitekt_next-0.7.9}/arkitekt_next/cli/schemas/unlok.schema.graphql +0 -0
  97. {arkitekt_next-0.7.8 → arkitekt_next-0.7.9}/arkitekt_next/cli/texts.py +0 -0
  98. {arkitekt_next-0.7.8 → arkitekt_next-0.7.9}/arkitekt_next/cli/types.py +0 -0
  99. {arkitekt_next-0.7.8 → arkitekt_next-0.7.9}/arkitekt_next/cli/utils.py +0 -0
  100. {arkitekt_next-0.7.8 → arkitekt_next-0.7.9}/arkitekt_next/cli/validators.py +0 -0
  101. {arkitekt_next-0.7.8 → arkitekt_next-0.7.9}/arkitekt_next/cli/vars.py +0 -0
  102. {arkitekt_next-0.7.8 → arkitekt_next-0.7.9}/arkitekt_next/cli/versions/v1.yaml +0 -0
  103. {arkitekt_next-0.7.8 → arkitekt_next-0.7.9}/arkitekt_next/constants.py +0 -0
  104. {arkitekt_next-0.7.8 → arkitekt_next-0.7.9}/arkitekt_next/model.py +0 -0
  105. {arkitekt_next-0.7.8 → arkitekt_next-0.7.9}/arkitekt_next/qt/__init__.py +0 -0
  106. {arkitekt_next-0.7.8 → arkitekt_next-0.7.9}/arkitekt_next/qt/assets/dark/gear.png +0 -0
  107. {arkitekt_next-0.7.8 → arkitekt_next-0.7.9}/arkitekt_next/qt/assets/dark/green pulse.gif +0 -0
  108. {arkitekt_next-0.7.8 → arkitekt_next-0.7.9}/arkitekt_next/qt/assets/dark/orange pulse.gif +0 -0
  109. {arkitekt_next-0.7.8 → arkitekt_next-0.7.9}/arkitekt_next/qt/assets/dark/pink pulse.gif +0 -0
  110. {arkitekt_next-0.7.8 → arkitekt_next-0.7.9}/arkitekt_next/qt/assets/dark/red pulse.gif +0 -0
  111. {arkitekt_next-0.7.8 → arkitekt_next-0.7.9}/arkitekt_next/qt/assets/light/gear.png +0 -0
  112. {arkitekt_next-0.7.8 → arkitekt_next-0.7.9}/arkitekt_next/qt/assets/light/green pulse.gif +0 -0
  113. {arkitekt_next-0.7.8 → arkitekt_next-0.7.9}/arkitekt_next/qt/assets/light/orange pulse.gif +0 -0
  114. {arkitekt_next-0.7.8 → arkitekt_next-0.7.9}/arkitekt_next/qt/assets/light/pink pulse.gif +0 -0
  115. {arkitekt_next-0.7.8 → arkitekt_next-0.7.9}/arkitekt_next/qt/assets/light/red pulse.gif +0 -0
  116. {arkitekt_next-0.7.8 → arkitekt_next-0.7.9}/arkitekt_next/qt/magic_bar.py +0 -0
  117. {arkitekt_next-0.7.8 → arkitekt_next-0.7.9}/arkitekt_next/qt/utils.py +0 -0
  118. {arkitekt_next-0.7.8 → arkitekt_next-0.7.9}/arkitekt_next/tqdm.py +0 -0
  119. {arkitekt_next-0.7.8 → arkitekt_next-0.7.9}/arkitekt_next/utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: arkitekt-next
3
- Version: 0.7.8
3
+ Version: 0.7.9
4
4
  Summary: client for the arkitekt_next platform
5
5
  License: MIT
6
6
  Author: jhnnsrs
@@ -20,9 +20,9 @@ from herre import Herre
20
20
  logger = logging.getLogger(__name__)
21
21
 
22
22
 
23
-
24
23
  class App(Composition):
25
24
  """An app that is built with the easy builder"""
25
+
26
26
  fakts: Fakts
27
27
  herre: Herre
28
28
  manifest: Manifest
@@ -32,22 +32,13 @@ class App(Composition):
32
32
  """Run the app"""
33
33
  self.services["rekuest"].run()
34
34
 
35
-
36
35
  async def __aenter__(self):
37
36
  await super().__aenter__()
38
- print("Entering")
39
37
  for service in self.services.values():
40
38
  await service.__aenter__()
41
39
 
42
40
  return self
43
41
 
44
-
45
42
  async def __aexit__(self, exc_type, exc_value, traceback):
46
43
  for service in self.services.values():
47
44
  await service.__aexit__(exc_type, exc_value, traceback)
48
-
49
-
50
-
51
-
52
-
53
-
@@ -2,14 +2,17 @@ from typing import List, Optional
2
2
  import logging
3
3
  import os
4
4
 
5
- from arkitekt_next.apps.service.fakts_next import build_arkitekt_next_fakts_next, build_arkitekt_next_redeem_fakts_next
5
+ from arkitekt_next.apps.service.fakts_next import (
6
+ build_arkitekt_next_fakts_next,
7
+ build_arkitekt_next_redeem_fakts_next,
8
+ )
6
9
  from arkitekt_next.apps.service.herre import build_arkitekt_next_herre
7
10
  from arkitekt_next.apps.service.fakts_qt import build_arkitekt_next_qt_fakts
8
11
  from arkitekt_next.apps.service.herre_qt import build_arkitekt_next_qt_herre
9
12
  from .utils import create_arkitekt_next_folder
10
13
  from .model import Manifest
11
14
  from .apps.types import App
12
- from .service_registry import ServiceBuilderRegistry, get_default_service_builder_registry
15
+ from .service_registry import ServiceBuilderRegistry, check_and_import_services
13
16
  from arkitekt_next.constants import DEFAULT_ARKITEKT_URL
14
17
  from qtpy import QtWidgets, QtCore
15
18
 
@@ -95,8 +98,7 @@ def easy(
95
98
  NextApp
96
99
  A built app, that can be used to interact with the ArkitektNext server
97
100
  """
98
- registry = registry or get_default_service_builder_registry()
99
-
101
+ registry = registry or check_and_import_services()
100
102
 
101
103
  manifest = Manifest(
102
104
  version=version,
@@ -106,7 +108,6 @@ def easy(
106
108
  requirements=registry.get_requirements(),
107
109
  )
108
110
 
109
-
110
111
  if redeem_token:
111
112
  fakts = build_arkitekt_next_redeem_fakts_next(
112
113
  manifest=manifest,
@@ -128,15 +129,11 @@ def easy(
128
129
 
129
130
  params = kwargs
130
131
 
131
-
132
-
133
132
  url = os.getenv("FAKTS_URL", url)
134
133
  token = os.getenv("FAKTS_TOKEN", token)
135
134
 
136
135
  create_arkitekt_next_folder(with_cache=True)
137
136
 
138
-
139
-
140
137
  try:
141
138
  from rich.logging import RichHandler
142
139
 
@@ -144,8 +141,6 @@ def easy(
144
141
  except ImportError:
145
142
  logging.basicConfig(level=log_level)
146
143
 
147
- print(registry.service_builders)
148
-
149
144
  app = App(
150
145
  fakts=fakts,
151
146
  herre=herre,
@@ -155,12 +150,9 @@ def easy(
155
150
 
156
151
  print()
157
152
 
158
-
159
153
  return app
160
154
 
161
155
 
162
-
163
-
164
156
  def publicqt(
165
157
  identifier: str,
166
158
  version: str = "latest",
@@ -175,10 +167,10 @@ def publicqt(
175
167
  redeem_token: Optional[str] = None,
176
168
  app_kind: str = "desktop",
177
169
  registry: Optional[ServiceBuilderRegistry] = None,
178
- parent: Optional[QtWidgets.QWidget] =None,
179
- beacon_widget: Optional[QtWidgets.QWidget]=None,
180
- login_widget: Optional[QtWidgets.QWidget]=None,
181
- settings: Optional[QtCore.QSettings]=None,
170
+ parent: Optional[QtWidgets.QWidget] = None,
171
+ beacon_widget: Optional[QtWidgets.QWidget] = None,
172
+ login_widget: Optional[QtWidgets.QWidget] = None,
173
+ settings: Optional[QtCore.QSettings] = None,
182
174
  **kwargs,
183
175
  ) -> App:
184
176
  """Public QtApp creation
@@ -196,10 +188,7 @@ def publicqt(
196
188
  Arkitekt: The Arkitekt app
197
189
  """
198
190
 
199
- from arkitekt.apps.qt import build_arkitekt_qt_app
200
-
201
- registry = registry or get_default_service_builder_registry()
202
-
191
+ registry = registry or check_and_import_services()
203
192
 
204
193
  manifest = Manifest(
205
194
  version=version,
@@ -209,7 +198,6 @@ def publicqt(
209
198
  requirements=registry.get_requirements(),
210
199
  )
211
200
 
212
-
213
201
  if redeem_token:
214
202
  fakts = build_arkitekt_next_redeem_fakts_next(
215
203
  manifest=manifest,
@@ -228,19 +216,21 @@ def publicqt(
228
216
  settings=settings,
229
217
  )
230
218
 
231
- herre = build_arkitekt_next_qt_herre(manifest=manifest, fakts=fakts, login_widget=login_widget, parent=parent, settings=settings)
219
+ herre = build_arkitekt_next_qt_herre(
220
+ manifest=manifest,
221
+ fakts=fakts,
222
+ login_widget=login_widget,
223
+ parent=parent,
224
+ settings=settings,
225
+ )
232
226
 
233
227
  params = kwargs
234
228
 
235
-
236
-
237
229
  url = os.getenv("FAKTS_URL", url)
238
230
  token = os.getenv("FAKTS_TOKEN", token)
239
231
 
240
232
  create_arkitekt_next_folder(with_cache=True)
241
233
 
242
-
243
-
244
234
  try:
245
235
  from rich.logging import RichHandler
246
236
 
@@ -248,8 +238,6 @@ def publicqt(
248
238
  except ImportError:
249
239
  logging.basicConfig(level=log_level)
250
240
 
251
- print(registry.service_builders)
252
-
253
241
  app = App(
254
242
  fakts=fakts,
255
243
  herre=herre,
@@ -257,8 +245,5 @@ def publicqt(
257
245
  services=registry.build_service_map(fakts=fakts, herre=herre, params=params),
258
246
  )
259
247
 
260
- print()
261
-
262
-
263
248
  app.enter()
264
249
  return app
@@ -100,6 +100,9 @@ async def run_app(app: App) -> None:
100
100
  """
101
101
 
102
102
  rekuest = app.services.get("rekuest")
103
+ if not rekuest:
104
+ raise Exception("No rekuest service found. We need this to run the app.")
105
+
103
106
  async with app:
104
107
  await rekuest.run()
105
108
 
@@ -6,9 +6,12 @@ from importlib import import_module
6
6
  from .utils import import_builder
7
7
  from arkitekt_next.constants import DEFAULT_ARKITEKT_URL
8
8
 
9
+
9
10
  async def run_app(app):
11
+ rekuest = app.services.get("rekuest")
12
+
10
13
  async with app:
11
- await app.rekuest.run()
14
+ await rekuest.run()
12
15
 
13
16
 
14
17
  @click.command("prod")
@@ -1,4 +1,4 @@
1
- from arkitekt_next_next import register
1
+ from arkitekt_next import register
2
2
  from mikro.api.schema import RepresentationFragment, from_xarray
3
3
 
4
4
 
@@ -1,4 +1,4 @@
1
- from arkitekt_next_next import register
1
+ from arkitekt_next import register
2
2
  import time
3
3
 
4
4
 
@@ -56,15 +56,21 @@ def construct_app_group(app: App) -> Group:
56
56
  panel_header = f"Running App \n\n{app.manifest.identifier}:{app.manifest.version}\n"
57
57
 
58
58
  actor_tree = Tree("Registered Definitions", style="white not bold")
59
- panel_group = Group(panel_header, actor_tree)
59
+ service_tree = Tree("Depends on services", style="white not bold")
60
+
61
+ for key, extension in app.services.items():
62
+ service_tree.add(key)
60
63
 
61
64
  rekuest = app.services.get("rekuest")
65
+ if rekuest is None:
66
+ return Group(panel_header, service_tree)
62
67
 
63
68
  for key, extension in rekuest.agent.extensions.items():
64
69
  tree = actor_tree.add(key)
65
70
  for template in extension.definition_registry.templates.values():
66
71
  tree.add(template.interface + "-" + template.definition.name)
67
72
 
73
+ panel_group = Group(panel_header, service_tree, actor_tree)
68
74
 
69
75
  return panel_group
70
76
 
@@ -0,0 +1,99 @@
1
+ from pydantic import BaseModel, Field
2
+ from herre import Herre
3
+ from fakts import Fakts
4
+ from .model import Requirement
5
+ from typing import Callable, Dict
6
+ import importlib
7
+ import sys
8
+ import os
9
+ import traceback
10
+ import logging
11
+ import pkgutil
12
+
13
+ Params = Dict[str, str]
14
+
15
+
16
+ class Registration(BaseModel):
17
+ name: str
18
+ requirement: Requirement
19
+ builder: Callable[[Herre, Fakts, Params], object]
20
+
21
+
22
+ basic_requirements = {
23
+ "lok": Requirement(
24
+ service="live.arkitekt.lok",
25
+ description="An instance of ArkitektNext Lok to authenticate the user",
26
+ ),
27
+ }
28
+
29
+
30
+ class ServiceBuilderRegistry:
31
+ def __init__(self):
32
+ self.service_builders = {}
33
+ self.requirements = basic_requirements
34
+
35
+ def register(self, name: str, service_builder: Callable[[Herre, Fakts], object], requirement: Requirement):
36
+ self.service_builders[name] = service_builder
37
+ self.requirements[name] = requirement
38
+
39
+ def get(self, name):
40
+ return self.services.get(name)
41
+
42
+
43
+ def build_service_map(self, fakts: Fakts, herre: Herre, params: Params):
44
+ return {name: builder(fakts, herre, params) for name, builder in self.service_builders.items()}
45
+
46
+ def get_requirements(self):
47
+ return self.requirements
48
+
49
+
50
+
51
+
52
+
53
+
54
+ class SetupInfo:
55
+ services: Dict[str, object]
56
+
57
+
58
+
59
+ def check_and_import_services() -> ServiceBuilderRegistry:
60
+
61
+ service_builder_registry = ServiceBuilderRegistry()
62
+
63
+ # Function to load and call init_extensions from __rekuest__.py
64
+ def load_and_call_init_extensions(module_name, rekuest_path):
65
+ try:
66
+ spec = importlib.util.spec_from_file_location(f"{module_name}.__arkitekt__", rekuest_path)
67
+ rekuest_module = importlib.util.module_from_spec(spec)
68
+ spec.loader.exec_module(rekuest_module)
69
+ if hasattr(rekuest_module, 'init_services'):
70
+ rekuest_module.init_services(service_builder_registry)
71
+ logging.info(f"Called init_service function from {module_name}")
72
+ else:
73
+ print(f"No init_services function in {module_name}.__arkitekt__")
74
+ except Exception as e:
75
+ print(f"Failed to call init_services for {module_name}: {e}")
76
+ traceback.print_exc()
77
+
78
+ # Check local modules in the current working directory
79
+ current_directory = os.getcwd()
80
+ for item in os.listdir(current_directory):
81
+ item_path = os.path.join(current_directory, item)
82
+ if os.path.isdir(item_path) and os.path.isfile(os.path.join(item_path, '__init__.py')):
83
+ rekuest_path = os.path.join(item_path, '__arkitekt__.py')
84
+ if os.path.isfile(rekuest_path):
85
+ load_and_call_init_extensions(item, rekuest_path)
86
+
87
+ # Check installed packages
88
+ for _, module_name, _ in pkgutil.iter_modules():
89
+ try:
90
+ module_spec = importlib.util.find_spec(module_name)
91
+ if module_spec and module_spec.origin:
92
+ rekuest_path = os.path.join(os.path.dirname(module_spec.origin), '__arkitekt__.py')
93
+ if os.path.isfile(rekuest_path):
94
+ load_and_call_init_extensions(module_name, rekuest_path)
95
+ except Exception as e:
96
+ print(f"Failed to call init_extensions for installed package {module_name}: {e}")
97
+ traceback.print_exc()
98
+
99
+ return service_builder_registry
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "arkitekt-next"
3
- version = "0.7.8"
3
+ version = "0.7.9"
4
4
  description = "client for the arkitekt_next platform"
5
5
  authors = ["jhnnsrs <jhnnsrs@gmail.com>"]
6
6
  license = "MIT"
@@ -1,51 +0,0 @@
1
- from pydantic import BaseModel, Field
2
- from herre import Herre
3
- from fakts import Fakts
4
- from .model import Requirement
5
- from typing import Callable, Dict
6
-
7
-
8
- Params = Dict[str, str]
9
-
10
-
11
- class Registration(BaseModel):
12
- name: str
13
- requirement: Requirement
14
- builder: Callable[[Herre, Fakts, Params], object]
15
-
16
-
17
- basic_requirements = {
18
- "lok": Requirement(
19
- service="live.arkitekt.lok",
20
- description="An instance of ArkitektNext Lok to authenticate the user",
21
- ),
22
- }
23
-
24
-
25
- class ServiceBuilderRegistry:
26
- def __init__(self):
27
- self.service_builders = {}
28
- self.requirements = basic_requirements
29
-
30
- def register(self, name: str, service_builder: Callable[[Herre, Fakts], object], requirement: Requirement):
31
- self.service_builders[name] = service_builder
32
- self.requirements[name] = requirement
33
-
34
- def get(self, name):
35
- return self.services.get(name)
36
-
37
-
38
- def build_service_map(self, fakts: Fakts, herre: Herre, params: Params):
39
- return {name: builder(fakts, herre, params) for name, builder in self.service_builders.items()}
40
-
41
- def get_requirements(self):
42
- return self.requirements
43
-
44
-
45
-
46
- service_builder_registry = ServiceBuilderRegistry()
47
-
48
-
49
- def get_default_service_builder_registry():
50
- return service_builder_registry
51
-
File without changes
File without changes