arkitekt-next 0.8.4__py3-none-any.whl → 0.8.6__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 +2 -2
- arkitekt_next/service_registry.py +2 -71
- {arkitekt_next-0.8.4.dist-info → arkitekt_next-0.8.6.dist-info}/METADATA +1 -1
- {arkitekt_next-0.8.4.dist-info → arkitekt_next-0.8.6.dist-info}/RECORD +7 -7
- {arkitekt_next-0.8.4.dist-info → arkitekt_next-0.8.6.dist-info}/LICENSE +0 -0
- {arkitekt_next-0.8.4.dist-info → arkitekt_next-0.8.6.dist-info}/WHEEL +0 -0
- {arkitekt_next-0.8.4.dist-info → arkitekt_next-0.8.6.dist-info}/entry_points.txt +0 -0
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
|
|
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
|
|
99
|
+
registry = registry or check_and_import_services()
|
|
100
100
|
|
|
101
101
|
url = os.getenv("FAKTS_URL", url)
|
|
102
102
|
token = os.getenv("FAKTS_TOKEN", token)
|
|
@@ -76,9 +76,9 @@ def check_and_import_services() -> ServiceBuilderRegistry:
|
|
|
76
76
|
rekuest_module.init_services(service_builder_registry)
|
|
77
77
|
logging.info(f"Called init_service function from {module_name}")
|
|
78
78
|
else:
|
|
79
|
-
|
|
79
|
+
print(f"No init_services function in {module_name}.__arkitekt__")
|
|
80
80
|
except Exception as e:
|
|
81
|
-
|
|
81
|
+
print(f"Failed to call init_services for {module_name}: {e}")
|
|
82
82
|
traceback.print_exc()
|
|
83
83
|
|
|
84
84
|
# Check local modules in the current working directory
|
|
@@ -109,72 +109,3 @@ 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
|
|
@@ -43,7 +43,7 @@ arkitekt_next/bloks/services/secret.py,sha256=cnZsH09gN9YRXBbmalZaFD2LcmWLlfm52m
|
|
|
43
43
|
arkitekt_next/bloks/services/socket.py,sha256=3MbENiJrwQbFKrpWxax56F24elnSD7S-olgycfuOX7s,423
|
|
44
44
|
arkitekt_next/bloks/socket.py,sha256=IW4954Hgms_oZsDIk9SgLoVGz07gW3sHi7-WuhN074Q,1067
|
|
45
45
|
arkitekt_next/bloks/tailscale.py,sha256=87cJv9m7N_I3y2ZRvv5WVepRhvIZk4ftUpwa0yUdwj4,2961
|
|
46
|
-
arkitekt_next/builders.py,sha256=
|
|
46
|
+
arkitekt_next/builders.py,sha256=mzyvhDI9u73_6sn2tGL-ZJh7PwdL_M8PIKqPqgzd4z0,7273
|
|
47
47
|
arkitekt_next/cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
48
48
|
arkitekt_next/cli/commands/call/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
49
49
|
arkitekt_next/cli/commands/call/local.py,sha256=XkNa2WGLf7YczRobjnQSWhRCtt6fs--2qeIa6tTMUvY,2114
|
|
@@ -129,11 +129,11 @@ arkitekt_next/qt/builders.py,sha256=S5XzxzH-Tq-OAvrbP9V8BtY34Et4Zgj_7RFmnWjRN_8,
|
|
|
129
129
|
arkitekt_next/qt/magic_bar.py,sha256=o3Z9F2QutVd6JLEY4tEQ5-vfjIBXpgfYz8HXcWgaqfc,18308
|
|
130
130
|
arkitekt_next/qt/types.py,sha256=jI9UHt1Rn-fxGZfeImTO9-yHh0zJPzk7CwvpnUXdirg,1085
|
|
131
131
|
arkitekt_next/qt/utils.py,sha256=MgBPtPmCSBkIuATov3UgREESwxAHh77lWNNxyE7Qs48,773
|
|
132
|
-
arkitekt_next/service_registry.py,sha256=
|
|
132
|
+
arkitekt_next/service_registry.py,sha256=0Qt3PNPRBlhIGWMeB04ZVmOmNI-cFCt_o2F6UrplKA8,3577
|
|
133
133
|
arkitekt_next/tqdm.py,sha256=lQcJI5Q6Py7Gy88hOCiJujjPEEGd8G2k1mOVJJ6oYe8,1531
|
|
134
134
|
arkitekt_next/utils.py,sha256=csBRBnxnErMRTilNBYAtIe0lPBb6E3uplqwsVGs5Wkk,2390
|
|
135
|
-
arkitekt_next-0.8.
|
|
136
|
-
arkitekt_next-0.8.
|
|
137
|
-
arkitekt_next-0.8.
|
|
138
|
-
arkitekt_next-0.8.
|
|
139
|
-
arkitekt_next-0.8.
|
|
135
|
+
arkitekt_next-0.8.6.dist-info/LICENSE,sha256=YZ2oRjC248t-GpoEyw7J13vwKYNG6zhYMaEAix6EzF0,1089
|
|
136
|
+
arkitekt_next-0.8.6.dist-info/METADATA,sha256=ffVuIxlz1rUQpsIuse3cV-Nvt8qrS_tRYKS0rhD7oXs,6084
|
|
137
|
+
arkitekt_next-0.8.6.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
138
|
+
arkitekt_next-0.8.6.dist-info/entry_points.txt,sha256=-hxikQx4xZ6TiOnWVDOlTN_kcAISgGFvTHXIchsCHSc,60
|
|
139
|
+
arkitekt_next-0.8.6.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|