fleet-python 0.2.37__tar.gz → 0.2.38__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.

Files changed (81) hide show
  1. {fleet_python-0.2.37 → fleet_python-0.2.38}/PKG-INFO +1 -1
  2. {fleet_python-0.2.37 → fleet_python-0.2.38}/fleet/tasks.py +41 -9
  3. {fleet_python-0.2.37 → fleet_python-0.2.38}/fleet_python.egg-info/PKG-INFO +1 -1
  4. {fleet_python-0.2.37 → fleet_python-0.2.38}/pyproject.toml +1 -1
  5. {fleet_python-0.2.37 → fleet_python-0.2.38}/LICENSE +0 -0
  6. {fleet_python-0.2.37 → fleet_python-0.2.38}/README.md +0 -0
  7. {fleet_python-0.2.37 → fleet_python-0.2.38}/examples/diff_example.py +0 -0
  8. {fleet_python-0.2.37 → fleet_python-0.2.38}/examples/dsl_example.py +0 -0
  9. {fleet_python-0.2.37 → fleet_python-0.2.38}/examples/example.py +0 -0
  10. {fleet_python-0.2.37 → fleet_python-0.2.38}/examples/exampleResume.py +0 -0
  11. {fleet_python-0.2.37 → fleet_python-0.2.38}/examples/example_account.py +0 -0
  12. {fleet_python-0.2.37 → fleet_python-0.2.38}/examples/example_action_log.py +0 -0
  13. {fleet_python-0.2.37 → fleet_python-0.2.38}/examples/example_client.py +0 -0
  14. {fleet_python-0.2.37 → fleet_python-0.2.38}/examples/example_mcp_anthropic.py +0 -0
  15. {fleet_python-0.2.37 → fleet_python-0.2.38}/examples/example_mcp_openai.py +0 -0
  16. {fleet_python-0.2.37 → fleet_python-0.2.38}/examples/example_sync.py +0 -0
  17. {fleet_python-0.2.37 → fleet_python-0.2.38}/examples/example_task.py +0 -0
  18. {fleet_python-0.2.37 → fleet_python-0.2.38}/examples/example_tasks.py +0 -0
  19. {fleet_python-0.2.37 → fleet_python-0.2.38}/examples/example_verifier.py +0 -0
  20. {fleet_python-0.2.37 → fleet_python-0.2.38}/examples/gemini_example.py +0 -0
  21. {fleet_python-0.2.37 → fleet_python-0.2.38}/examples/json_tasks_example.py +0 -0
  22. {fleet_python-0.2.37 → fleet_python-0.2.38}/examples/nova_act_example.py +0 -0
  23. {fleet_python-0.2.37 → fleet_python-0.2.38}/examples/openai_example.py +0 -0
  24. {fleet_python-0.2.37 → fleet_python-0.2.38}/examples/openai_simple_example.py +0 -0
  25. {fleet_python-0.2.37 → fleet_python-0.2.38}/examples/query_builder_example.py +0 -0
  26. {fleet_python-0.2.37 → fleet_python-0.2.38}/examples/quickstart.py +0 -0
  27. {fleet_python-0.2.37 → fleet_python-0.2.38}/examples/test_cdp_logging.py +0 -0
  28. {fleet_python-0.2.37 → fleet_python-0.2.38}/fleet/__init__.py +0 -0
  29. {fleet_python-0.2.37 → fleet_python-0.2.38}/fleet/_async/__init__.py +0 -0
  30. {fleet_python-0.2.37 → fleet_python-0.2.38}/fleet/_async/base.py +0 -0
  31. {fleet_python-0.2.37 → fleet_python-0.2.38}/fleet/_async/client.py +0 -0
  32. {fleet_python-0.2.37 → fleet_python-0.2.38}/fleet/_async/env/__init__.py +0 -0
  33. {fleet_python-0.2.37 → fleet_python-0.2.38}/fleet/_async/env/client.py +0 -0
  34. {fleet_python-0.2.37 → fleet_python-0.2.38}/fleet/_async/exceptions.py +0 -0
  35. {fleet_python-0.2.37 → fleet_python-0.2.38}/fleet/_async/global_client.py +0 -0
  36. {fleet_python-0.2.37 → fleet_python-0.2.38}/fleet/_async/instance/__init__.py +0 -0
  37. {fleet_python-0.2.37 → fleet_python-0.2.38}/fleet/_async/instance/base.py +0 -0
  38. {fleet_python-0.2.37 → fleet_python-0.2.38}/fleet/_async/instance/client.py +0 -0
  39. {fleet_python-0.2.37 → fleet_python-0.2.38}/fleet/_async/models.py +0 -0
  40. {fleet_python-0.2.37 → fleet_python-0.2.38}/fleet/_async/resources/__init__.py +0 -0
  41. {fleet_python-0.2.37 → fleet_python-0.2.38}/fleet/_async/resources/base.py +0 -0
  42. {fleet_python-0.2.37 → fleet_python-0.2.38}/fleet/_async/resources/browser.py +0 -0
  43. {fleet_python-0.2.37 → fleet_python-0.2.38}/fleet/_async/resources/mcp.py +0 -0
  44. {fleet_python-0.2.37 → fleet_python-0.2.38}/fleet/_async/resources/sqlite.py +0 -0
  45. {fleet_python-0.2.37 → fleet_python-0.2.38}/fleet/_async/tasks.py +0 -0
  46. {fleet_python-0.2.37 → fleet_python-0.2.38}/fleet/_async/verifiers/__init__.py +0 -0
  47. {fleet_python-0.2.37 → fleet_python-0.2.38}/fleet/_async/verifiers/bundler.py +0 -0
  48. {fleet_python-0.2.37 → fleet_python-0.2.38}/fleet/_async/verifiers/verifier.py +0 -0
  49. {fleet_python-0.2.37 → fleet_python-0.2.38}/fleet/base.py +0 -0
  50. {fleet_python-0.2.37 → fleet_python-0.2.38}/fleet/client.py +0 -0
  51. {fleet_python-0.2.37 → fleet_python-0.2.38}/fleet/config.py +0 -0
  52. {fleet_python-0.2.37 → fleet_python-0.2.38}/fleet/env/__init__.py +0 -0
  53. {fleet_python-0.2.37 → fleet_python-0.2.38}/fleet/env/client.py +0 -0
  54. {fleet_python-0.2.37 → fleet_python-0.2.38}/fleet/exceptions.py +0 -0
  55. {fleet_python-0.2.37 → fleet_python-0.2.38}/fleet/global_client.py +0 -0
  56. {fleet_python-0.2.37 → fleet_python-0.2.38}/fleet/instance/__init__.py +0 -0
  57. {fleet_python-0.2.37 → fleet_python-0.2.38}/fleet/instance/base.py +0 -0
  58. {fleet_python-0.2.37 → fleet_python-0.2.38}/fleet/instance/client.py +0 -0
  59. {fleet_python-0.2.37 → fleet_python-0.2.38}/fleet/instance/models.py +0 -0
  60. {fleet_python-0.2.37 → fleet_python-0.2.38}/fleet/models.py +0 -0
  61. {fleet_python-0.2.37 → fleet_python-0.2.38}/fleet/resources/__init__.py +0 -0
  62. {fleet_python-0.2.37 → fleet_python-0.2.38}/fleet/resources/base.py +0 -0
  63. {fleet_python-0.2.37 → fleet_python-0.2.38}/fleet/resources/browser.py +0 -0
  64. {fleet_python-0.2.37 → fleet_python-0.2.38}/fleet/resources/mcp.py +0 -0
  65. {fleet_python-0.2.37 → fleet_python-0.2.38}/fleet/resources/sqlite.py +0 -0
  66. {fleet_python-0.2.37 → fleet_python-0.2.38}/fleet/types.py +0 -0
  67. {fleet_python-0.2.37 → fleet_python-0.2.38}/fleet/verifiers/__init__.py +0 -0
  68. {fleet_python-0.2.37 → fleet_python-0.2.38}/fleet/verifiers/bundler.py +0 -0
  69. {fleet_python-0.2.37 → fleet_python-0.2.38}/fleet/verifiers/code.py +0 -0
  70. {fleet_python-0.2.37 → fleet_python-0.2.38}/fleet/verifiers/db.py +0 -0
  71. {fleet_python-0.2.37 → fleet_python-0.2.38}/fleet/verifiers/decorator.py +0 -0
  72. {fleet_python-0.2.37 → fleet_python-0.2.38}/fleet/verifiers/parse.py +0 -0
  73. {fleet_python-0.2.37 → fleet_python-0.2.38}/fleet/verifiers/sql_differ.py +0 -0
  74. {fleet_python-0.2.37 → fleet_python-0.2.38}/fleet/verifiers/verifier.py +0 -0
  75. {fleet_python-0.2.37 → fleet_python-0.2.38}/fleet_python.egg-info/SOURCES.txt +0 -0
  76. {fleet_python-0.2.37 → fleet_python-0.2.38}/fleet_python.egg-info/dependency_links.txt +0 -0
  77. {fleet_python-0.2.37 → fleet_python-0.2.38}/fleet_python.egg-info/requires.txt +0 -0
  78. {fleet_python-0.2.37 → fleet_python-0.2.38}/fleet_python.egg-info/top_level.txt +0 -0
  79. {fleet_python-0.2.37 → fleet_python-0.2.38}/scripts/fix_sync_imports.py +0 -0
  80. {fleet_python-0.2.37 → fleet_python-0.2.38}/scripts/unasync.py +0 -0
  81. {fleet_python-0.2.37 → fleet_python-0.2.38}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fleet-python
