arkitekt-next 0.23.0__tar.gz → 0.25.0__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 (102) hide show
  1. {arkitekt_next-0.23.0 → arkitekt_next-0.25.0}/PKG-INFO +6 -6
  2. arkitekt_next-0.25.0/arkitekt_next/pytest/__init__.py +1 -0
  3. arkitekt_next-0.25.0/arkitekt_next/pytest/fixtures.py +86 -0
  4. {arkitekt_next-0.23.0 → arkitekt_next-0.25.0}/arkitekt_next/qt/builders.py +34 -19
  5. {arkitekt_next-0.23.0 → arkitekt_next-0.25.0}/arkitekt_next/qt/types.py +31 -24
  6. {arkitekt_next-0.23.0 → arkitekt_next-0.25.0}/pyproject.toml +12 -9
  7. {arkitekt_next-0.23.0 → arkitekt_next-0.25.0}/.gitignore +0 -0
  8. {arkitekt_next-0.23.0 → arkitekt_next-0.25.0}/LICENSE +0 -0
  9. {arkitekt_next-0.23.0 → arkitekt_next-0.25.0}/README.md +0 -0
  10. {arkitekt_next-0.23.0 → arkitekt_next-0.25.0}/arkitekt_next/__init__.py +0 -0
  11. {arkitekt_next-0.23.0 → arkitekt_next-0.25.0}/arkitekt_next/app/__init__.py +0 -0
  12. {arkitekt_next-0.23.0 → arkitekt_next-0.25.0}/arkitekt_next/app/app.py +0 -0
  13. {arkitekt_next-0.23.0 → arkitekt_next-0.25.0}/arkitekt_next/app/fakts.py +0 -0
  14. {arkitekt_next-0.23.0 → arkitekt_next-0.25.0}/arkitekt_next/builders.py +0 -0
  15. {arkitekt_next-0.23.0 → arkitekt_next-0.25.0}/arkitekt_next/cli/__init__.py +0 -0
  16. {arkitekt_next-0.23.0 → arkitekt_next-0.25.0}/arkitekt_next/cli/commands/call/__init__.py +0 -0
  17. {arkitekt_next-0.23.0 → arkitekt_next-0.25.0}/arkitekt_next/cli/commands/call/local.py +0 -0
  18. {arkitekt_next-0.23.0 → arkitekt_next-0.25.0}/arkitekt_next/cli/commands/call/main.py +0 -0
  19. {arkitekt_next-0.23.0 → arkitekt_next-0.25.0}/arkitekt_next/cli/commands/call/remote.py +0 -0
  20. {arkitekt_next-0.23.0 → arkitekt_next-0.25.0}/arkitekt_next/cli/commands/gen/__init__.py +0 -0
  21. {arkitekt_next-0.23.0 → arkitekt_next-0.25.0}/arkitekt_next/cli/commands/gen/compile.py +0 -0
  22. {arkitekt_next-0.23.0 → arkitekt_next-0.25.0}/arkitekt_next/cli/commands/gen/init.py +0 -0
  23. {arkitekt_next-0.23.0 → arkitekt_next-0.25.0}/arkitekt_next/cli/commands/gen/main.py +0 -0
  24. {arkitekt_next-0.23.0 → arkitekt_next-0.25.0}/arkitekt_next/cli/commands/gen/watch.py +0 -0
  25. {arkitekt_next-0.23.0 → arkitekt_next-0.25.0}/arkitekt_next/cli/commands/init/__init__.py +0 -0
  26. {arkitekt_next-0.23.0 → arkitekt_next-0.25.0}/arkitekt_next/cli/commands/init/main.py +0 -0
  27. {arkitekt_next-0.23.0 → arkitekt_next-0.25.0}/arkitekt_next/cli/commands/inspect/__init__.py +0 -0
  28. {arkitekt_next-0.23.0 → arkitekt_next-0.25.0}/arkitekt_next/cli/commands/inspect/implementations.py +0 -0
  29. {arkitekt_next-0.23.0 → arkitekt_next-0.25.0}/arkitekt_next/cli/commands/inspect/main.py +0 -0
  30. {arkitekt_next-0.23.0 → arkitekt_next-0.25.0}/arkitekt_next/cli/commands/inspect/requirements.py +0 -0
  31. {arkitekt_next-0.23.0 → arkitekt_next-0.25.0}/arkitekt_next/cli/commands/inspect/variables.py +0 -0
  32. {arkitekt_next-0.23.0 → arkitekt_next-0.25.0}/arkitekt_next/cli/commands/kabinet/__init__.py +0 -0
  33. {arkitekt_next-0.23.0 → arkitekt_next-0.25.0}/arkitekt_next/cli/commands/kabinet/build.py +0 -0
  34. {arkitekt_next-0.23.0 → arkitekt_next-0.25.0}/arkitekt_next/cli/commands/kabinet/init.py +0 -0
  35. {arkitekt_next-0.23.0 → arkitekt_next-0.25.0}/arkitekt_next/cli/commands/kabinet/io.py +0 -0
  36. {arkitekt_next-0.23.0 → arkitekt_next-0.25.0}/arkitekt_next/cli/commands/kabinet/main.py +0 -0
  37. {arkitekt_next-0.23.0 → arkitekt_next-0.25.0}/arkitekt_next/cli/commands/kabinet/publish.py +0 -0
  38. {arkitekt_next-0.23.0 → arkitekt_next-0.25.0}/arkitekt_next/cli/commands/kabinet/stage.py +0 -0
  39. {arkitekt_next-0.23.0 → arkitekt_next-0.25.0}/arkitekt_next/cli/commands/kabinet/types.py +0 -0
  40. {arkitekt_next-0.23.0 → arkitekt_next-0.25.0}/arkitekt_next/cli/commands/kabinet/utils.py +0 -0
  41. {arkitekt_next-0.23.0 → arkitekt_next-0.25.0}/arkitekt_next/cli/commands/kabinet/validate.py +0 -0
  42. {arkitekt_next-0.23.0 → arkitekt_next-0.25.0}/arkitekt_next/cli/commands/manifest/__init__.py +0 -0
  43. {arkitekt_next-0.23.0 → arkitekt_next-0.25.0}/arkitekt_next/cli/commands/manifest/inspect.py +0 -0
  44. {arkitekt_next-0.23.0 → arkitekt_next-0.25.0}/arkitekt_next/cli/commands/manifest/main.py +0 -0
  45. {arkitekt_next-0.23.0 → arkitekt_next-0.25.0}/arkitekt_next/cli/commands/manifest/scopes.py +0 -0
  46. {arkitekt_next-0.23.0 → arkitekt_next-0.25.0}/arkitekt_next/cli/commands/manifest/version.py +0 -0
  47. {arkitekt_next-0.23.0 → arkitekt_next-0.25.0}/arkitekt_next/cli/commands/run/__init__.py +0 -0
  48. {arkitekt_next-0.23.0 → arkitekt_next-0.25.0}/arkitekt_next/cli/commands/run/dev.py +0 -0
  49. {arkitekt_next-0.23.0 → arkitekt_next-0.25.0}/arkitekt_next/cli/commands/run/main.py +0 -0
  50. {arkitekt_next-0.23.0 → arkitekt_next-0.25.0}/arkitekt_next/cli/commands/run/prod.py +0 -0
  51. {arkitekt_next-0.23.0 → arkitekt_next-0.25.0}/arkitekt_next/cli/commands/run/utils.py +0 -0
  52. {arkitekt_next-0.23.0 → arkitekt_next-0.25.0}/arkitekt_next/cli/constants.py +0 -0
  53. {arkitekt_next-0.23.0 → arkitekt_next-0.25.0}/arkitekt_next/cli/dockerfiles/vanilla.dockerfile +0 -0
  54. {arkitekt_next-0.23.0 → arkitekt_next-0.25.0}/arkitekt_next/cli/errors.py +0 -0
  55. {arkitekt_next-0.23.0 → arkitekt_next-0.25.0}/arkitekt_next/cli/inspect.py +0 -0
  56. {arkitekt_next-0.23.0 → arkitekt_next-0.25.0}/arkitekt_next/cli/io.py +0 -0
  57. {arkitekt_next-0.23.0 → arkitekt_next-0.25.0}/arkitekt_next/cli/main.py +0 -0
  58. {arkitekt_next-0.23.0 → arkitekt_next-0.25.0}/arkitekt_next/cli/options.py +0 -0
  59. {arkitekt_next-0.23.0 → arkitekt_next-0.25.0}/arkitekt_next/cli/schemas/fluss.schema.graphql +0 -0
  60. {arkitekt_next-0.23.0 → arkitekt_next-0.25.0}/arkitekt_next/cli/schemas/gucker.schema.graphql +0 -0
  61. {arkitekt_next-0.23.0 → arkitekt_next-0.25.0}/arkitekt_next/cli/schemas/kabinet.schema.graphql +0 -0
  62. {arkitekt_next-0.23.0 → arkitekt_next-0.25.0}/arkitekt_next/cli/schemas/kluster.schema.graphql +0 -0
  63. {arkitekt_next-0.23.0 → arkitekt_next-0.25.0}/arkitekt_next/cli/schemas/konviktion.schema.graphql +0 -0
  64. {arkitekt_next-0.23.0 → arkitekt_next-0.25.0}/arkitekt_next/cli/schemas/kuay.schema.graphql +0 -0
  65. {arkitekt_next-0.23.0 → arkitekt_next-0.25.0}/arkitekt_next/cli/schemas/mikro.schema.graphql +0 -0
  66. {arkitekt_next-0.23.0 → arkitekt_next-0.25.0}/arkitekt_next/cli/schemas/mikro_next.schema.graphql +0 -0
  67. {arkitekt_next-0.23.0 → arkitekt_next-0.25.0}/arkitekt_next/cli/schemas/napari.schema.graphql +0 -0
  68. {arkitekt_next-0.23.0 → arkitekt_next-0.25.0}/arkitekt_next/cli/schemas/omero_ark.schema.graphql +0 -0
  69. {arkitekt_next-0.23.0 → arkitekt_next-0.25.0}/arkitekt_next/cli/schemas/port.schema.graphql +0 -0
  70. {arkitekt_next-0.23.0 → arkitekt_next-0.25.0}/arkitekt_next/cli/schemas/rekuest.schema.graphql +0 -0
  71. {arkitekt_next-0.23.0 → arkitekt_next-0.25.0}/arkitekt_next/cli/schemas/rekuest_next.schema.graphql +0 -0
  72. {arkitekt_next-0.23.0 → arkitekt_next-0.25.0}/arkitekt_next/cli/schemas/unlok.schema.graphql +0 -0
  73. {arkitekt_next-0.23.0 → arkitekt_next-0.25.0}/arkitekt_next/cli/templates/filter.py +0 -0
  74. {arkitekt_next-0.23.0 → arkitekt_next-0.25.0}/arkitekt_next/cli/templates/simple.py +0 -0
  75. {arkitekt_next-0.23.0 → arkitekt_next-0.25.0}/arkitekt_next/cli/texts.py +0 -0
  76. {arkitekt_next-0.23.0 → arkitekt_next-0.25.0}/arkitekt_next/cli/types.py +0 -0
  77. {arkitekt_next-0.23.0 → arkitekt_next-0.25.0}/arkitekt_next/cli/ui.py +0 -0
  78. {arkitekt_next-0.23.0 → arkitekt_next-0.25.0}/arkitekt_next/cli/utils.py +0 -0
  79. {arkitekt_next-0.23.0 → arkitekt_next-0.25.0}/arkitekt_next/cli/validators.py +0 -0
  80. {arkitekt_next-0.23.0 → arkitekt_next-0.25.0}/arkitekt_next/cli/vars.py +0 -0
  81. {arkitekt_next-0.23.0 → arkitekt_next-0.25.0}/arkitekt_next/cli/versions/v1.yaml +0 -0
  82. {arkitekt_next-0.23.0 → arkitekt_next-0.25.0}/arkitekt_next/constants.py +0 -0
  83. {arkitekt_next-0.23.0 → arkitekt_next-0.25.0}/arkitekt_next/init_registry.py +0 -0
  84. {arkitekt_next-0.23.0 → arkitekt_next-0.25.0}/arkitekt_next/inspect.py +0 -0
  85. {arkitekt_next-0.23.0 → arkitekt_next-0.25.0}/arkitekt_next/protocols.py +0 -0
  86. {arkitekt_next-0.23.0 → arkitekt_next-0.25.0}/arkitekt_next/py.typed +0 -0
  87. {arkitekt_next-0.23.0 → arkitekt_next-0.25.0}/arkitekt_next/qt/__init__.py +0 -0
  88. {arkitekt_next-0.23.0 → arkitekt_next-0.25.0}/arkitekt_next/qt/assets/dark/gear.png +0 -0
  89. {arkitekt_next-0.23.0 → arkitekt_next-0.25.0}/arkitekt_next/qt/assets/dark/green pulse.gif +0 -0
  90. {arkitekt_next-0.23.0 → arkitekt_next-0.25.0}/arkitekt_next/qt/assets/dark/orange pulse.gif +0 -0
  91. {arkitekt_next-0.23.0 → arkitekt_next-0.25.0}/arkitekt_next/qt/assets/dark/pink pulse.gif +0 -0
  92. {arkitekt_next-0.23.0 → arkitekt_next-0.25.0}/arkitekt_next/qt/assets/dark/red pulse.gif +0 -0
  93. {arkitekt_next-0.23.0 → arkitekt_next-0.25.0}/arkitekt_next/qt/assets/light/gear.png +0 -0
  94. {arkitekt_next-0.23.0 → arkitekt_next-0.25.0}/arkitekt_next/qt/assets/light/green pulse.gif +0 -0
  95. {arkitekt_next-0.23.0 → arkitekt_next-0.25.0}/arkitekt_next/qt/assets/light/orange pulse.gif +0 -0
  96. {arkitekt_next-0.23.0 → arkitekt_next-0.25.0}/arkitekt_next/qt/assets/light/pink pulse.gif +0 -0
  97. {arkitekt_next-0.23.0 → arkitekt_next-0.25.0}/arkitekt_next/qt/assets/light/red pulse.gif +0 -0
  98. {arkitekt_next-0.23.0 → arkitekt_next-0.25.0}/arkitekt_next/qt/magic_bar.py +0 -0
  99. {arkitekt_next-0.23.0 → arkitekt_next-0.25.0}/arkitekt_next/qt/utils.py +0 -0
  100. {arkitekt_next-0.23.0 → arkitekt_next-0.25.0}/arkitekt_next/service_registry.py +0 -0
  101. {arkitekt_next-0.23.0 → arkitekt_next-0.25.0}/arkitekt_next/tqdm.py +0 -0
  102. {arkitekt_next-0.23.0 → arkitekt_next-0.25.0}/arkitekt_next/utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: arkitekt-next
