fleet-python 0.2.44__tar.gz → 0.2.45__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.44 → fleet_python-0.2.45}/PKG-INFO +1 -1
- {fleet_python-0.2.44 → fleet_python-0.2.45}/fleet/_async/tasks.py +24 -1
- {fleet_python-0.2.44 → fleet_python-0.2.45}/fleet/tasks.py +24 -4
- {fleet_python-0.2.44 → fleet_python-0.2.45}/fleet_python.egg-info/PKG-INFO +1 -1
- {fleet_python-0.2.44 → fleet_python-0.2.45}/pyproject.toml +1 -1
- {fleet_python-0.2.44 → fleet_python-0.2.45}/LICENSE +0 -0
- {fleet_python-0.2.44 → fleet_python-0.2.45}/README.md +0 -0
- {fleet_python-0.2.44 → fleet_python-0.2.45}/examples/diff_example.py +0 -0
- {fleet_python-0.2.44 → fleet_python-0.2.45}/examples/dsl_example.py +0 -0
- {fleet_python-0.2.44 → fleet_python-0.2.45}/examples/example.py +0 -0
- {fleet_python-0.2.44 → fleet_python-0.2.45}/examples/exampleResume.py +0 -0
- {fleet_python-0.2.44 → fleet_python-0.2.45}/examples/example_account.py +0 -0
- {fleet_python-0.2.44 → fleet_python-0.2.45}/examples/example_action_log.py +0 -0
- {fleet_python-0.2.44 → fleet_python-0.2.45}/examples/example_client.py +0 -0
- {fleet_python-0.2.44 → fleet_python-0.2.45}/examples/example_mcp_anthropic.py +0 -0
- {fleet_python-0.2.44 → fleet_python-0.2.45}/examples/example_mcp_openai.py +0 -0
- {fleet_python-0.2.44 → fleet_python-0.2.45}/examples/example_sync.py +0 -0
- {fleet_python-0.2.44 → fleet_python-0.2.45}/examples/example_task.py +0 -0
- {fleet_python-0.2.44 → fleet_python-0.2.45}/examples/example_tasks.py +0 -0
- {fleet_python-0.2.44 → fleet_python-0.2.45}/examples/example_verifier.py +0 -0
- {fleet_python-0.2.44 → fleet_python-0.2.45}/examples/gemini_example.py +0 -0
- {fleet_python-0.2.44 → fleet_python-0.2.45}/examples/json_tasks_example.py +0 -0
- {fleet_python-0.2.44 → fleet_python-0.2.45}/examples/nova_act_example.py +0 -0
- {fleet_python-0.2.44 → fleet_python-0.2.45}/examples/openai_example.py +0 -0
- {fleet_python-0.2.44 → fleet_python-0.2.45}/examples/openai_simple_example.py +0 -0
- {fleet_python-0.2.44 → fleet_python-0.2.45}/examples/query_builder_example.py +0 -0
- {fleet_python-0.2.44 → fleet_python-0.2.45}/examples/quickstart.py +0 -0
- {fleet_python-0.2.44 → fleet_python-0.2.45}/examples/test_cdp_logging.py +0 -0
- {fleet_python-0.2.44 → fleet_python-0.2.45}/fleet/__init__.py +0 -0
- {fleet_python-0.2.44 → fleet_python-0.2.45}/fleet/_async/__init__.py +0 -0
- {fleet_python-0.2.44 → fleet_python-0.2.45}/fleet/_async/base.py +0 -0
- {fleet_python-0.2.44 → fleet_python-0.2.45}/fleet/_async/client.py +0 -0
- {fleet_python-0.2.44 → fleet_python-0.2.45}/fleet/_async/env/__init__.py +0 -0
- {fleet_python-0.2.44 → fleet_python-0.2.45}/fleet/_async/env/client.py +0 -0
- {fleet_python-0.2.44 → fleet_python-0.2.45}/fleet/_async/exceptions.py +0 -0
- {fleet_python-0.2.44 → fleet_python-0.2.45}/fleet/_async/global_client.py +0 -0
- {fleet_python-0.2.44 → fleet_python-0.2.45}/fleet/_async/instance/__init__.py +0 -0
- {fleet_python-0.2.44 → fleet_python-0.2.45}/fleet/_async/instance/base.py +0 -0
- {fleet_python-0.2.44 → fleet_python-0.2.45}/fleet/_async/instance/client.py +0 -0
- {fleet_python-0.2.44 → fleet_python-0.2.45}/fleet/_async/models.py +0 -0
- {fleet_python-0.2.44 → fleet_python-0.2.45}/fleet/_async/resources/__init__.py +0 -0
- {fleet_python-0.2.44 → fleet_python-0.2.45}/fleet/_async/resources/base.py +0 -0
- {fleet_python-0.2.44 → fleet_python-0.2.45}/fleet/_async/resources/browser.py +0 -0
- {fleet_python-0.2.44 → fleet_python-0.2.45}/fleet/_async/resources/mcp.py +0 -0
- {fleet_python-0.2.44 → fleet_python-0.2.45}/fleet/_async/resources/sqlite.py +0 -0
- {fleet_python-0.2.44 → fleet_python-0.2.45}/fleet/_async/verifiers/__init__.py +0 -0
- {fleet_python-0.2.44 → fleet_python-0.2.45}/fleet/_async/verifiers/bundler.py +0 -0
- {fleet_python-0.2.44 → fleet_python-0.2.45}/fleet/_async/verifiers/verifier.py +0 -0
- {fleet_python-0.2.44 → fleet_python-0.2.45}/fleet/base.py +0 -0
- {fleet_python-0.2.44 → fleet_python-0.2.45}/fleet/client.py +0 -0
- {fleet_python-0.2.44 → fleet_python-0.2.45}/fleet/config.py +0 -0
- {fleet_python-0.2.44 → fleet_python-0.2.45}/fleet/env/__init__.py +0 -0
- {fleet_python-0.2.44 → fleet_python-0.2.45}/fleet/env/client.py +0 -0
- {fleet_python-0.2.44 → fleet_python-0.2.45}/fleet/exceptions.py +0 -0
- {fleet_python-0.2.44 → fleet_python-0.2.45}/fleet/global_client.py +0 -0
- {fleet_python-0.2.44 → fleet_python-0.2.45}/fleet/instance/__init__.py +0 -0
- {fleet_python-0.2.44 → fleet_python-0.2.45}/fleet/instance/base.py +0 -0
- {fleet_python-0.2.44 → fleet_python-0.2.45}/fleet/instance/client.py +0 -0
- {fleet_python-0.2.44 → fleet_python-0.2.45}/fleet/instance/models.py +0 -0
- {fleet_python-0.2.44 → fleet_python-0.2.45}/fleet/models.py +0 -0
- {fleet_python-0.2.44 → fleet_python-0.2.45}/fleet/resources/__init__.py +0 -0
- {fleet_python-0.2.44 → fleet_python-0.2.45}/fleet/resources/base.py +0 -0
- {fleet_python-0.2.44 → fleet_python-0.2.45}/fleet/resources/browser.py +0 -0
- {fleet_python-0.2.44 → fleet_python-0.2.45}/fleet/resources/mcp.py +0 -0
- {fleet_python-0.2.44 → fleet_python-0.2.45}/fleet/resources/sqlite.py +0 -0
- {fleet_python-0.2.44 → fleet_python-0.2.45}/fleet/types.py +0 -0
- {fleet_python-0.2.44 → fleet_python-0.2.45}/fleet/verifiers/__init__.py +0 -0
- {fleet_python-0.2.44 → fleet_python-0.2.45}/fleet/verifiers/bundler.py +0 -0
- {fleet_python-0.2.44 → fleet_python-0.2.45}/fleet/verifiers/code.py +0 -0
- {fleet_python-0.2.44 → fleet_python-0.2.45}/fleet/verifiers/db.py +0 -0
- {fleet_python-0.2.44 → fleet_python-0.2.45}/fleet/verifiers/decorator.py +0 -0
- {fleet_python-0.2.44 → fleet_python-0.2.45}/fleet/verifiers/parse.py +0 -0
- {fleet_python-0.2.44 → fleet_python-0.2.45}/fleet/verifiers/sql_differ.py +0 -0
- {fleet_python-0.2.44 → fleet_python-0.2.45}/fleet/verifiers/verifier.py +0 -0
- {fleet_python-0.2.44 → fleet_python-0.2.45}/fleet_python.egg-info/SOURCES.txt +0 -0
- {fleet_python-0.2.44 → fleet_python-0.2.45}/fleet_python.egg-info/dependency_links.txt +0 -0
- {fleet_python-0.2.44 → fleet_python-0.2.45}/fleet_python.egg-info/requires.txt +0 -0
- {fleet_python-0.2.44 → fleet_python-0.2.45}/fleet_python.egg-info/top_level.txt +0 -0
- {fleet_python-0.2.44 → fleet_python-0.2.45}/scripts/fix_sync_imports.py +0 -0
- {fleet_python-0.2.44 → fleet_python-0.2.45}/scripts/unasync.py +0 -0
- {fleet_python-0.2.44 → fleet_python-0.2.45}/setup.cfg +0 -0
|
@@ -24,7 +24,9 @@ class Task(BaseModel):
|
|
|
24
24
|
version: Optional[str] = Field(None, description="Task version")
|
|
25
25
|
verifier_func: Optional[str] = Field(None, description="Verifier function code")
|
|
26
26
|
verifier: Optional[Any] = Field(
|
|
27
|
-
None,
|
|
27
|
+
None,
|
|
28
|
+
description="Verifier function with decorator (async or sync)",
|
|
29
|
+
exclude=True # Exclude from JSON serialization
|
|
28
30
|
)
|
|
29
31
|
verifier_id: Optional[str] = Field(None, description="Verifier identifier")
|
|
30
32
|
verifier_sha: Optional[str] = Field(None, description="Verifier SHA256 hash")
|
|
@@ -63,6 +65,10 @@ class Task(BaseModel):
|
|
|
63
65
|
For sync environments, calls the sync verifier directly.
|
|
64
66
|
For async verifiers, automatically runs them with asyncio.run().
|
|
65
67
|
"""
|
|
68
|
+
# If verifier doesn't exist but verifier_func does, rebuild it
|
|
69
|
+
if not self.verifier and self.verifier_func:
|
|
70
|
+
self._rebuild_verifier()
|
|
71
|
+
|
|
66
72
|
if self.verifier:
|
|
67
73
|
import asyncio
|
|
68
74
|
import inspect
|
|
@@ -93,6 +99,10 @@ class Task(BaseModel):
|
|
|
93
99
|
For async environments, awaits the async verifier.
|
|
94
100
|
Works with both sync and async verifiers in async contexts.
|
|
95
101
|
"""
|
|
102
|
+
# If verifier doesn't exist but verifier_func does, rebuild it
|
|
103
|
+
if not self.verifier and self.verifier_func:
|
|
104
|
+
self._rebuild_verifier()
|
|
105
|
+
|
|
96
106
|
if self.verifier:
|
|
97
107
|
result = self.verifier.remote(*args, **kwargs)
|
|
98
108
|
# If it's a coroutine, await it
|
|
@@ -105,6 +115,19 @@ class Task(BaseModel):
|
|
|
105
115
|
else:
|
|
106
116
|
raise ValueError("No verifier function found for this task")
|
|
107
117
|
|
|
118
|
+
def _rebuild_verifier(self):
|
|
119
|
+
"""Rebuild the verifier from verifier_func string if it exists."""
|
|
120
|
+
if self.verifier_func:
|
|
121
|
+
# Use the same logic as in verifier_from_string
|
|
122
|
+
verifier_id = self.verifier_id or self.key
|
|
123
|
+
verifier = verifier_from_string(
|
|
124
|
+
verifier_func=self.verifier_func,
|
|
125
|
+
verifier_id=verifier_id,
|
|
126
|
+
verifier_key=self.key,
|
|
127
|
+
sha256=self.verifier_sha or "",
|
|
128
|
+
)
|
|
129
|
+
self.verifier = verifier
|
|
130
|
+
|
|
108
131
|
async def make_env(self, region: Optional[str] = None):
|
|
109
132
|
"""Create an environment instance for this task's environment.
|
|
110
133
|
|
|
@@ -2,11 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
|
-
import re
|
|
6
5
|
import asyncio
|
|
7
6
|
from datetime import datetime
|
|
8
7
|
from typing import Any, Dict, Optional, List
|
|
9
|
-
from uuid import UUID
|
|
10
8
|
|
|
11
9
|
from pydantic import BaseModel, Field, validator
|
|
12
10
|
|
|
@@ -27,7 +25,9 @@ class Task(BaseModel):
|
|
|
27
25
|
version: Optional[str] = Field(None, description="Task version")
|
|
28
26
|
verifier_func: Optional[str] = Field(None, description="Verifier function code")
|
|
29
27
|
verifier: Optional[Any] = Field(
|
|
30
|
-
None,
|
|
28
|
+
None,
|
|
29
|
+
description="Verifier function with decorator (async or sync)",
|
|
30
|
+
exclude=True,
|
|
31
31
|
)
|
|
32
32
|
verifier_id: Optional[str] = Field(None, description="Verifier identifier")
|
|
33
33
|
verifier_sha: Optional[str] = Field(None, description="Verifier SHA256 hash")
|
|
@@ -66,6 +66,10 @@ class Task(BaseModel):
|
|
|
66
66
|
For sync environments, calls the sync verifier directly.
|
|
67
67
|
For async verifiers, automatically runs them with asyncio.run().
|
|
68
68
|
"""
|
|
69
|
+
# If verifier doesn't exist but verifier_func does, rebuild it
|
|
70
|
+
if not self.verifier and self.verifier_func:
|
|
71
|
+
self._rebuild_verifier()
|
|
72
|
+
|
|
69
73
|
if self.verifier:
|
|
70
74
|
import inspect
|
|
71
75
|
|
|
@@ -96,6 +100,10 @@ class Task(BaseModel):
|
|
|
96
100
|
For async environments, awaits the async verifier.
|
|
97
101
|
Works with both sync and async verifiers in async contexts.
|
|
98
102
|
"""
|
|
103
|
+
# If verifier doesn't exist but verifier_func does, rebuild it
|
|
104
|
+
if not self.verifier and self.verifier_func:
|
|
105
|
+
self._rebuild_verifier()
|
|
106
|
+
|
|
99
107
|
if self.verifier:
|
|
100
108
|
result = self.verifier.remote(*args, **kwargs)
|
|
101
109
|
# If it's a coroutine, await it
|
|
@@ -108,6 +116,19 @@ class Task(BaseModel):
|
|
|
108
116
|
else:
|
|
109
117
|
raise ValueError("No verifier function found for this task")
|
|
110
118
|
|
|
119
|
+
def _rebuild_verifier(self):
|
|
120
|
+
"""Rebuild the verifier from verifier_func string if it exists."""
|
|
121
|
+
if self.verifier_func:
|
|
122
|
+
# Use the same logic as in verifier_from_string
|
|
123
|
+
verifier_id = self.verifier_id or self.key
|
|
124
|
+
verifier = verifier_from_string(
|
|
125
|
+
verifier_func=self.verifier_func,
|
|
126
|
+
verifier_id=verifier_id,
|
|
127
|
+
verifier_key=self.key,
|
|
128
|
+
sha256=self.verifier_sha or "",
|
|
129
|
+
)
|
|
130
|
+
self.verifier = verifier
|
|
131
|
+
|
|
111
132
|
def make_env(self, region: Optional[str] = None):
|
|
112
133
|
"""Create an environment instance for this task's environment.
|
|
113
134
|
|
|
@@ -245,7 +266,6 @@ def update_task(
|
|
|
245
266
|
response = fleet.update_task("my-task", verifier_code="def verify(env): return True")
|
|
246
267
|
"""
|
|
247
268
|
from .global_client import get_client
|
|
248
|
-
from .models import TaskResponse
|
|
249
269
|
|
|
250
270
|
client = get_client()
|
|
251
271
|
return client.update_task(
|
|
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
|