3
- Version: 0.2.37
3
+ Version: 0.2.38
4
4
  Summary: Python SDK for Fleet environments
5
5
  Author-email: Fleet AI <nic@fleet.so>
6
6
  License: Apache-2.0
@@ -3,6 +3,7 @@
3
3
  from __future__ import annotations
4
4
 
5
5
  import re
6
+ import asyncio
6
7
  from datetime import datetime
7
8
  from typing import Any, Dict, Optional, List
8
9
  from uuid import UUID
@@ -73,7 +74,12 @@ class Task(BaseModel):
73
74
  if self.verifier:
74
75
  import inspect
75
76
 
76
- result = self.verifier.remote(env, *args, **kwargs)
77
+ # Check if verifier has remote method (for decorated verifiers)
78
+ if hasattr(self.verifier, 'remote'):
79
+ result = self.verifier.remote(env, *args, **kwargs)
80
+ else:
81
+ # For verifiers created from string, call directly
82
+ result = self.verifier(env, *args, **kwargs)
77
83
 
78
84
  # If the result is a coroutine, we need to run it
79
85
  if inspect.iscoroutine(result):
@@ -144,19 +150,23 @@ def verifier_from_string(
144
150
  try:
145
151
  import inspect
146
152
  from .verifiers import verifier, SyncVerifierFunction
147
- from fleet.verifiers.code import TASK_SUCCESSFUL_SCORE, TASK_FAILED_SCORE
148
- from fleet.verifiers.db import IgnoreConfig
153
+ from .verifiers.code import TASK_SUCCESSFUL_SCORE, TASK_FAILED_SCORE
154
+ from .verifiers.db import IgnoreConfig
149
155
 
150
- # Create a local namespace for executing the code
151
- local_namespace = {
156
+ # Create a globals namespace with all required imports
157
+ exec_globals = globals().copy()
158
+ exec_globals.update({
152
159
  'TASK_SUCCESSFUL_SCORE': TASK_SUCCESSFUL_SCORE,
153
160
  'TASK_FAILED_SCORE': TASK_FAILED_SCORE,
154
161
  'IgnoreConfig': IgnoreConfig,
155
162
  'Environment': object # Add Environment type if needed
156
- }
163
+ })
164
+
165
+ # Create a local namespace for executing the code
166
+ local_namespace = {}
157
167
 
158
168
  # Execute the verifier code in the namespace
159
- exec(verifier_func, globals(), local_namespace)
169
+ exec(verifier_func, exec_globals, local_namespace)
160
170
 
161
171
  # Find the function that was defined
162
172
  func_obj = None
@@ -168,8 +178,30 @@ def verifier_from_string(
168
178
  if func_obj is None:
169
179
  raise ValueError("No function found in verifier code")
170
180
 
171
- # Create an AsyncVerifierFunction instance
172
- verifier_instance = SyncVerifierFunction(func_obj, verifier_key, verifier_id)
181
+ # Create a wrapper function that provides the necessary globals
182
+ def wrapped_verifier(env, *args, **kwargs):
183
+ # Set up globals for the function execution
184
+ func_globals = func_obj.__globals__.copy() if hasattr(func_obj, '__globals__') else {}
185
+ func_globals.update({
186
+ 'TASK_SUCCESSFUL_SCORE': TASK_SUCCESSFUL_SCORE,
187
+ 'TASK_FAILED_SCORE': TASK_FAILED_SCORE,
188
+ 'IgnoreConfig': IgnoreConfig
189
+ })
190
+
191
+ # Create a new function with the updated globals
192
+ import types
193
+ new_func = types.FunctionType(
194
+ func_obj.__code__,
195
+ func_globals,
196
+ func_obj.__name__,
197
+ func_obj.__defaults__,
198
+ func_obj.__closure__
199
+ )
200
+
201
+ return new_func(env, *args, **kwargs)
202
+
203
+ # Create an AsyncVerifierFunction instance with the wrapped function
204
+ verifier_instance = SyncVerifierFunction(wrapped_verifier, verifier_key, verifier_id)
173
205
 
174
206
  # Store additional metadata
175
207
  verifier_instance._verifier_code = verifier_func
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fleet-python
3
- Version: 0.2.37
3
+ Version: 0.2.38
4
4
  Summary: Python SDK for Fleet environments
5
5
  Author-email: Fleet AI <nic@fleet.so>
6
6
  License: Apache-2.0
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "fleet-python"
7
- version = "0.2.37"
7
+ version = "0.2.38"
8
8
  description = "Python SDK for Fleet environments"
9
9
  authors = [
10
10
  {name = "Fleet AI", email = "nic@fleet.so"},
File without changes
File without changes
File without changes