arkitekt-next 0.7.12__py3-none-any.whl → 0.7.14__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.

@@ -3,7 +3,7 @@ import rich_click as click
3
3
 
4
4
  import rich_click as click
5
5
  from .variables import variables
6
- from .definitions import definitions
6
+ from .templates import templates
7
7
 
8
8
 
9
9
  @click.group()
@@ -19,4 +19,4 @@ def inspect(ctx):
19
19
 
20
20
 
21
21
  inspect.add_command(variables, "variables")
22
- inspect.add_command(definitions, "definitions")
22
+ inspect.add_command(templates, "templates")
@@ -0,0 +1,90 @@
1
+ import rich_click as click
2
+ from importlib import import_module
3
+ from arkitekt_next.apps.types import App
4
+ from arkitekt_next.cli.commands.run.utils import import_builder
5
+ from arkitekt_next.cli.vars import get_console, get_manifest
6
+ from arkitekt_next.cli.options import with_builder
7
+ import json
8
+ import os
9
+
10
+
11
+ async def run_app(app):
12
+ async with app:
13
+ await app.rekuest.run()
14
+
15
+
16
+ @click.command("prod")
17
+ @click.pass_context
18
+ @click.option(
19
+ "--pretty",
20
+ "-p",
21
+ help="Should we just output json?",
22
+ is_flag=True,
23
+ default=False,
24
+ )
25
+ @click.option(
26
+ "--machine-readable",
27
+ "-mr",
28
+ help="Should we just output json?",
29
+ is_flag=True,
30
+ default=False,
31
+ )
32
+ @with_builder
33
+ def templates(
34
+ ctx,
35
+ pretty: bool,
36
+ machine_readable: bool,
37
+ builder: str = "arkitekt_next.builders.easy",
38
+ ):
39
+ """Runs the app in production mode
40
+
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
+ """
45
+ from rekuest.definition.registry import get_default_definition_registry
46
+
47
+ manifest = get_manifest(ctx)
48
+ console = get_console(ctx)
49
+
50
+ entrypoint = manifest.entrypoint
51
+ identifier = manifest.identifier
52
+ entrypoint_file = f"{manifest.entrypoint}.py"
53
+ os.path.realpath(entrypoint_file)
54
+
55
+ builder_func = import_builder(builder)
56
+
57
+ entrypoint = manifest.entrypoint
58
+
59
+ with console.status("Loading entrypoint module..."):
60
+ try:
61
+ import_module(entrypoint)
62
+ except ModuleNotFoundError as e:
63
+ console.print(f"Could not find entrypoint module {entrypoint}")
64
+ raise e
65
+
66
+ app: App = builder_func(
67
+ identifier=identifier,
68
+ version="dev",
69
+ logo=manifest.logo,
70
+ )
71
+
72
+ rekuest = app.services.get("rekuest")
73
+ if rekuest is None:
74
+ console.print("No rekuest service found in app")
75
+ return
76
+
77
+ x = {
78
+ key: item.dict()
79
+ for key, item in rekuest.agent.extensions[
80
+ "default"
81
+ ].definition_registry.templates.items()
82
+ }
83
+ if machine_readable:
84
+ print("--START_TEMPLATES--" + json.dumps(x) + "--END_TEMPLATES--")
85
+
86
+ else:
87
+ if pretty:
88
+ console.print(json.dumps(x, indent=2))
89
+ else:
90
+ print(json.dumps(x))
@@ -93,7 +93,7 @@ def inspect_definitions(build_id: str) -> Inspection:
93
93
  try:
94
94
  # Run 'docker inspect' with the container ID or name
95
95
  result = subprocess.run(
96
- ["docker", "run", build_id, "arkitekt_next", "inspect", "definitions"],
96
+ ["docker", "run", build_id, "arkitekt-next", "inspect", "templates", "-mr"],
97
97
  stdout=subprocess.PIPE,
98
98
  stderr=subprocess.PIPE,
99
99
  check=True,
@@ -101,21 +101,19 @@ def inspect_definitions(build_id: str) -> Inspection:
101
101
  )
102
102
 
103
103
  # Parse the JSON output