3
- Version: 0.23.0
3
+ Version: 0.25.0
4
4
  Summary: client for the arkitekt_next platform
5
5
  Author-email: jhnnsrs <jhnnsrs@gmail.com>
6
6
  License-Expression: MIT
@@ -8,14 +8,14 @@ License-File: LICENSE
8
8
  Requires-Python: <4,>=3.11
9
9
  Requires-Dist: click>=8.2.0
10
10
  Requires-Dist: dokker>=2.3.0
11
- Requires-Dist: fakts-next>=2.1.0
11
+ Requires-Dist: fakts-next>=2.2.0
12
12
  Requires-Dist: kabinet>=0.7.0
13
- Requires-Dist: koil>=2.0.4
14
- Requires-Dist: rath>=3.6.0
15
- Requires-Dist: rekuest-next>=0.13.1
13
+ Requires-Dist: koil>=2.0.5
14
+ Requires-Dist: rath>=3.7.0
15
+ Requires-Dist: rekuest-next>=0.15.0
16
16
  Requires-Dist: rich-click>=1.8.8
17
17
  Requires-Dist: semver>=3.0.4
18
- Requires-Dist: turms>=0.9.2
18
+ Requires-Dist: turms>=0.10.0
19
19
  Requires-Dist: watchfiles>=1.0.5
