Skip to content

Commit

Permalink
fix: small fixes for conda template
Browse files Browse the repository at this point in the history
  • Loading branch information
AidanAbd committed May 4, 2023
1 parent d14ebe3 commit 242cd15
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 14 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@ Types of changes
*Security* in case of vulnerabilities.
-->
# Latch SDK Changelog

## 2.19.4 - 2023-05-04

### Fixed

- Conda template registration issue and run in correct environment issue

# Latch SDK Changelog

Expand Down
2 changes: 0 additions & 2 deletions latch_cli/docker_utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,6 @@ def infer_commands(pkg_root: Path) -> List[DockerCmdBlock]:
commands=[
"copy environment.yaml /opt/latch/environment.yaml",
f"run conda env create --file /opt/latch/environment.yaml --name {env_name}",
f'shell ["conda", "run", "--name", "{env_name}", "/bin/bash", "-c"]',
"run pip install --upgrade latch",
],
order=DockerCmdBlockOrder.precopy,
),
Expand Down
24 changes: 13 additions & 11 deletions latch_cli/services/init/example_conda/conda_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,26 @@

from latch import small_task
from latch.types import LatchFile, LatchOutputDir
from typing import List

def run(command: List[str], check: bool = True, capture_output: bool = False):

cmd = ["conda", "run", "--name", "example", "/bin/bash", "-c", " ".join(command)]

return subprocess.run(cmd, check=check, capture_output=capture_output)

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

subprocess.run(
"".join(
[
"put",
"conda",
"command",
"here",
]
),
check=True,
shell=True,
run(
[
"put",
"conda",
"command",
"here",
]
)
...
output_location = f"{output_directory.remote_directory}/YOUR_OUTPUT_FILE_NAME"
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

setup(
name="latch",
version="v2.19.3",
version="v2.19.4",
author_email="kenny@latch.bio",
description="The Latchbio SDK",
packages=find_packages(),
Expand Down

0 comments on commit 242cd15

Please sign in to comment.