fleet-python 0.2.78__tar.gz → 0.2.79__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.
- {fleet_python-0.2.78/fleet_python.egg-info → fleet_python-0.2.79}/PKG-INFO +1 -1
- {fleet_python-0.2.78 → fleet_python-0.2.79}/fleet/__init__.py +1 -1
- {fleet_python-0.2.78 → fleet_python-0.2.79}/fleet/_async/__init__.py +1 -1
- {fleet_python-0.2.78 → fleet_python-0.2.79}/fleet/_async/base.py +1 -1
- {fleet_python-0.2.78 → fleet_python-0.2.79}/fleet/_async/client.py +19 -1
- {fleet_python-0.2.78 → fleet_python-0.2.79}/fleet/_async/resources/sqlite.py +34 -7
- {fleet_python-0.2.78 → fleet_python-0.2.79}/fleet/base.py +1 -1
- {fleet_python-0.2.78 → fleet_python-0.2.79}/fleet/client.py +19 -1
- {fleet_python-0.2.78 → fleet_python-0.2.79}/fleet/resources/sqlite.py +34 -7
- {fleet_python-0.2.78 → fleet_python-0.2.79/fleet_python.egg-info}/PKG-INFO +1 -1
- {fleet_python-0.2.78 → fleet_python-0.2.79}/pyproject.toml +1 -1
- {fleet_python-0.2.78 → fleet_python-0.2.79}/LICENSE +0 -0
- {fleet_python-0.2.78 → fleet_python-0.2.79}/README.md +0 -0
- {fleet_python-0.2.78 → fleet_python-0.2.79}/examples/diff_example.py +0 -0
- {fleet_python-0.2.78 → fleet_python-0.2.79}/examples/dsl_example.py +0 -0
- {fleet_python-0.2.78 → fleet_python-0.2.79}/examples/example.py +0 -0
- {fleet_python-0.2.78 → fleet_python-0.2.79}/examples/exampleResume.py +0 -0
- {fleet_python-0.2.78 → fleet_python-0.2.79}/examples/example_account.py +0 -0
- {fleet_python-0.2.78 → fleet_python-0.2.79}/examples/example_action_log.py +0 -0
- {fleet_python-0.2.78 → fleet_python-0.2.79}/examples/example_client.py +0 -0
- {fleet_python-0.2.78 → fleet_python-0.2.79}/examples/example_mcp_anthropic.py +0 -0
- {fleet_python-0.2.78 → fleet_python-0.2.79}/examples/example_mcp_openai.py +0 -0
- {fleet_python-0.2.78 → fleet_python-0.2.79}/examples/example_sync.py +0 -0
- {fleet_python-0.2.78 → fleet_python-0.2.79}/examples/example_task.py +0 -0
- {fleet_python-0.2.78 → fleet_python-0.2.79}/examples/example_tasks.py +0 -0
- {fleet_python-0.2.78 → fleet_python-0.2.79}/examples/example_verifier.py +0 -0
- {fleet_python-0.2.78 → fleet_python-0.2.79}/examples/export_tasks.py +0 -0
- {fleet_python-0.2.78 → fleet_python-0.2.79}/examples/fetch_tasks.py +0 -0
- {fleet_python-0.2.78 → fleet_python-0.2.79}/examples/gemini_example.py +0 -0
- {fleet_python-0.2.78 → fleet_python-0.2.79}/examples/import_tasks.py +0 -0
- {fleet_python-0.2.78 → fleet_python-0.2.79}/examples/iterate_verifiers.py +0 -0
- {fleet_python-0.2.78 → fleet_python-0.2.79}/examples/json_tasks_example.py +0 -0
- {fleet_python-0.2.78 → fleet_python-0.2.79}/examples/nova_act_example.py +0 -0
- {fleet_python-0.2.78 → fleet_python-0.2.79}/examples/openai_example.py +0 -0
- {fleet_python-0.2.78 → fleet_python-0.2.79}/examples/openai_simple_example.py +0 -0
- {fleet_python-0.2.78 → fleet_python-0.2.79}/examples/query_builder_example.py +0 -0
- {fleet_python-0.2.78 → fleet_python-0.2.79}/examples/quickstart.py +0 -0
- {fleet_python-0.2.78 → fleet_python-0.2.79}/examples/test_cdp_logging.py +0 -0
- {fleet_python-0.2.78 → fleet_python-0.2.79}/fleet/_async/env/__init__.py +0 -0
- {fleet_python-0.2.78 → fleet_python-0.2.79}/fleet/_async/env/client.py +0 -0
- {fleet_python-0.2.78 → fleet_python-0.2.79}/fleet/_async/exceptions.py +0 -0
- {fleet_python-0.2.78 → fleet_python-0.2.79}/fleet/_async/global_client.py +0 -0
- {fleet_python-0.2.78 → fleet_python-0.2.79}/fleet/_async/instance/__init__.py +0 -0
- {fleet_python-0.2.78 → fleet_python-0.2.79}/fleet/_async/instance/base.py +0 -0
- {fleet_python-0.2.78 → fleet_python-0.2.79}/fleet/_async/instance/client.py +0 -0
- {fleet_python-0.2.78 → fleet_python-0.2.79}/fleet/_async/models.py +0 -0
- {fleet_python-0.2.78 → fleet_python-0.2.79}/fleet/_async/resources/__init__.py +0 -0
- {fleet_python-0.2.78 → fleet_python-0.2.79}/fleet/_async/resources/base.py +0 -0
- {fleet_python-0.2.78 → fleet_python-0.2.79}/fleet/_async/resources/browser.py +0 -0
- {fleet_python-0.2.78 → fleet_python-0.2.79}/fleet/_async/resources/mcp.py +0 -0
- {fleet_python-0.2.78 → fleet_python-0.2.79}/fleet/_async/tasks.py +0 -0
- {fleet_python-0.2.78 → fleet_python-0.2.79}/fleet/_async/verifiers/__init__.py +0 -0
- {fleet_python-0.2.78 → fleet_python-0.2.79}/fleet/_async/verifiers/bundler.py +0 -0
- {fleet_python-0.2.78 → fleet_python-0.2.79}/fleet/_async/verifiers/verifier.py +0 -0
- {fleet_python-0.2.78 → fleet_python-0.2.79}/fleet/config.py +0 -0
- {fleet_python-0.2.78 → fleet_python-0.2.79}/fleet/env/__init__.py +0 -0
- {fleet_python-0.2.78 → fleet_python-0.2.79}/fleet/env/client.py +0 -0
- {fleet_python-0.2.78 → fleet_python-0.2.79}/fleet/exceptions.py +0 -0
- {fleet_python-0.2.78 → fleet_python-0.2.79}/fleet/global_client.py +0 -0
- {fleet_python-0.2.78 → fleet_python-0.2.79}/fleet/instance/__init__.py +0 -0
- {fleet_python-0.2.78 → fleet_python-0.2.79}/fleet/instance/base.py +0 -0
- {fleet_python-0.2.78 → fleet_python-0.2.79}/fleet/instance/client.py +0 -0
- {fleet_python-0.2.78 → fleet_python-0.2.79}/fleet/instance/models.py +0 -0
- {fleet_python-0.2.78 → fleet_python-0.2.79}/fleet/models.py +0 -0
- {fleet_python-0.2.78 → fleet_python-0.2.79}/fleet/resources/__init__.py +0 -0
- {fleet_python-0.2.78 → fleet_python-0.2.79}/fleet/resources/base.py +0 -0
- {fleet_python-0.2.78 → fleet_python-0.2.79}/fleet/resources/browser.py +0 -0
- {fleet_python-0.2.78 → fleet_python-0.2.79}/fleet/resources/mcp.py +0 -0
- {fleet_python-0.2.78 → fleet_python-0.2.79}/fleet/tasks.py +0 -0
- {fleet_python-0.2.78 → fleet_python-0.2.79}/fleet/types.py +0 -0
- {fleet_python-0.2.78 → fleet_python-0.2.79}/fleet/verifiers/__init__.py +0 -0
- {fleet_python-0.2.78 → fleet_python-0.2.79}/fleet/verifiers/bundler.py +0 -0
- {fleet_python-0.2.78 → fleet_python-0.2.79}/fleet/verifiers/code.py +0 -0
- {fleet_python-0.2.78 → fleet_python-0.2.79}/fleet/verifiers/db.py +0 -0
- {fleet_python-0.2.78 → fleet_python-0.2.79}/fleet/verifiers/decorator.py +0 -0
- {fleet_python-0.2.78 → fleet_python-0.2.79}/fleet/verifiers/parse.py +0 -0
- {fleet_python-0.2.78 → fleet_python-0.2.79}/fleet/verifiers/sql_differ.py +0 -0
- {fleet_python-0.2.78 → fleet_python-0.2.79}/fleet/verifiers/verifier.py +0 -0
- {fleet_python-0.2.78 → fleet_python-0.2.79}/fleet_python.egg-info/SOURCES.txt +0 -0
- {fleet_python-0.2.78 → fleet_python-0.2.79}/fleet_python.egg-info/dependency_links.txt +0 -0
- {fleet_python-0.2.78 → fleet_python-0.2.79}/fleet_python.egg-info/requires.txt +0 -0
- {fleet_python-0.2.78 → fleet_python-0.2.79}/fleet_python.egg-info/top_level.txt +0 -0
- {fleet_python-0.2.78 → fleet_python-0.2.79}/scripts/fix_sync_imports.py +0 -0
- {fleet_python-0.2.78 → fleet_python-0.2.79}/scripts/unasync.py +0 -0
- {fleet_python-0.2.78 → fleet_python-0.2.79}/setup.cfg +0 -0
- {fleet_python-0.2.78 → fleet_python-0.2.79}/tests/__init__.py +0 -0
- {fleet_python-0.2.78 → fleet_python-0.2.79}/tests/test_app_method.py +0 -0
- {fleet_python-0.2.78 → fleet_python-0.2.79}/tests/test_expect_only.py +0 -0
- {fleet_python-0.2.78 → fleet_python-0.2.79}/tests/test_instance_dispatch.py +0 -0
- {fleet_python-0.2.78 → fleet_python-0.2.79}/tests/test_sqlite_resource_dual_mode.py +0 -0
- {fleet_python-0.2.78 → fleet_python-0.2.79}/tests/test_sqlite_shared_memory_behavior.py +0 -0
- {fleet_python-0.2.78 → fleet_python-0.2.79}/tests/test_verifier_from_string.py +0 -0
|
@@ -795,6 +795,21 @@ class AsyncFleet:
|
|
|
795
795
|
if not is_embedded_error:
|
|
796
796
|
verifier_func = embedded_code
|
|
797
797
|
|
|
798
|
+
# Extract verifier metadata
|
|
799
|
+
verifier_id = task_response.verifier_id
|
|
800
|
+
if not verifier_id and task_response.verifier:
|
|
801
|
+
verifier_id = task_response.verifier.verifier_id
|
|
802
|
+
|
|
803
|
+
verifier_sha = None
|
|
804
|
+
if task_response.verifier:
|
|
805
|
+
verifier_sha = task_response.verifier.sha256
|
|
806
|
+
|
|
807
|
+
# Extract verifier_runtime_version from metadata if present
|
|
808
|
+
verifier_runtime_version = None
|
|
809
|
+
metadata = task_response.metadata or {}
|
|
810
|
+
if isinstance(metadata, dict):
|
|
811
|
+
verifier_runtime_version = metadata.get("verifier_runtime_version")
|
|
812
|
+
|
|
798
813
|
task = Task(
|
|
799
814
|
key=task_response.key,
|
|
800
815
|
prompt=task_response.prompt,
|
|
@@ -806,7 +821,10 @@ class AsyncFleet:
|
|
|
806
821
|
env_variables=task_response.env_variables or {},
|
|
807
822
|
verifier_func=verifier_func, # Set verifier code
|
|
808
823
|
verifier=verifier, # Use created verifier or None
|
|
809
|
-
|
|
824
|
+
verifier_id=verifier_id, # Set verifier_id
|
|
825
|
+
verifier_sha=verifier_sha, # Set verifier_sha
|
|
826
|
+
verifier_runtime_version=verifier_runtime_version, # Set verifier_runtime_version
|
|
827
|
+
metadata=metadata,
|
|
810
828
|
output_json_schema=getattr(task_response, "output_json_schema", None), # Get output_json_schema if available
|
|
811
829
|
)
|
|
812
830
|
tasks.append(task)
|
|
@@ -1456,19 +1456,46 @@ class AsyncSnapshotDiff:
|
|
|
1456
1456
|
async def expect_only_v1(self, allowed_changes: List[Dict[str, Any]]):
|
|
1457
1457
|
"""Ensure only specified changes occurred using the original (non-optimized) approach.
|
|
1458
1458
|
|
|
1459
|
-
This
|
|
1460
|
-
|
|
1459
|
+
This version attempts to use the /api/v1/env/diff/structured endpoint if available,
|
|
1460
|
+
falling back to local diff computation if the endpoint is not available.
|
|
1461
1461
|
|
|
1462
1462
|
Use this when you want the simpler, more predictable behavior of the original
|
|
1463
1463
|
implementation without any query optimizations.
|
|
1464
1464
|
"""
|
|
1465
|
-
#
|
|
1466
|
-
|
|
1465
|
+
# Try to use the structured diff endpoint if we have an HTTP client
|
|
1466
|
+
resource = self.after.resource
|
|
1467
|
+
if resource.client is not None and resource._mode == "http":
|
|
1468
|
+
api_diff = None
|
|
1469
|
+
try:
|
|
1470
|
+
payload = {}
|
|
1471
|
+
if self.ignore_config:
|
|
1472
|
+
payload["ignore_config"] = {
|
|
1473
|
+
"tables": list(self.ignore_config.tables),
|
|
1474
|
+
"fields": list(self.ignore_config.fields),
|
|
1475
|
+
"table_fields": {
|
|
1476
|
+
table: list(fields) for table, fields in self.ignore_config.table_fields.items()
|
|
1477
|
+
}
|
|
1478
|
+
}
|
|
1479
|
+
response = await resource.client.request(
|
|
1480
|
+
"POST",
|
|
1481
|
+
"/diff/structured",
|
|
1482
|
+
json=payload,
|
|
1483
|
+
)
|
|
1484
|
+
result = response.json()
|
|
1485
|
+
if result.get("success") and "diff" in result:
|
|
1486
|
+
api_diff = result["diff"]
|
|
1487
|
+
except Exception as e:
|
|
1488
|
+
# Fall back to local diff if API call fails
|
|
1489
|
+
print(f"Warning: Failed to fetch structured diff from API: {e}")
|
|
1490
|
+
print("Falling back to local diff computation...")
|
|
1491
|
+
|
|
1492
|
+
# Validate outside try block so AssertionError propagates
|
|
1493
|
+
if api_diff is not None:
|
|
1494
|
+
return await self._validate_diff_against_allowed_changes(api_diff, allowed_changes)
|
|
1467
1495
|
|
|
1468
|
-
#
|
|
1496
|
+
# Fall back to local diff computation
|
|
1497
|
+
await self._ensure_all_fetched()
|
|
1469
1498
|
diff = await self._collect()
|
|
1470
|
-
|
|
1471
|
-
# Validate using the original validation logic
|
|
1472
1499
|
return await self._validate_diff_against_allowed_changes(diff, allowed_changes)
|
|
1473
1500
|
|
|
1474
1501
|
|
|
@@ -811,6 +811,21 @@ class Fleet:
|
|
|
811
811
|
if not is_embedded_error:
|
|
812
812
|
verifier_func = embedded_code
|
|
813
813
|
|
|
814
|
+
# Extract verifier metadata
|
|
815
|
+
verifier_id = task_response.verifier_id
|
|
816
|
+
if not verifier_id and task_response.verifier:
|
|
817
|
+
verifier_id = task_response.verifier.verifier_id
|
|
818
|
+
|
|
819
|
+
verifier_sha = None
|
|
820
|
+
if task_response.verifier:
|
|
821
|
+
verifier_sha = task_response.verifier.sha256
|
|
822
|
+
|
|
823
|
+
# Extract verifier_runtime_version from metadata if present
|
|
824
|
+
verifier_runtime_version = None
|
|
825
|
+
metadata = task_response.metadata or {}
|
|
826
|
+
if isinstance(metadata, dict):
|
|
827
|
+
verifier_runtime_version = metadata.get("verifier_runtime_version")
|
|
828
|
+
|
|
814
829
|
task = Task(
|
|
815
830
|
key=task_response.key,
|
|
816
831
|
prompt=task_response.prompt,
|
|
@@ -822,7 +837,10 @@ class Fleet:
|
|
|
822
837
|
env_variables=task_response.env_variables or {},
|
|
823
838
|
verifier_func=verifier_func, # Set verifier code
|
|
824
839
|
verifier=verifier, # Use created verifier or None
|
|
825
|
-
|
|
840
|
+
verifier_id=verifier_id, # Set verifier_id
|
|
841
|
+
verifier_sha=verifier_sha, # Set verifier_sha
|
|
842
|
+
verifier_runtime_version=verifier_runtime_version, # Set verifier_runtime_version
|
|
843
|
+
metadata=metadata,
|
|
826
844
|
output_json_schema=getattr(task_response, "output_json_schema", None), # Get output_json_schema if available
|
|
827
845
|
)
|
|
828
846
|
tasks.append(task)
|
|
@@ -1476,19 +1476,46 @@ class SyncSnapshotDiff:
|
|
|
1476
1476
|
def expect_only_v1(self, allowed_changes: List[Dict[str, Any]]):
|
|
1477
1477
|
"""Ensure only specified changes occurred using the original (non-optimized) approach.
|
|
1478
1478
|
|
|
1479
|
-
This
|
|
1480
|
-
|
|
1479
|
+
This version attempts to use the /api/v1/env/diff/structured endpoint if available,
|
|
1480
|
+
falling back to local diff computation if the endpoint is not available.
|
|
1481
1481
|
|
|
1482
1482
|
Use this when you want the simpler, more predictable behavior of the original
|
|
1483
1483
|
implementation without any query optimizations.
|
|
1484
1484
|
"""
|
|
1485
|
-
#
|
|
1486
|
-
self.
|
|
1485
|
+
# Try to use the structured diff endpoint if we have an HTTP client
|
|
1486
|
+
resource = self.after.resource
|
|
1487
|
+
if resource.client is not None and resource._mode == "http":
|
|
1488
|
+
api_diff = None
|
|
1489
|
+
try:
|
|
1490
|
+
payload = {}
|
|
1491
|
+
if self.ignore_config:
|
|
1492
|
+
payload["ignore_config"] = {
|
|
1493
|
+
"tables": list(self.ignore_config.tables),
|
|
1494
|
+
"fields": list(self.ignore_config.fields),
|
|
1495
|
+
"table_fields": {
|
|
1496
|
+
table: list(fields) for table, fields in self.ignore_config.table_fields.items()
|
|
1497
|
+
}
|
|
1498
|
+
}
|
|
1499
|
+
response = resource.client.request(
|
|
1500
|
+
"POST",
|
|
1501
|
+
"/diff/structured",
|
|
1502
|
+
json=payload,
|
|
1503
|
+
)
|
|
1504
|
+
result = response.json()
|
|
1505
|
+
if result.get("success") and "diff" in result:
|
|
1506
|
+
api_diff = result["diff"]
|
|
1507
|
+
except Exception as e:
|
|
1508
|
+
# Fall back to local diff if API call fails
|
|
1509
|
+
print(f"Warning: Failed to fetch structured diff from API: {e}")
|
|
1510
|
+
print("Falling back to local diff computation...")
|
|
1511
|
+
|
|
1512
|
+
# Validate outside try block so AssertionError propagates
|
|
1513
|
+
if api_diff is not None:
|
|
1514
|
+
return self._validate_diff_against_allowed_changes(api_diff, allowed_changes)
|
|
1487
1515
|
|
|
1488
|
-
#
|
|
1516
|
+
# Fall back to local diff computation
|
|
1517
|
+
self._ensure_all_fetched()
|
|
1489
1518
|
diff = self._collect()
|
|
1490
|
-
|
|
1491
|
-
# Validate using the original validation logic
|
|
1492
1519
|
return self._validate_diff_against_allowed_changes(diff, allowed_changes)
|
|
1493
1520
|
|
|
1494
1521
|
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|