104
+ correct_part = result.stdout.split("--START_TEMPLATES--")[1].split(
105
+ "--END_TEMPLATES--"
106
+ )[0]
104
107
 
105
108
  try:
106
- output = json.loads(result.stdout)
109
+ output = json.loads(correct_part)
107
110
  except json.decoder.JSONDecodeError as e:
108
111
  combined_error = result.stdout + result.stderr
109
112
  raise InspectionError(
110
113
  f"Could not decode JSON output of docker inspect. {combined_error}"
111
114
  ) from e
112
115
 
113
- if "definitions" not in output:
114
- raise InspectionError(
115
- "Container not found or invalid JSON output for definitions"
116
- )
117
-
118
- return output["definitions"]
116
+ return output
119
117
  except subprocess.CalledProcessError as e:
120
118
  combined_error = e.stdout + e.stderr
121
119
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: arkitekt-next
3
- Version: 0.7.12
3
+ Version: 0.7.14
4
4
  Summary: client for the arkitekt_next platform
5
5
  License: MIT
6
6
  Author: jhnnsrs
@@ -19,9 +19,10 @@ Requires-Dist: dokker (>=0.1.21)
19
19
  Requires-Dist: fakts (>=0.5.0)
20
20
  Requires-Dist: fluss-next (>=0.1.63) ; extra == "all"
21
21
  Requires-Dist: herre (>=0.4.3)
22
- Requires-Dist: kabinet (>=0.1.2) ; extra == "all"
22
+ Requires-Dist: kabinet (>=0.1.2) ; (python_version >= "3.9" and python_version < "4.0") and (extra == "all")
23
23
  Requires-Dist: koil (>=0.3.6)
24
24
  Requires-Dist: mikro-next (>=0.1.9) ; (python_version >= "3.10" and python_version < "4.0") and (extra == "all")
25
+ Requires-Dist: qtpy (>=2.4.1,<3.0.0)
25
26
  Requires-Dist: reaktion-next (>=0.1.53) ; (python_version >= "3.8" and python_version < "4.0") and (extra == "all")
26
27
  Requires-Dist: rekuest-next (>=0.2.4) ; (python_version >= "3.8" and python_version < "4.0") and (extra == "cli" or extra == "all")
27
28
  Requires-Dist: rich-click (>=1.6.1) ; extra == "cli" or extra == "all"
@@ -30,11 +30,11 @@ arkitekt_next/cli/commands/gen/watch.py,sha256=nf4QckdTJOWxvKoeNRwvC4rXQ4xhIx8LC
30
30
  arkitekt_next/cli/commands/init/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
31
31
  arkitekt_next/cli/commands/init/main.py,sha256=1ACgJn3RH5UIbsaX3KxKmwwvw9bkmJJgSWG4JDHPfow,5936
32
32
  arkitekt_next/cli/commands/inspect/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
33
- arkitekt_next/cli/commands/inspect/definitions.py,sha256=IZO4g-lsTBTeOk3E5ybPtmBueagDpeCa7oOITrRv-M8,1335
34
- arkitekt_next/cli/commands/inspect/main.py,sha256=hYAhhotYacT1SpQropE0w4u10u4eUcjA3dxk6aZ6QB0,545
33
+ arkitekt_next/cli/commands/inspect/main.py,sha256=Eab0t-oQzrnVIQuj5Rzq4Jm__awfOSMACM2vLEZlvEE,537
34
+ arkitekt_next/cli/commands/inspect/templates.py,sha256=ikfkkl2nXINXc95IuTRrI2Y03erKyOV0iL12gV2zaw4,2312
35
35
  arkitekt_next/cli/commands/inspect/variables.py,sha256=LonDlbS2qH1v-jD6RfEhTv-mxmgeBMKqD3oO2iDJRjE,2698
36
36
  arkitekt_next/cli/commands/kabinet/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
37
- arkitekt_next/cli/commands/kabinet/build.py,sha256=K8-3Hu8OVsooMlNWPdSGRFEtNFsszmIKutH92TfdEDk,7078
37
+ arkitekt_next/cli/commands/kabinet/build.py,sha256=Nb9acnUvtICMyDrJ5VReOpVgURpm9o0tQ3XnB0YeBGc,7021
38
38
  arkitekt_next/cli/commands/kabinet/init.py,sha256=NNEb5SITLNM1TBED0moyBhE-JGkkr0cvNh33A4OGnfc,2525
