Skip to content

Commit 242cd15

Browse files
author
AidanAbd
committed
fix: small fixes for conda template
1 parent d14ebe3 commit 242cd15

File tree

4 files changed

+21
-14
lines changed

4 files changed

+21
-14
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,13 @@ Types of changes
1313
*Security* in case of vulnerabilities.
1414
1515
-->
16+
# Latch SDK Changelog
17+
18+
## 2.19.4 - 2023-05-04
19+
20+
### Fixed
21+
22+
- Conda template registration issue and run in correct environment issue
1623

1724
# Latch SDK Changelog
1825

latch_cli/docker_utils/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,6 @@ def infer_commands(pkg_root: Path) -> List[DockerCmdBlock]:
128128
commands=[
129129
"copy environment.yaml /opt/latch/environment.yaml",
130130
f"run conda env create --file /opt/latch/environment.yaml --name {env_name}",
131-
f'shell ["conda", "run", "--name", "{env_name}", "/bin/bash", "-c"]',
132-
"run pip install --upgrade latch",
133131
],
134132
order=DockerCmdBlockOrder.precopy,
135133
),

latch_cli/services/init/example_conda/conda_task.py

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,26 @@
22

33
from latch import small_task
44
from latch.types import LatchFile, LatchOutputDir
5+
from typing import List
56

7+
def run(command: List[str], check: bool = True, capture_output: bool = False):
8+
9+
cmd = ["conda", "run", "--name", "example", "/bin/bash", "-c", " ".join(command)]
10+
11+
return subprocess.run(cmd, check=check, capture_output=capture_output)
612

713
# change the name of this function to something more descriptive
814
@small_task
915
def conda_task(input_file: LatchFile, output_directory: LatchOutputDir) -> LatchFile:
1016
# You can run conda packages as a subprocess:
1117

12-
subprocess.run(
13-
"".join(
14-
[
15-
"put",
16-
"conda",
17-
"command",
18-
"here",
19-
]
20-
),
21-
check=True,
22-
shell=True,
18+
run(
19+
[
20+
"put",
21+
"conda",
22+
"command",
23+
"here",
24+
]
2325
)
2426
...
2527
output_location = f"{output_directory.remote_directory}/YOUR_OUTPUT_FILE_NAME"

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
setup(
1616
name="latch",
17-
version="v2.19.3",
17+
version="v2.19.4",
1818
author_email="[email protected]",
1919
description="The Latchbio SDK",
2020
packages=find_packages(),

0 commit comments

Comments
 (0)