Skip to content

Commit

Permalink
Add more conda info to onstart directive
Browse files Browse the repository at this point in the history
  • Loading branch information
smutch committed Sep 1, 2022
1 parent e1843ed commit 38cbc8b
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions mccoy/workflow/Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,17 @@ onstart:
for path in INPUT_DATA:
print(f"- {path}")
print("Workflow paths:")
print(f"\tsnakefile{workflow.snakefile}")
print(f"\tworking directory ➡ {workflow.basedir}")
print(f"\t{'snakefile':20s}{workflow.snakefile}")
print(f"\t{'working directory':20s}{workflow.basedir}")

print("Environment:")
shell = lambda cmd: subprocess.run(cmd, shell=True, stdout=subprocess.PIPE).stdout.decode().rstrip()
print(f"\t{shell('python --version'):20s}{shell('which python')}")
print(f"\t{shell('conda --version'):20s}{shell('which conda')}")
print(f"\t{' '.join(('snakemake', shell('snakemake --version'))):20s}{shell('which snakemake')}")
print("Conda:")
print(f"\t{'frontend':20s}{workflow.conda_frontend}")
print(f"\t{'prefix':20s}{workflow.conda_prefix}")
print(f"\t{'base path':20s}{workflow.conda_base_path}")


rule all:
Expand Down

0 comments on commit 38cbc8b

Please sign in to comment.