Skip to content

Commit c271ebb

Browse files
diptanuclaude
andcommitted
tl deploy: CI fixes for sandbox-only path
- .github/workflows/integration_test.yaml: drop the --build-env flags from the `tl deploy` step. The flag no longer exists on the Python argparse since the v2/v3 paths were removed; `tl build-images` keeps its --build-env (used by the local Docker workflow only). - black + isort: reflow deploy.py and test_deploy.py to match the formatter's expected style. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 3aba37a commit c271ebb

3 files changed

Lines changed: 21 additions & 15 deletions

File tree

.github/workflows/integration_test.yaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,7 @@ jobs:
9090
--build-env PIP_EXTRA_INDEX_URL=https://pypi.org/simple/
9191
9292
echo "--- 2. Deploy ---"
93-
tl deploy /tmp/test_app.py \
94-
--build-env PIP_INDEX_URL=https://test.pypi.org/simple/ \
95-
--build-env PIP_EXTRA_INDEX_URL=https://pypi.org/simple/
93+
tl deploy /tmp/test_app.py
9694
9795
echo "--- All integration tests passed ---"
9896
'

src/tensorlake/cli/deploy.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -244,9 +244,7 @@ def _prepare_images(functions: list[Function]) -> dict[str, ImageRef]:
244244
}
245245
)
246246
sys.exit(1)
247-
image_refs[image._id] = ImageRef(
248-
kind="sandbox_template", id=template_name
249-
)
247+
image_refs[image._id] = ImageRef(kind="sandbox_template", id=template_name)
250248

251249
_emit({"type": "build_done"})
252250
return image_refs

tests/cli/test_deploy.py

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,9 @@ def fake_build(image, *, emit):
126126
return {"name": f"{image.name}-template"}
127127

128128
with (
129-
patch.object(deploy_module, "build_sandbox_image", side_effect=fake_build) as build,
129+
patch.object(
130+
deploy_module, "build_sandbox_image", side_effect=fake_build
131+
) as build,
130132
patch.object(deploy_module, "_emit"),
131133
):
132134
refs = deploy_module._prepare_images(functions)
@@ -138,9 +140,7 @@ def fake_build(image, *, emit):
138140
{ref.id for ref in refs.values()},
139141
{"image-a-template", "image-b-template"},
140142
)
141-
self.assertTrue(
142-
all(ref.kind == "sandbox_template" for ref in refs.values())
143-
)
143+
self.assertTrue(all(ref.kind == "sandbox_template" for ref in refs.values()))
144144
self.assertIn(image_a._id, refs)
145145
self.assertIn(image_b._id, refs)
146146

@@ -166,7 +166,9 @@ def app() -> str:
166166
):
167167
refs = deploy_module._prepare_images(functions)
168168

169-
self.assertEqual(refs[image._id], ImageRef(kind="sandbox_template", id="my-fn-image"))
169+
self.assertEqual(
170+
refs[image._id], ImageRef(kind="sandbox_template", id="my-fn-image")
171+
)
170172

171173
def test_sandbox_build_failure_emits_build_failed_and_exits(self):
172174
image = Image(name="broken-image")
@@ -286,13 +288,21 @@ def hello() -> str:
286288
}
287289

288290
with (
289-
patch.object(deploy_module, "_build_context_from_env", return_value=auth),
291+
patch.object(
292+
deploy_module, "_build_context_from_env", return_value=auth
293+
),
290294
patch.object(deploy_module, "load_code"),
291-
patch.object(deploy_module, "validate_loaded_applications", return_value=[]),
292-
patch.object(deploy_module, "format_validation_messages", return_value=[]),
295+
patch.object(
296+
deploy_module, "validate_loaded_applications", return_value=[]
297+
),
298+
patch.object(
299+
deploy_module, "format_validation_messages", return_value=[]
300+
),
293301
patch.object(deploy_module, "has_error_message", return_value=False),
294302
patch.object(deploy_module, "list_secret_names", return_value=[]),
295-
patch.object(deploy_module, "_warning_missing_secrets", return_value=[]),
303+
patch.object(
304+
deploy_module, "_warning_missing_secrets", return_value=[]
305+
),
296306
patch.object(deploy_module, "get_functions", return_value=functions),
297307
patch.object(
298308
deploy_module, "_prepare_images", return_value=image_refs

0 commit comments

Comments
 (0)