Skip to content

Commit 04fd707

Browse files
committed
conda envs as a class
1 parent 1d80d26 commit 04fd707

File tree

6 files changed

+223
-272
lines changed

6 files changed

+223
-272
lines changed

harpy/commands/environments.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
import os
44
import shutil
55
import rich_click as click
6-
from harpy.common.conda import create_conda_recipes
7-
from harpy.common.create_pixi import create_pixi_dockerfiles
6+
from harpy.common.environments import HarpyEnvs
87
from harpy.common.workflow import Workflow
98

9+
1010
@click.command(hidden = True)
1111
@click.argument('env', required = True, type= click.Choice(["all", "align", "assembly", "metassembly", "phase", "qc", "report", "simulations", "stitch", "variants"]))
1212
def containerize(env):
@@ -16,7 +16,7 @@ def containerize(env):
1616
**INTERNAL USE ONLY**. Used to recreate all the conda environments required
1717
by the workflows and build a dockerfile from that.
1818
"""
19-
create_pixi_dockerfiles(env)
19+
HarpyEnvs().prepare_container(env)
2020

2121
@click.group(options_metavar='')
2222
def deps():
@@ -51,7 +51,7 @@ def conda(workflows):
5151
"""
5252
workflow = Workflow("localenv", "environments.smk", "localenv/", False, 1)
5353
# if "all" was mixed with other workflows, default to just all and avoid doubling up
54-
create_conda_recipes(workflow.output_directory)
54+
HarpyEnvs().write_recipes(workflow.output_directory)
5555
if "all" in workflows:
5656
workflows = ["align", "assembly", "metassembly", "phase", "qc", "r", "simulations", "stitch", "variants"]
5757
workflow.fetch_snakefile()
@@ -74,7 +74,7 @@ def container():
7474
"""
7575
workflow = Workflow("localcontainer", "environments.smk", "localenv/", True, 1)
7676
workflow.fetch_snakefile()
77-
workflow.snakemake_cmd_relative = " ".join(["snakemake", "-s", os.path.join(workflow.workflow_directory, "workflow.smk"), "--sdm", "conda apptainer", "--cores 2", "--apptainer-prefix ../.environments", "--directory localenv"])
77+
workflow.snakemake_cmd_relative = " ".join(["snakemake", "-s", os.path.join(workflow.workflow_directory, "workflow.smk"), "--sdm", "apptainer", "--cores 2", "--apptainer-prefix ../.environments", "--directory localenv"])
7878
workflow.launch()
7979
shutil.rmtree(workflow.output_directory, ignore_errors = True)
8080

harpy/commands/resume.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import sys
77
import yaml
88
import rich_click as click
9-
from harpy.common.conda import check_environments
9+
from harpy.common.environments import check_environments
1010
from harpy.common.printing import print_error, workflow_info
1111
from harpy.common.workflow import Workflow
1212

harpy/common/conda.py

Lines changed: 0 additions & 127 deletions
This file was deleted.

harpy/common/create_pixi.py

Lines changed: 0 additions & 137 deletions
This file was deleted.

0 commit comments

Comments
 (0)