20
20
  Provides-Extra: all
21
21
  Requires-Dist: fluss-next>=0.2.0; extra == 'all'
@@ -0,0 +1 @@
1
+ from .fixtures import *
@@ -0,0 +1,86 @@
1
+ from typing import Generator
2
+ import pytest
3
+ from arkitekt_next.cli.main import cli
4
+ from click.testing import CliRunner
5
+ from arkitekt_server.create import temp_server, ArkitektServerConfig
6
+ from dokker import Deployment
7
+ from dataclasses import dataclass
8
+ from arkitekt_next.app import App
9
+ from fakts_next.grants.remote import FaktsEndpoint
10
+ from arkitekt_next import easy
11
+ from dokker import local
12
+
13
+ from arkitekt_next.service_registry import get_default_service_registry
14
+ import pytest
15
+
16
+ def pytest_addoption(parser: pytest.Parser) -> None:
17
+ """Register custom command line options for pytest."""
18
+ parser.addoption(
19
+ "--test-against",
20
+ action="store",
21
+ default="temp",
22
+ help="Base URL of the Arkitekt server to use in tests",
23
+ )
24
+
25
+
26
+ @pytest.fixture(scope="session")
27
+ def running_server(request: pytest.FixtureRequest) -> Generator[Deployment, None, None]:
28
+ """ Generates a local Arkitekt server deployment for testing purposes. """
29
+
30
+ if not request.config.getoption("--test-against") == "temp":
31
+ raise ValueError("Invalid test environment specified. Currently only 'temp' is supported.")
32
+
33
+ config = ArkitektServerConfig()
34
+
35
+ with temp_server() as temp_path:
36
+
37
+ setup = local(temp_path / "docker-compose.yaml")
38
+
39
+ setup.add_health_check(
40
+ url=lambda spec: f"http://localhost:{spec.find_service('gateway').get_port_for_internal(80).published}/lok/ht",
41
+ service="lok",
42
+ timeout=5,
43
+ max_retries=10,
44
+ )
45
+ with setup as setup:
46
+ setup.down()
47
+
48
+
49
+ setup.up()
50
+
51
+ setup.check_health()
52
+ yield setup
53
+ setup.down()
54
+
55
+
56
+
57
+ @dataclass
58
+ class EasyApp:
59
+ """Dataclass to hold the Arkitekt server deployment."""
60
+ deployment: Deployment
61
+ app: App
62
+
63
+
64
+ @pytest.fixture(scope="session")
65
+ def test_app(running_server: Deployment) -> Generator[EasyApp, None, None]:
66
+ """Fixture to ensure the Arkitekt server is running."""
67
+
68
+ async def device_code_hook(endpoint: FaktsEndpoint, device_code: str):
69
+
70
+ await running_server.arun(
71
+ "lok", f"uv run python manage.py validatecode {device_code} --user demo --org arkitektio"
72
+ )
73
+
74
+
75
+ registry = get_default_service_registry()
76
+
77
+ assert registry, "Service registry must be initialized"
78
+
79
+
80
+
81
+ with easy(url=f"http://localhost:{running_server.spec.find_service('gateway').get_port_for_internal(80).published}", device_code_hook=device_code_hook) as app:
82
+
83
+ yield EasyApp(
84
+ deployment=running_server,
85
+ app=app
86
+ )
@@ -1,38 +1,41 @@
1
+ import logging
2
+ import os
3
+ from typing import List, Optional
4
+
5
+ from qtpy import QtWidgets, QtCore
6
+
1
7
  from arkitekt_next.app.fakts import (
2
8
  build_device_code_fakts,
3
9
  build_redeem_fakts,
4
10
  build_token_fakts,
5
11
  )
