Skip to content

Commit

Permalink
wrapper extractor
Browse files Browse the repository at this point in the history
Signed-off-by: Ayush Kamat <[email protected]>
  • Loading branch information
ayushkamat committed Oct 26, 2023
1 parent 989e0b3 commit 428dfaa
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
Empty file.
24 changes: 24 additions & 0 deletions latch_cli/snakemake/wrappers/extractor.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
from pathlib import Path
from typing import List

from snakemake.rules import Rule
from snakemake.workflow import Workflow


class SnakemakeWrapperExtractor(Workflow):
def __init__(self, pkg_root: Path, snakefile: Path):
self.pkg_root = pkg_root

super().__init__(snakefile=snakefile)

def extract_wrappers(self) -> List[str]:
wrappers: List[str] = []

rule: Rule
for rule in self.rules:
if not rule.is_wrapper:
continue

wrappers.append(rule.wrapper)

return wrappers

0 comments on commit 428dfaa

Please sign in to comment.