39
39
  arkitekt_next/cli/commands/kabinet/main.py,sha256=U5EWekRTsMZZ34abWFfwilhzrd-zZtpZbl8RsLN_bC8,1008
40
40
  arkitekt_next/cli/commands/kabinet/publish.py,sha256=zbjnoMliowje1nEuKFolFX5pZA2D_DzLjXlSxBbD88k,3596
@@ -112,8 +112,8 @@ arkitekt_next/qt/utils.py,sha256=MgBPtPmCSBkIuATov3UgREESwxAHh77lWNNxyE7Qs48,773
112
112
  arkitekt_next/service_registry.py,sha256=Aq5bgu4UHRl1P6E2JOQ2gMCwFI8pQfASWte0BvtKE3g,3365
113
113
  arkitekt_next/tqdm.py,sha256=DlrxPluHao7TvW-Cqgt0UokRS-fM2_ZNiWiddqvCqCc,1488
114
114
  arkitekt_next/utils.py,sha256=WA3AtqQFcz2h-yOadAsQkkr0qKJmKcGMi2aclxaVI_o,1278
115
- arkitekt_next-0.7.12.dist-info/LICENSE,sha256=YZ2oRjC248t-GpoEyw7J13vwKYNG6zhYMaEAix6EzF0,1089
116
- arkitekt_next-0.7.12.dist-info/METADATA,sha256=_mEKEaUNaCrAKHXXpjsvhx0A6d6IIVVId9d_PbvGI68,5349
117
- arkitekt_next-0.7.12.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
118
- arkitekt_next-0.7.12.dist-info/entry_points.txt,sha256=-hxikQx4xZ6TiOnWVDOlTN_kcAISgGFvTHXIchsCHSc,60
119
- arkitekt_next-0.7.12.dist-info/RECORD,,
115
+ arkitekt_next-0.7.14.dist-info/LICENSE,sha256=YZ2oRjC248t-GpoEyw7J13vwKYNG6zhYMaEAix6EzF0,1089
116
+ arkitekt_next-0.7.14.dist-info/METADATA,sha256=JeAYsgIb6ik0__t4pD5JeRMluUctJtHCGaPKJm81MhA,5445
117
+ arkitekt_next-0.7.14.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
118
+ arkitekt_next-0.7.14.dist-info/entry_points.txt,sha256=-hxikQx4xZ6TiOnWVDOlTN_kcAISgGFvTHXIchsCHSc,60
119
+ arkitekt_next-0.7.14.dist-info/RECORD,,
@@ -1,53 +0,0 @@
1
- import rich_click as click
2
- from importlib import import_module
3
- from arkitekt_next.cli.vars import get_console, get_manifest
4
- from arkitekt_next.cli.options import with_builder
5
- import json
6
-
7
-
8
- async def run_app(app):
9
- async with app:
10
- await app.rekuest.run()
11
-
12
-
13
- @click.command("prod")
14
- @click.pass_context
15
- @click.option(
16
- "--pretty",
17
- "-p",
18
- help="Should we just output json?",
19
- is_flag=True,
20
- default=False,
21
- )
22
- @with_builder
23
- def definitions(
24
- ctx,
25
- pretty: bool,
26
- builder=None,
27
- ):
28
- """Runs the app in production mode
29
-
30
- \n
31
- 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.
32
-
33
- """
34
- from rekuest.definition.registry import get_default_definition_registry
35
-
36
- manifest = get_manifest(ctx)
37
- console = get_console(ctx)
38
-
39
- entrypoint = manifest.entrypoint
40
-
41
- with console.status("Loading entrypoint module..."):
42
- try:
43
- import_module(entrypoint)
44
- except ModuleNotFoundError as e:
45
- console.print(f"Could not find entrypoint module {entrypoint}")
46
- raise e
47
-
48
- definitions = get_default_definition_registry().dump()
49
-
50
- if pretty:
51
- console.print(json.dumps(definitions, indent=2))
52
- else:
53
- print(json.dumps(definitions))