6
- from arkitekt_next.utils import create_arkitekt_next_folder
7
- from fakts_next.models import Manifest
12
+ from arkitekt_next.constants import DEFAULT_ARKITEKT_URL
13
+ from arkitekt_next.init_registry import InitHookRegistry, get_default_init_hook_registry
14
+ from arkitekt_next.qt.types import QtApp
8
15
  from arkitekt_next.service_registry import (
9
16
  ServiceBuilderRegistry,
10
17
  get_default_service_registry,
11
18
  )
12
- from arkitekt_next.constants import DEFAULT_ARKITEKT_URL
13
- from qtpy import QtWidgets, QtCore
14
- from typing import List, Optional
15
- import os
16
- import logging
17
- from arkitekt_next.qt.types import QtApp
19
+ from arkitekt_next.utils import create_arkitekt_next_folder
20
+ from fakts_next.models import Manifest
18
21
 
19
22
 
20
23
  def qt(
21
- identifier: str,
24
+ identifier: str | None = None,
22
25
  version: str = "0.0.1",
23
26
  logo: Optional[str] = None,
24
27
  scopes: Optional[List[str]] = None,
25
28
  url: str = DEFAULT_ARKITEKT_URL,
26
- headless: bool = False,
27
29
  log_level: str = "ERROR",
28
- parent: Optional[QtWidgets.QWidget] = None,
30
+ parent: Optional[QtCore.QObject] = None,
29
31
  token: Optional[str] = None,
30
32
  no_cache: bool = False,
31
33
  redeem_token: Optional[str] = None,
32
34
  app_kind: str = "development",
33
- registry: Optional[ServiceBuilderRegistry] = None,
35
+ service_registry: Optional[ServiceBuilderRegistry] = None,
34
36
  description: Optional[str] = None,
35
- **kwargs,
37
+ instance_id: str = "main",
38
+ init_hook_registry: Optional[InitHookRegistry] = None,
36
39
  ) -> QtApp:
37
40
  """Creates a next app
38
41
 
@@ -100,7 +103,11 @@ def qt(
100
103
  NextApp
101
104
  A built app, that can be used to interact with the ArkitektNext server
102
105
  """
103
- registry = registry or get_default_service_registry()
106
+ service_registry = service_registry or get_default_service_registry()
107
+ init_hook_registry = init_hook_registry or get_default_init_hook_registry()
108
+
109
+ if identifier is None:
110
+ identifier = __file__.split("/")[-1].replace(".py", "")
104
111
 
105
112
  url = os.getenv("FAKTS_URL", url)
106
113
  token = os.getenv("FAKTS_TOKEN", token)
@@ -110,9 +117,9 @@ def qt(
110
117
  identifier=identifier,
111
118
  scopes=scopes if scopes else ["openid"],
112
119
  logo=logo,
113
- requirements=registry.get_requirements(),
114
- description=description,
120
+ requirements=service_registry.get_requirements(),
115
121
  )
122
+
116
123
  if token:
117
124
  fakts_next = build_token_fakts(
118
125
  manifest=manifest,
@@ -122,16 +129,21 @@ def qt(
122
129
 
123
130
  elif redeem_token:
124
131
  fakts_next = build_redeem_fakts(
125
- manifest=manifest, redeem_token=redeem_token, url=url
132
+ manifest=manifest,
133
+ redeem_token=redeem_token,
134
+ url=url,
126
135
  )
127
136
  else:
128
137
  fakts_next = build_device_code_fakts(
129
138
  manifest=manifest,
130
139
  url=url,
131
140
  no_cache=no_cache,
141
+ headless=False,
132
142
  )
133
143
 
134
- params = kwargs
144
+ params = {
145
+ "instance_id": instance_id,
146
+ }
135
147
 
136
148
  create_arkitekt_next_folder(with_cache=True)
137
149
 
@@ -143,10 +155,13 @@ def qt(
143
155
  logging.basicConfig(level=log_level)
144
156
 
145
157
  app = QtApp(
158
+ parent=parent,
146
159
  fakts=fakts_next,
147
- services=registry.build_service_map(fakts=fakts_next, params=params),
160
+ services=service_registry.build_service_map(fakts=fakts_next, params=params),
148
161
  )
149
162
 
163
+ init_hook_registry.run_all(app)
164
+
150
165
  app.enter()
151
166
 
152
167
  return app
@@ -1,26 +1,20 @@
1
1
  from arkitekt_next.app.app import App
2
- from typing import List, Callable, Dict, Any
2
+ from typing import Callable, TypeVar, ParamSpec, Any, Optional, Type
3
+ from types import TracebackType
4
+ from koil.qt import async_to_qt
5
+ from koil import run_spawned
6
+ from qtpy import QtCore
7
+
8
+ R = TypeVar("R")
9
+ P = ParamSpec("P")
3
10
 
4
11
 
5
12
  class QtApp(App):
6
13
  """An app that is built with the easy builder"""
7
14
 
8
- hooks: Dict[str, List[Callable]] = {
9
- "on_start": [],
10
- "on_stop": [],
11
- "on_error": [],
12
- "on_message": [],
13
- "on_warning": [],
14
- "on_info": [],
15
- "on_debug": [],
16
- "on_enter": [],
17
- }
18
-
19
- def register_hook(self, hook_name: str, hook: Callable):
20
- """Register a hook"""
21
- self.hooks[hook_name].append(hook)
22
-
23
- def register(self, *args, **kwargs):
15
+ parent: QtCore.QObject
16
+
17
+ def register(self, *args: Any, **kwargs: Any) -> None:
24
18
  """Register a function with the app (not in the Qt event loop)
25
19
 
26
20
  This is useful for functions that do not need access to the Qt event loop
@@ -31,7 +25,7 @@ class QtApp(App):
31
25
  """
32
26
  self.services["rekuest"].register(*args, **kwargs)
33
27
 
34
- def register_in_qt_loop(self, function: Callable, **kwargs):
28
+ def register_in_qt_loop(self, function: Callable[..., Any], **kwargs: Any):
35
29
  """Register a function in the Qt event loop
36
30
 
37
31
  This is useful for functions that need to be resolved in the Qt event loop and are
@@ -40,13 +34,13 @@ class QtApp(App):
40
34
 
41
35
  """
42
36
 
43
- from rekuest_next.qt.builders import qtinloopactifier
37
+ from rekuest_next.qt.builders import qtinloopactifier # type: ignore
44
38
 
45
39
  return self.services["rekuest"].register(
46
40
  function, actifier=qtinloopactifier, **kwargs
47
41
  )
48
42
 
49
- def register_with_qt_future(self, function: Callable, **kwargs):
43
+ def register_with_qt_future(self, function: Callable[..., Any], **kwargs: Any):
50
44
  """Register a function with a future that can be resolved in the Qt event loop
51
45
 
52
46
  This is useful for functions that need to be resolved in the Qt event loop, but
@@ -90,19 +84,27 @@ class QtApp(App):
90
84
 
91
85
 
92
86
  """
93
- from rekuest_next.qt.builders import qtwithfutureactifier
87
+ from rekuest_next.qt.builders import qtwithfutureactifier # type: ignore
94
88
 
95
89
  return self.services["rekuest"].register(
96
90
  function, actifier=qtwithfutureactifier, **kwargs
97
91
  )
98
92
 
99
- def register_with_qt_generator(self, function: Callable, **kwargs):
100
- from rekuest_next.qt.builders import qtwithgeneratoractifier
93
+ def register_with_qt_generator(self, function: Callable[..., Any], **kwargs: Any):
94
+ from rekuest_next.qt.builders import qtwithgeneratoractifier # type: ignore
101
95
 
102
96
  return self.services["rekuest"].register(
103
97
  function, actifier=qtwithgeneratoractifier, **kwargs
104
98
  )
105
99
 
100
+ def wrap(self, function: Callable[P, R]) -> async_to_qt[R, P]:
101
+ """ """
102
+
103
+ async def wrappable(*args: P.args, **kwargs: P.kwargs) -> R:
104
+ return await run_spawned(function, *args, **kwargs)
105
+
106
+ return async_to_qt(wrappable, parent=self.parent)
107
+
106
108
  def run(self):
107
109
  """Run the app"""
108
110
  self.services["rekuest"].run()
@@ -114,6 +116,11 @@ class QtApp(App):
114
116
 
115
117
  return self
116
118
 
117
- async def __aexit__(self, exc_type, exc_value, traceback):
119
+ async def __aexit__(
120
+ self,
121
+ exc_type: Optional[Type[BaseException]],
122
+ exc_value: Optional[BaseException],
123
+ traceback: Optional[TracebackType],
124
+ ) -> None:
118
125
  for service in self.services.values():
119
126
  await service.__aexit__(exc_type, exc_value, traceback)
@@ -1,23 +1,23 @@
1
1
  [project]
2
2
  name = "arkitekt-next"
3
- version = "0.23.0"
3
+ version = "0.25.0"
4
4
  description = "client for the arkitekt_next platform"
5
5
  authors = [{ name = "jhnnsrs", email = "jhnnsrs@gmail.com" }]
6
6
  requires-python = ">=3.11,<4"
7
7
  readme = "README.md"
8
8
  license = "MIT"
9
9
  dependencies = [
10
- "fakts-next>=2.1.0",
10
+ "fakts-next>=2.2.0",
11
11
  "dokker>=2.3.0",
12
- "koil>=2.0.4",
13
- "rath>=3.6.0",
12
+ "koil>=2.0.5",
13
+ "rath>=3.7.0",
14
14
  "click>=8.2.0",
15
- "rekuest-next>=0.13.1",
15
+ "rekuest-next>=0.15.0",
16
16
  "kabinet>=0.7.0",
17
17
  "semver>=3.0.4",
18
18
  "rich-click>=1.8.8",
19
19
  "watchfiles>=1.0.5",
20
- "turms>=0.9.2",
20
+ "turms>=0.10.0",
21
21
  ]
22
22
 
23
23
  [project.optional-dependencies]
@@ -56,6 +56,9 @@ blok = [
56
56
  [project.scripts]
57
57
  arkitekt-next = "arkitekt_next.cli.main:cli"
58
58
 
59
+ [project.entry-points.pytest11]
60
+ arkitekt_next = "arkitekt_next.pytest"
61
+
59
62
  [tool.uv]
60
63
  dev-dependencies = [
61
64
  "autoflake>=1.7.7,<2",
@@ -64,7 +67,7 @@ dev-dependencies = [
64
67
  "pytest-cov>=4.0.0,<5",
65
68
  "pytest-aiohttp>=1.0.4,<2",
66
69
  "rich-click>=1.8",
67
- "mikro-next>=0.12.0",
70
+ "mikro-next>=0.13.0",
68
71
  "python-semantic-release>=9.21.1",
69
72
  "qtpy>=2.4.3",
70
73
  "arkitekt-server>=1.3",
@@ -73,11 +76,11 @@ dev-dependencies = [
73
76
  "rekuest-next>=0.13.1",
74
77
  "kabinet>=0.6.0",
75
78
  "alpaka>=0.4.0",
76
- "kraph>=0.3.0",
79
+ "kraph>=0.4.0",
77
80
  "fluss-next>=0.7.0",
78
81
  "lovekit>=1.1.0",
79
82
  "unlok-next>=1.1.1",
80
- "reaktion-next>=0.3.1",
83
+ "reaktion-next>=0.4.0",
81
84
  ]
82
85
 
83
86
  [tool.hatch.build.targets.sdist]
File without changes
File without changes