benchmax 0.1.2.dev22__tar.gz → 0.1.2.dev23__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.
- {benchmax-0.1.2.dev22 → benchmax-0.1.2.dev23}/PKG-INFO +1 -1
- {benchmax-0.1.2.dev22 → benchmax-0.1.2.dev23}/pyproject.toml +1 -1
- {benchmax-0.1.2.dev22 → benchmax-0.1.2.dev23}/src/benchmax/bundle/bundler.py +20 -7
- {benchmax-0.1.2.dev22 → benchmax-0.1.2.dev23}/src/benchmax/bundle/payload.py +1 -0
- {benchmax-0.1.2.dev22 → benchmax-0.1.2.dev23}/src/benchmax/bundle/validator.py +20 -6
- {benchmax-0.1.2.dev22 → benchmax-0.1.2.dev23}/src/benchmax.egg-info/PKG-INFO +1 -1
- {benchmax-0.1.2.dev22 → benchmax-0.1.2.dev23}/LICENSE +0 -0
- {benchmax-0.1.2.dev22 → benchmax-0.1.2.dev23}/README.md +0 -0
- {benchmax-0.1.2.dev22 → benchmax-0.1.2.dev23}/setup.cfg +0 -0
- {benchmax-0.1.2.dev22 → benchmax-0.1.2.dev23}/src/benchmax/adapters/__init__.py +0 -0
- {benchmax-0.1.2.dev22 → benchmax-0.1.2.dev23}/src/benchmax/adapters/benchmax_wrapper.py +0 -0
- {benchmax-0.1.2.dev22 → benchmax-0.1.2.dev23}/src/benchmax/adapters/skyrl/benchmax_data_process.py +0 -0
- {benchmax-0.1.2.dev22 → benchmax-0.1.2.dev23}/src/benchmax/adapters/skyrl/skyrl_adapter.py +0 -0
- {benchmax-0.1.2.dev22 → benchmax-0.1.2.dev23}/src/benchmax/bundle/__init__.py +0 -0
- {benchmax-0.1.2.dev22 → benchmax-0.1.2.dev23}/src/benchmax/bundle/errors.py +0 -0
- {benchmax-0.1.2.dev22 → benchmax-0.1.2.dev23}/src/benchmax/bundle/loader.py +0 -0
- {benchmax-0.1.2.dev22 → benchmax-0.1.2.dev23}/src/benchmax/envs/__init__.py +0 -0
- {benchmax-0.1.2.dev22 → benchmax-0.1.2.dev23}/src/benchmax/envs/base_env.py +0 -0
- {benchmax-0.1.2.dev22 → benchmax-0.1.2.dev23}/src/benchmax/envs/crm/crm_env.py +0 -0
- {benchmax-0.1.2.dev22 → benchmax-0.1.2.dev23}/src/benchmax/envs/crm/workdir/reward_fn.py +0 -0
- {benchmax-0.1.2.dev22 → benchmax-0.1.2.dev23}/src/benchmax/envs/crm/workdir/salesforce_mcp.py +0 -0
- {benchmax-0.1.2.dev22 → benchmax-0.1.2.dev23}/src/benchmax/envs/excel/data_utils.py +0 -0
- {benchmax-0.1.2.dev22 → benchmax-0.1.2.dev23}/src/benchmax/envs/excel/excel_env.py +0 -0
- {benchmax-0.1.2.dev22 → benchmax-0.1.2.dev23}/src/benchmax/envs/excel/workdir/__init__.py +0 -0
- {benchmax-0.1.2.dev22 → benchmax-0.1.2.dev23}/src/benchmax/envs/excel/workdir/excel_code_runner_mcp.py +0 -0
- {benchmax-0.1.2.dev22 → benchmax-0.1.2.dev23}/src/benchmax/envs/excel/workdir/excel_utils.py +0 -0
- {benchmax-0.1.2.dev22 → benchmax-0.1.2.dev23}/src/benchmax/envs/excel/workdir/reward_fn.py +0 -0
- {benchmax-0.1.2.dev22 → benchmax-0.1.2.dev23}/src/benchmax/envs/math/math_env.py +0 -0
- {benchmax-0.1.2.dev22 → benchmax-0.1.2.dev23}/src/benchmax/envs/math/workdir/reward_fn.py +0 -0
- {benchmax-0.1.2.dev22 → benchmax-0.1.2.dev23}/src/benchmax/envs/mcp/__init__.py +0 -0
- {benchmax-0.1.2.dev22 → benchmax-0.1.2.dev23}/src/benchmax/envs/mcp/example_workdir/demo_mcp_server.py +0 -0
- {benchmax-0.1.2.dev22 → benchmax-0.1.2.dev23}/src/benchmax/envs/mcp/example_workdir/reward_fn.py +0 -0
- {benchmax-0.1.2.dev22 → benchmax-0.1.2.dev23}/src/benchmax/envs/mcp/parallel_mcp_env.py +0 -0
- {benchmax-0.1.2.dev22 → benchmax-0.1.2.dev23}/src/benchmax/envs/mcp/provisioners/__init__.py +0 -0
- {benchmax-0.1.2.dev22 → benchmax-0.1.2.dev23}/src/benchmax/envs/mcp/provisioners/base_provisioner.py +0 -0
- {benchmax-0.1.2.dev22 → benchmax-0.1.2.dev23}/src/benchmax/envs/mcp/provisioners/local_provisioner.py +0 -0
- {benchmax-0.1.2.dev22 → benchmax-0.1.2.dev23}/src/benchmax/envs/mcp/provisioners/manual_provisioner.py +0 -0
- {benchmax-0.1.2.dev22 → benchmax-0.1.2.dev23}/src/benchmax/envs/mcp/provisioners/skypilot_provisioner.py +0 -0
- {benchmax-0.1.2.dev22 → benchmax-0.1.2.dev23}/src/benchmax/envs/mcp/provisioners/utils.py +0 -0
- {benchmax-0.1.2.dev22 → benchmax-0.1.2.dev23}/src/benchmax/envs/mcp/proxy_server.py +0 -0
- {benchmax-0.1.2.dev22 → benchmax-0.1.2.dev23}/src/benchmax/envs/mcp/server_pool.py +0 -0
- {benchmax-0.1.2.dev22 → benchmax-0.1.2.dev23}/src/benchmax/envs/mcp/utils.py +0 -0
- {benchmax-0.1.2.dev22 → benchmax-0.1.2.dev23}/src/benchmax/envs/tracking.py +0 -0
- {benchmax-0.1.2.dev22 → benchmax-0.1.2.dev23}/src/benchmax/envs/types.py +0 -0
- {benchmax-0.1.2.dev22 → benchmax-0.1.2.dev23}/src/benchmax/envs/wikipedia/utils.py +0 -0
- {benchmax-0.1.2.dev22 → benchmax-0.1.2.dev23}/src/benchmax/envs/wikipedia/wiki_env.py +0 -0
- {benchmax-0.1.2.dev22 → benchmax-0.1.2.dev23}/src/benchmax/prompts/__init__.py +0 -0
- {benchmax-0.1.2.dev22 → benchmax-0.1.2.dev23}/src/benchmax/prompts/tools.py +0 -0
- {benchmax-0.1.2.dev22 → benchmax-0.1.2.dev23}/src/benchmax.egg-info/SOURCES.txt +0 -0
- {benchmax-0.1.2.dev22 → benchmax-0.1.2.dev23}/src/benchmax.egg-info/dependency_links.txt +0 -0
- {benchmax-0.1.2.dev22 → benchmax-0.1.2.dev23}/src/benchmax.egg-info/requires.txt +0 -0
- {benchmax-0.1.2.dev22 → benchmax-0.1.2.dev23}/src/benchmax.egg-info/top_level.txt +0 -0
|
@@ -70,9 +70,18 @@ def bundle_env(
|
|
|
70
70
|
f"{mod.__name__}"
|
|
71
71
|
)
|
|
72
72
|
|
|
73
|
-
# --- Serialize the class ---
|
|
73
|
+
# --- Serialize the class AND constructor_args while modules are registered ---
|
|
74
|
+
pickled_constructor_args: bytes | None = None
|
|
74
75
|
try:
|
|
75
76
|
pickled_class = cloudpickle.dumps(env_class)
|
|
77
|
+
# Pickle constructor_args now (while local_modules are registered)
|
|
78
|
+
# so non-JSON-serializable objects get pickled by value.
|
|
79
|
+
if constructor_args is not None:
|
|
80
|
+
try:
|
|
81
|
+
import json
|
|
82
|
+
json.dumps(constructor_args)
|
|
83
|
+
except TypeError:
|
|
84
|
+
pickled_constructor_args = cloudpickle.dumps(constructor_args)
|
|
76
85
|
except Exception as e:
|
|
77
86
|
raise BundlingError(
|
|
78
87
|
f"Failed to serialize {env_class.__name__} with cloudpickle: {e}"
|
|
@@ -99,8 +108,13 @@ def bundle_env(
|
|
|
99
108
|
python_version=python_version,
|
|
100
109
|
benchmax_version=benchmax_version,
|
|
101
110
|
constructor_args=constructor_args,
|
|
111
|
+
constructor_args_pickled=pickled_constructor_args is not None,
|
|
112
|
+
)
|
|
113
|
+
payload = BundledEnv(
|
|
114
|
+
pickled_class=pickled_class,
|
|
115
|
+
metadata=metadata,
|
|
116
|
+
pickled_constructor_args=pickled_constructor_args,
|
|
102
117
|
)
|
|
103
|
-
payload = BundledEnv(pickled_class=pickled_class, metadata=metadata)
|
|
104
118
|
|
|
105
119
|
size_kb = len(pickled_class) / 1024
|
|
106
120
|
logger.info(
|
|
@@ -136,12 +150,11 @@ def write_bundle_files(
|
|
|
136
150
|
pickle_path.write_bytes(bundle.pickled_class)
|
|
137
151
|
metadata_path.write_bytes(bundle.metadata.to_json_bytes())
|
|
138
152
|
|
|
139
|
-
# Write pickled constructor_args
|
|
140
|
-
#
|
|
141
|
-
|
|
142
|
-
if pickled_args is not None:
|
|
153
|
+
# Write pre-pickled constructor_args (pickled during bundling while
|
|
154
|
+
# local_modules were registered, so module code is inline).
|
|
155
|
+
if bundle.pickled_constructor_args is not None:
|
|
143
156
|
args_path = pickle_path.with_suffix(".args.pkl")
|
|
144
|
-
args_path.write_bytes(
|
|
157
|
+
args_path.write_bytes(bundle.pickled_constructor_args)
|
|
145
158
|
logger.info("[bundling] Wrote pickled constructor_args to %s", args_path)
|
|
146
159
|
|
|
147
160
|
|
|
@@ -35,7 +35,8 @@ def validate_bundle(
|
|
|
35
35
|
if constructor_args is None:
|
|
36
36
|
constructor_args = bundle.metadata.constructor_args
|
|
37
37
|
return _run_isolated_validation(
|
|
38
|
-
bundle.pickled_class, bundle.metadata, constructor_args
|
|
38
|
+
bundle.pickled_class, bundle.metadata, constructor_args,
|
|
39
|
+
pickled_constructor_args=bundle.pickled_constructor_args,
|
|
39
40
|
)
|
|
40
41
|
|
|
41
42
|
|
|
@@ -110,6 +111,7 @@ def _run_isolated_validation(
|
|
|
110
111
|
pickled_class: bytes,
|
|
111
112
|
metadata: BundleMetadata,
|
|
112
113
|
constructor_args: Optional[Dict[str, Any]],
|
|
114
|
+
pickled_constructor_args: Optional[bytes] = None,
|
|
113
115
|
) -> List[str]:
|
|
114
116
|
"""Create a temp venv, install deps, unpickle the bundle, and smoke test.
|
|
115
117
|
|
|
@@ -192,18 +194,30 @@ def _run_isolated_validation(
|
|
|
192
194
|
with open(pickle_path, "wb") as f:
|
|
193
195
|
f.write(pickled_class)
|
|
194
196
|
|
|
195
|
-
# 5. Write
|
|
196
|
-
|
|
197
|
+
# 5. Write constructor args as pickle (handles non-JSON-serializable objects)
|
|
198
|
+
args_pickle_path = os.path.join(venv_dir, "constructor_args.pkl")
|
|
199
|
+
if pickled_constructor_args is not None:
|
|
200
|
+
# Use pre-pickled args (pickled during bundling with modules registered)
|
|
201
|
+
with open(args_pickle_path, "wb") as f:
|
|
202
|
+
f.write(pickled_constructor_args)
|
|
203
|
+
elif constructor_args is not None:
|
|
204
|
+
import cloudpickle as _cp
|
|
205
|
+
with open(args_pickle_path, "wb") as f:
|
|
206
|
+
_cp.dump(constructor_args, f)
|
|
207
|
+
|
|
208
|
+
# 6. Write and run smoke test script using cloudpickle directly
|
|
197
209
|
smoke_script = textwrap.dedent(f"""\
|
|
198
|
-
import
|
|
210
|
+
import os
|
|
199
211
|
import asyncio
|
|
200
212
|
import cloudpickle
|
|
201
213
|
|
|
202
214
|
with open({pickle_path!r}, "rb") as f:
|
|
203
215
|
env_class = cloudpickle.load(f)
|
|
204
216
|
|
|
205
|
-
|
|
206
|
-
if
|
|
217
|
+
args_path = {args_pickle_path!r}
|
|
218
|
+
if os.path.exists(args_path):
|
|
219
|
+
with open(args_path, "rb") as f:
|
|
220
|
+
constructor_args = cloudpickle.load(f)
|
|
207
221
|
instance = env_class(**constructor_args)
|
|
208
222
|
tools = asyncio.run(instance.list_tools())
|
|
209
223
|
asyncio.run(instance.shutdown())
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{benchmax-0.1.2.dev22 → benchmax-0.1.2.dev23}/src/benchmax/adapters/skyrl/benchmax_data_process.py
RENAMED
|
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
|
{benchmax-0.1.2.dev22 → benchmax-0.1.2.dev23}/src/benchmax/envs/crm/workdir/salesforce_mcp.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{benchmax-0.1.2.dev22 → benchmax-0.1.2.dev23}/src/benchmax/envs/excel/workdir/excel_utils.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{benchmax-0.1.2.dev22 → benchmax-0.1.2.dev23}/src/benchmax/envs/mcp/example_workdir/reward_fn.py
RENAMED
|
File without changes
|
|
File without changes
|
{benchmax-0.1.2.dev22 → benchmax-0.1.2.dev23}/src/benchmax/envs/mcp/provisioners/__init__.py
RENAMED
|
File without changes
|
{benchmax-0.1.2.dev22 → benchmax-0.1.2.dev23}/src/benchmax/envs/mcp/provisioners/base_provisioner.py
RENAMED
|
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
|