Skip to content

Commit be01441

Browse files
committed
messaging + asserts
Signed-off-by: Ayush Kamat <[email protected]>
1 parent 86c9b13 commit be01441

File tree

2 files changed

+6
-13
lines changed

2 files changed

+6
-13
lines changed

src/latch_cli/centromere/ctx.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ def __init__(
195195
196196
1. {module_path} exists.
197197
2. Package `{self.wf_module}` is an absolute importable Python path (e.g. `workflows.my_workflow`).
198-
3. Any directories in `{module_path}` contain an `__init__.py` file."""
198+
3. All directories in `{module_path}` contain an `__init__.py` file."""
199199
),
200200
fg="red",
201201
)

src/latch_cli/services/register/utils.py

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,7 @@ def build_image(
110110
def upload_image(ctx: _CentromereCtx, image_name: str) -> List[str]:
111111
assert ctx.dkr_client is not None
112112
return ctx.dkr_client.push(
113-
repository=f"{ctx.dkr_repo}/{image_name}",
114-
stream=True,
115-
decode=True,
113+
repository=f"{ctx.dkr_repo}/{image_name}", stream=True, decode=True
116114
)
117115

118116

@@ -123,6 +121,8 @@ def serialize_pkg_in_container(
123121
wf_name_override: Optional[str] = None,
124122
) -> Tuple[List[str], str]:
125123
assert ctx.dkr_client is not None
124+
assert ctx.dkr_repo is not None
125+
assert ctx.version is not None
126126

127127
_env = {"LATCH_DKR_REPO": ctx.dkr_repo, "LATCH_VERSION": ctx.version}
128128
if wf_name_override is not None:
@@ -146,12 +146,7 @@ def serialize_pkg_in_container(
146146
volumes=[serialize_dir],
147147
environment=_env,
148148
host_config=ctx.dkr_client.create_host_config(
149-
binds={
150-
serialize_dir: {
151-
"bind": "/tmp/output",
152-
"mode": "rw",
153-
},
154-
}
149+
binds={serialize_dir: {"bind": "/tmp/output", "mode": "rw"}} # noqa: S108
155150
),
156151
)
157152
container_id = typing.cast(str, container.get("Id"))
@@ -191,9 +186,7 @@ def register_serialized_pkg(
191186
serialize_files[fh.name] = fh
192187

193188
response = requests.post(
194-
latch_register_url,
195-
headers=headers,
196-
files=serialize_files,
189+
latch_register_url, headers=headers, files=serialize_files
197190
)
198191
response.raise_for_status()
199192
return response.json()

0 commit comments

Comments
 (0)