fleet-python 0.2.15__py3-none-any.whl → 0.2.16__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 fleet-python might be problematic. Click here for more details.
- fleet/_async/client.py +19 -1
- fleet/client.py +19 -0
- {fleet_python-0.2.15.dist-info → fleet_python-0.2.16.dist-info}/METADATA +1 -1
- {fleet_python-0.2.15.dist-info → fleet_python-0.2.16.dist-info}/RECORD +7 -7
- {fleet_python-0.2.15.dist-info → fleet_python-0.2.16.dist-info}/WHEEL +0 -0
- {fleet_python-0.2.15.dist-info → fleet_python-0.2.16.dist-info}/licenses/LICENSE +0 -0
- {fleet_python-0.2.15.dist-info → fleet_python-0.2.16.dist-info}/top_level.txt +0 -0
fleet/_async/client.py
CHANGED
|
@@ -19,7 +19,7 @@ import cloudpickle
|
|
|
19
19
|
import httpx
|
|
20
20
|
import logging
|
|
21
21
|
import os
|
|
22
|
-
from typing import List, Optional
|
|
22
|
+
from typing import List, Optional, Dict
|
|
23
23
|
|
|
24
24
|
from .base import EnvironmentBase, AsyncWrapper
|
|
25
25
|
from ..models import (
|
|
@@ -51,6 +51,7 @@ class AsyncEnv(EnvironmentBase):
|
|
|
51
51
|
def __init__(self, client: Optional[AsyncWrapper], **kwargs):
|
|
52
52
|
super().__init__(**kwargs)
|
|
53
53
|
self._client = client
|
|
54
|
+
self._apps: Dict[str, AsyncInstanceClient] = {}
|
|
54
55
|
self._instance: Optional[AsyncInstanceClient] = None
|
|
55
56
|
|
|
56
57
|
@property
|
|
@@ -60,6 +61,23 @@ class AsyncEnv(EnvironmentBase):
|
|
|
60
61
|
self.manager_url, self._client.httpx_client if self._client else None
|
|
61
62
|
)
|
|
62
63
|
return self._instance
|
|
64
|
+
|
|
65
|
+
def app(self, name: str) -> AsyncInstanceClient:
|
|
66
|
+
if name not in self._apps:
|
|
67
|
+
# Extract base URL by removing the current app path (e.g., /sentry/api/v1/env)
|
|
68
|
+
# manager_url looks like: https://xxx.fleetai.com/sentry/api/v1/env
|
|
69
|
+
base_url = self.manager_url.split('/api/v1/env')[0]
|
|
70
|
+
# Remove the current app name (e.g., /sentry) to get the root
|
|
71
|
+
if '/' in base_url:
|
|
72
|
+
parts = base_url.rsplit('/', 1)
|
|
73
|
+
if len(parts) == 2:
|
|
74
|
+
base_url = parts[0]
|
|
75
|
+
|
|
76
|
+
self._apps[name] = AsyncInstanceClient(
|
|
77
|
+
f"{base_url}/{name}/api/v1/env",
|
|
78
|
+
self._client.httpx_client if self._client else None,
|
|
79
|
+
)
|
|
80
|
+
return self._apps[name]
|
|
63
81
|
|
|
64
82
|
@property
|
|
65
83
|
def _load_client(self) -> AsyncWrapper:
|
fleet/client.py
CHANGED
|
@@ -143,6 +143,7 @@ class Environment(EnvironmentBase):
|
|
|
143
143
|
super().__init__(**kwargs)
|
|
144
144
|
self._client = client
|
|
145
145
|
self._instance: Optional[InstanceClient] = None
|
|
146
|
+
self._apps: Dict[str, InstanceClient] = {}
|
|
146
147
|
self._session_id: Optional[str] = None # ADD THIS
|
|
147
148
|
|
|
148
149
|
@property
|
|
@@ -155,6 +156,24 @@ class Environment(EnvironmentBase):
|
|
|
155
156
|
)
|
|
156
157
|
return self._instance
|
|
157
158
|
|
|
159
|
+
def app(self, name: str) -> InstanceClient:
|
|
160
|
+
if name not in self._apps:
|
|
161
|
+
# Extract base URL by removing the current app path (e.g., /sentry/api/v1/env)
|
|
162
|
+
# manager_url looks like: https://xxx.fleetai.com/sentry/api/v1/env
|
|
163
|
+
base_url = self.manager_url.split('/api/v1/env')[0]
|
|
164
|
+
# Remove the current app name (e.g., /sentry) to get the root
|
|
165
|
+
if '/' in base_url:
|
|
166
|
+
parts = base_url.rsplit('/', 1)
|
|
167
|
+
if len(parts) == 2:
|
|
168
|
+
base_url = parts[0]
|
|
169
|
+
|
|
170
|
+
self._apps[name] = InstanceClient(
|
|
171
|
+
f"{base_url}/{name}/api/v1/env",
|
|
172
|
+
self.env_key,
|
|
173
|
+
self._client.httpx_client if self._client else None,
|
|
174
|
+
)
|
|
175
|
+
return self._apps[name]
|
|
176
|
+
|
|
158
177
|
@property
|
|
159
178
|
def session_id(self) -> Optional[str]: # ADD THIS PROPERTY
|
|
160
179
|
"""Get the current tool logging session ID."""
|
|
@@ -17,7 +17,7 @@ examples/query_builder_example.py,sha256=Q3lUBETHpu1aS2FXAO79ADYqCxOjMMMZNgCcFVa
|
|
|
17
17
|
examples/quickstart.py,sha256=1VT39IRRhemsJgxi0O0gprdpcw7HB4pYO97GAYagIcg,3788
|
|
18
18
|
fleet/__init__.py,sha256=V2y7yMsloc56E4QdluakrVRiITQLmasxmAOBJ1oJ3cU,2365
|
|
19
19
|
fleet/base.py,sha256=0yYuMN0lBkrfTTZBt5NQp5112xWgziuWEk4GuHJB1wE,9189
|
|
20
|
-
fleet/client.py,sha256=
|
|
20
|
+
fleet/client.py,sha256=_1SwqqmgrYkzqm50X27yUdpEqe--vqBPmTLOImg6sdA,28514
|
|
21
21
|
fleet/config.py,sha256=zd19st83NJdW9DdOq7Irpc0x-iUnMad0JOtAr_nD5DM,273
|
|
22
22
|
fleet/exceptions.py,sha256=fUmPwWhnT8SR97lYsRq0kLHQHKtSh2eJS0VQ2caSzEI,5055
|
|
23
23
|
fleet/models.py,sha256=YMHFAgBF4OqoAOv-arHze3bPDDZ5DAzb3CXhVLF6pPw,9019
|
|
@@ -26,7 +26,7 @@ fleet/tasks.py,sha256=w-0vVGfEuCWRHMEJ73SN141J7Lz2pD_0v-nNG4TyJTU,1645
|
|
|
26
26
|
fleet/types.py,sha256=eXeI8BFmiU5hln0PVvJbUZs7BSjl6wSqAtN9zaJT6yY,652
|
|
27
27
|
fleet/_async/__init__.py,sha256=AJWCnuo7XKja4yBb8fK2wX7ntciLXQrpzdRHwjTRP6M,62
|
|
28
28
|
fleet/_async/base.py,sha256=s0rYOtXsMJeitOvpa-Oh8ciLV226p_TIPp3fplzWvV4,9209
|
|
29
|
-
fleet/_async/client.py,sha256=
|
|
29
|
+
fleet/_async/client.py,sha256=1ooP-8uIXIpqeRlNR6JIdnOrzD4ZLxgd9Mi1qwsKRFo,10555
|
|
30
30
|
fleet/_async/exceptions.py,sha256=fUmPwWhnT8SR97lYsRq0kLHQHKtSh2eJS0VQ2caSzEI,5055
|
|
31
31
|
fleet/_async/playwright.py,sha256=NXKcwJezl6jEV2CKBgeaB7zLshFWypgSA5GYXevDRX8,8908
|
|
32
32
|
fleet/_async/tasks.py,sha256=w-0vVGfEuCWRHMEJ73SN141J7Lz2pD_0v-nNG4TyJTU,1645
|
|
@@ -60,10 +60,10 @@ fleet/verifiers/db.py,sha256=tssmvJjDHuBIy8qlL_P5-UdmEFUw2DZcqLsWZ8ot3Xw,27766
|
|
|
60
60
|
fleet/verifiers/decorator.py,sha256=Q-KHhicnIYFwX7FX_VZguzNfu8ZslqNUeWxcS2CwNVY,3386
|
|
61
61
|
fleet/verifiers/sql_differ.py,sha256=dmiGCFXVMEMbAX519OjhVqgA8ZvhnvdmC1BVpL7QCF0,6490
|
|
62
62
|
fleet/verifiers/verifier.py,sha256=C5L24M7VBHWKaWlryC1EdW1g7keZBGzVSjgXC_SlpXA,12205
|
|
63
|
-
fleet_python-0.2.
|
|
63
|
+
fleet_python-0.2.16.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
64
64
|
scripts/fix_sync_imports.py,sha256=BIQfnaOoQ7bwR1c-pDqH9ifN47W1bwL7OafWVXZNkuA,4368
|
|
65
65
|
scripts/unasync.py,sha256=--Fmaae47o-dZ1HYgX1c3Nvi-rMjcFymTRlJcWWnmpw,725
|
|
66
|
-
fleet_python-0.2.
|
|
67
|
-
fleet_python-0.2.
|
|
68
|
-
fleet_python-0.2.
|
|
69
|
-
fleet_python-0.2.
|
|
66
|
+
fleet_python-0.2.16.dist-info/METADATA,sha256=cntZGoC-jIhNPMXU18gUUGLsoM752--JWZS5mRjGyhg,3297
|
|
67
|
+
fleet_python-0.2.16.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
68
|
+
fleet_python-0.2.16.dist-info/top_level.txt,sha256=_3DSmTohvSDf3AIP_BYfGzhwO1ECFwuzg83X-wHCx3Y,23
|
|
69
|
+
fleet_python-0.2.16.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|