fleet-python 0.2.52__tar.gz → 0.2.53__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 fleet-python might be problematic. Click here for more details.
- {fleet_python-0.2.52 → fleet_python-0.2.53}/PKG-INFO +1 -1
- {fleet_python-0.2.52 → fleet_python-0.2.53}/fleet/_async/__init__.py +7 -2
- {fleet_python-0.2.52 → fleet_python-0.2.53}/fleet/_async/client.py +9 -4
- {fleet_python-0.2.52 → fleet_python-0.2.53}/fleet/client.py +9 -4
- {fleet_python-0.2.52 → fleet_python-0.2.53}/fleet_python.egg-info/PKG-INFO +1 -1
- {fleet_python-0.2.52 → fleet_python-0.2.53}/pyproject.toml +1 -1
- {fleet_python-0.2.52 → fleet_python-0.2.53}/LICENSE +0 -0
- {fleet_python-0.2.52 → fleet_python-0.2.53}/README.md +0 -0
- {fleet_python-0.2.52 → fleet_python-0.2.53}/examples/diff_example.py +0 -0
- {fleet_python-0.2.52 → fleet_python-0.2.53}/examples/dsl_example.py +0 -0
- {fleet_python-0.2.52 → fleet_python-0.2.53}/examples/example.py +0 -0
- {fleet_python-0.2.52 → fleet_python-0.2.53}/examples/exampleResume.py +0 -0
- {fleet_python-0.2.52 → fleet_python-0.2.53}/examples/example_account.py +0 -0
- {fleet_python-0.2.52 → fleet_python-0.2.53}/examples/example_action_log.py +0 -0
- {fleet_python-0.2.52 → fleet_python-0.2.53}/examples/example_client.py +0 -0
- {fleet_python-0.2.52 → fleet_python-0.2.53}/examples/example_mcp_anthropic.py +0 -0
- {fleet_python-0.2.52 → fleet_python-0.2.53}/examples/example_mcp_openai.py +0 -0
- {fleet_python-0.2.52 → fleet_python-0.2.53}/examples/example_sync.py +0 -0
- {fleet_python-0.2.52 → fleet_python-0.2.53}/examples/example_task.py +0 -0
- {fleet_python-0.2.52 → fleet_python-0.2.53}/examples/example_tasks.py +0 -0
- {fleet_python-0.2.52 → fleet_python-0.2.53}/examples/example_verifier.py +0 -0
- {fleet_python-0.2.52 → fleet_python-0.2.53}/examples/gemini_example.py +0 -0
- {fleet_python-0.2.52 → fleet_python-0.2.53}/examples/json_tasks_example.py +0 -0
- {fleet_python-0.2.52 → fleet_python-0.2.53}/examples/nova_act_example.py +0 -0
- {fleet_python-0.2.52 → fleet_python-0.2.53}/examples/openai_example.py +0 -0
- {fleet_python-0.2.52 → fleet_python-0.2.53}/examples/openai_simple_example.py +0 -0
- {fleet_python-0.2.52 → fleet_python-0.2.53}/examples/query_builder_example.py +0 -0
- {fleet_python-0.2.52 → fleet_python-0.2.53}/examples/quickstart.py +0 -0
- {fleet_python-0.2.52 → fleet_python-0.2.53}/examples/test_cdp_logging.py +0 -0
- {fleet_python-0.2.52 → fleet_python-0.2.53}/fleet/__init__.py +0 -0
- {fleet_python-0.2.52 → fleet_python-0.2.53}/fleet/_async/base.py +0 -0
- {fleet_python-0.2.52 → fleet_python-0.2.53}/fleet/_async/env/__init__.py +0 -0
- {fleet_python-0.2.52 → fleet_python-0.2.53}/fleet/_async/env/client.py +0 -0
- {fleet_python-0.2.52 → fleet_python-0.2.53}/fleet/_async/exceptions.py +0 -0
- {fleet_python-0.2.52 → fleet_python-0.2.53}/fleet/_async/global_client.py +0 -0
- {fleet_python-0.2.52 → fleet_python-0.2.53}/fleet/_async/instance/__init__.py +0 -0
- {fleet_python-0.2.52 → fleet_python-0.2.53}/fleet/_async/instance/base.py +0 -0
- {fleet_python-0.2.52 → fleet_python-0.2.53}/fleet/_async/instance/client.py +0 -0
- {fleet_python-0.2.52 → fleet_python-0.2.53}/fleet/_async/models.py +0 -0
- {fleet_python-0.2.52 → fleet_python-0.2.53}/fleet/_async/resources/__init__.py +0 -0
- {fleet_python-0.2.52 → fleet_python-0.2.53}/fleet/_async/resources/base.py +0 -0
- {fleet_python-0.2.52 → fleet_python-0.2.53}/fleet/_async/resources/browser.py +0 -0
- {fleet_python-0.2.52 → fleet_python-0.2.53}/fleet/_async/resources/mcp.py +0 -0
- {fleet_python-0.2.52 → fleet_python-0.2.53}/fleet/_async/resources/sqlite.py +0 -0
- {fleet_python-0.2.52 → fleet_python-0.2.53}/fleet/_async/tasks.py +0 -0
- {fleet_python-0.2.52 → fleet_python-0.2.53}/fleet/_async/verifiers/__init__.py +0 -0
- {fleet_python-0.2.52 → fleet_python-0.2.53}/fleet/_async/verifiers/bundler.py +0 -0
- {fleet_python-0.2.52 → fleet_python-0.2.53}/fleet/_async/verifiers/verifier.py +0 -0
- {fleet_python-0.2.52 → fleet_python-0.2.53}/fleet/base.py +0 -0
- {fleet_python-0.2.52 → fleet_python-0.2.53}/fleet/config.py +0 -0
- {fleet_python-0.2.52 → fleet_python-0.2.53}/fleet/env/__init__.py +0 -0
- {fleet_python-0.2.52 → fleet_python-0.2.53}/fleet/env/client.py +0 -0
- {fleet_python-0.2.52 → fleet_python-0.2.53}/fleet/exceptions.py +0 -0
- {fleet_python-0.2.52 → fleet_python-0.2.53}/fleet/global_client.py +0 -0
- {fleet_python-0.2.52 → fleet_python-0.2.53}/fleet/instance/__init__.py +0 -0
- {fleet_python-0.2.52 → fleet_python-0.2.53}/fleet/instance/base.py +0 -0
- {fleet_python-0.2.52 → fleet_python-0.2.53}/fleet/instance/client.py +0 -0
- {fleet_python-0.2.52 → fleet_python-0.2.53}/fleet/instance/models.py +0 -0
- {fleet_python-0.2.52 → fleet_python-0.2.53}/fleet/models.py +0 -0
- {fleet_python-0.2.52 → fleet_python-0.2.53}/fleet/resources/__init__.py +0 -0
- {fleet_python-0.2.52 → fleet_python-0.2.53}/fleet/resources/base.py +0 -0
- {fleet_python-0.2.52 → fleet_python-0.2.53}/fleet/resources/browser.py +0 -0
- {fleet_python-0.2.52 → fleet_python-0.2.53}/fleet/resources/mcp.py +0 -0
- {fleet_python-0.2.52 → fleet_python-0.2.53}/fleet/resources/sqlite.py +0 -0
- {fleet_python-0.2.52 → fleet_python-0.2.53}/fleet/tasks.py +0 -0
- {fleet_python-0.2.52 → fleet_python-0.2.53}/fleet/types.py +0 -0
- {fleet_python-0.2.52 → fleet_python-0.2.53}/fleet/verifiers/__init__.py +0 -0
- {fleet_python-0.2.52 → fleet_python-0.2.53}/fleet/verifiers/bundler.py +0 -0
- {fleet_python-0.2.52 → fleet_python-0.2.53}/fleet/verifiers/code.py +0 -0
- {fleet_python-0.2.52 → fleet_python-0.2.53}/fleet/verifiers/db.py +0 -0
- {fleet_python-0.2.52 → fleet_python-0.2.53}/fleet/verifiers/decorator.py +0 -0
- {fleet_python-0.2.52 → fleet_python-0.2.53}/fleet/verifiers/parse.py +0 -0
- {fleet_python-0.2.52 → fleet_python-0.2.53}/fleet/verifiers/sql_differ.py +0 -0
- {fleet_python-0.2.52 → fleet_python-0.2.53}/fleet/verifiers/verifier.py +0 -0
- {fleet_python-0.2.52 → fleet_python-0.2.53}/fleet_python.egg-info/SOURCES.txt +0 -0
- {fleet_python-0.2.52 → fleet_python-0.2.53}/fleet_python.egg-info/dependency_links.txt +0 -0
- {fleet_python-0.2.52 → fleet_python-0.2.53}/fleet_python.egg-info/requires.txt +0 -0
- {fleet_python-0.2.52 → fleet_python-0.2.53}/fleet_python.egg-info/top_level.txt +0 -0
- {fleet_python-0.2.52 → fleet_python-0.2.53}/scripts/fix_sync_imports.py +0 -0
- {fleet_python-0.2.52 → fleet_python-0.2.53}/scripts/unasync.py +0 -0
- {fleet_python-0.2.52 → fleet_python-0.2.53}/setup.cfg +0 -0
|
@@ -193,13 +193,18 @@ async def export_tasks(
|
|
|
193
193
|
return await _async_global_client.get_client().export_tasks(env_key, filename)
|
|
194
194
|
|
|
195
195
|
|
|
196
|
-
async def import_tasks(filename: str):
|
|
196
|
+
async def import_tasks(filename: str, project_key: Optional[str] = None):
|
|
197
197
|
"""Import tasks from a JSON file.
|
|
198
198
|
|
|
199
|
+
Args:
|
|
200
|
+
filename: Path to the JSON file of Task objects to import
|
|
201
|
+
project_key: Optional project key to associate with the tasks
|
|
202
|
+
|
|
199
203
|
Example:
|
|
200
204
|
await fleet.import_tasks("tasks.json")
|
|
205
|
+
await fleet.import_tasks("tasks.json", project_key="my-project")
|
|
201
206
|
"""
|
|
202
|
-
return await _async_global_client.get_client().import_tasks(filename)
|
|
207
|
+
return await _async_global_client.get_client().import_tasks(filename, project_key)
|
|
203
208
|
|
|
204
209
|
|
|
205
210
|
async def account() -> AccountResponse:
|
|
@@ -560,29 +560,34 @@ class AsyncFleet:
|
|
|
560
560
|
logger.info("No tasks found to export")
|
|
561
561
|
return None
|
|
562
562
|
|
|
563
|
-
async def import_single_task(self, task: Task):
|
|
563
|
+
async def import_single_task(self, task: Task, project_key: Optional[str] = None):
|
|
564
564
|
"""Import a single task.
|
|
565
565
|
|
|
566
566
|
Args:
|
|
567
567
|
task: Task object to import
|
|
568
|
+
project_key: Optional project key to associate with the task
|
|
568
569
|
|
|
569
570
|
Returns:
|
|
570
571
|
Response from the API, or None if the import failed
|
|
571
572
|
"""
|
|
572
573
|
try:
|
|
574
|
+
params = {}
|
|
575
|
+
if project_key:
|
|
576
|
+
params["project_key"] = project_key
|
|
573
577
|
response = await self.client.request(
|
|
574
|
-
"POST", "/v1/tasks", json=task.model_dump()
|
|
578
|
+
"POST", "/v1/tasks", json=task.model_dump(), params=params
|
|
575
579
|
)
|
|
576
580
|
return response
|
|
577
581
|
except Exception as e:
|
|
578
582
|
logger.error(f"Failed to import task {task.key}: {e}")
|
|
579
583
|
return None
|
|
580
584
|
|
|
581
|
-
async def import_tasks(self, filename: str):
|
|
585
|
+
async def import_tasks(self, filename: str, project_key: Optional[str] = None):
|
|
582
586
|
"""Import tasks from a JSON file.
|
|
583
587
|
|
|
584
588
|
Args:
|
|
585
589
|
filename: Path to the JSON file of Task objects to import
|
|
590
|
+
project_key: Optional project key to associate with the tasks
|
|
586
591
|
|
|
587
592
|
Returns:
|
|
588
593
|
List[Task] containing imported Task objects
|
|
@@ -601,7 +606,7 @@ class AsyncFleet:
|
|
|
601
606
|
|
|
602
607
|
async def import_with_semaphore(task):
|
|
603
608
|
async with semaphore:
|
|
604
|
-
return await self.import_single_task(task)
|
|
609
|
+
return await self.import_single_task(task, project_key)
|
|
605
610
|
|
|
606
611
|
# Use asyncio.gather to parallelize the imports
|
|
607
612
|
responses = await asyncio.gather(
|
|
@@ -566,27 +566,32 @@ class Fleet:
|
|
|
566
566
|
logger.info("No tasks found to export")
|
|
567
567
|
return None
|
|
568
568
|
|
|
569
|
-
def import_single_task(self, task: Task):
|
|
569
|
+
def import_single_task(self, task: Task, project_key: Optional[str] = None):
|
|
570
570
|
"""Import a single task.
|
|
571
571
|
|
|
572
572
|
Args:
|
|
573
573
|
task: Task object to import
|
|
574
|
+
project_key: Optional project key to associate with the task
|
|
574
575
|
|
|
575
576
|
Returns:
|
|
576
577
|
Response from the API, or None if the import failed
|
|
577
578
|
"""
|
|
578
579
|
try:
|
|
579
|
-
|
|
580
|
+
params = {}
|
|
581
|
+
if project_key:
|
|
582
|
+
params["project_key"] = project_key
|
|
583
|
+
response = self.client.request("POST", "/v1/tasks", json=task.model_dump(), params=params)
|
|
580
584
|
return response
|
|
581
585
|
except Exception as e:
|
|
582
586
|
logger.error(f"Failed to import task {task.key}: {e}")
|
|
583
587
|
return None
|
|
584
588
|
|
|
585
|
-
def import_tasks(self, filename: str):
|
|
589
|
+
def import_tasks(self, filename: str, project_key: Optional[str] = None):
|
|
586
590
|
"""Import tasks from a JSON file.
|
|
587
591
|
|
|
588
592
|
Args:
|
|
589
593
|
filename: Path to the JSON file of Task objects to import
|
|
594
|
+
project_key: Optional project key to associate with the tasks
|
|
590
595
|
|
|
591
596
|
Returns:
|
|
592
597
|
List[Task] containing imported Task objects
|
|
@@ -602,7 +607,7 @@ class Fleet:
|
|
|
602
607
|
|
|
603
608
|
# Use ThreadPoolExecutor to parallelize the imports with max 20 workers
|
|
604
609
|
with concurrent.futures.ThreadPoolExecutor(max_workers=20) as executor:
|
|
605
|
-
responses = list(executor.map(self.import_single_task, tasks))
|
|
610
|
+
responses = list(executor.map(lambda t: self.import_single_task(t, project_key), tasks))
|
|
606
611
|
|
|
607
612
|
# Filter out None values (failed imports)
|
|
608
613
|
return [r for r in responses if r is not None]
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|