-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Ayush Kamat <[email protected]>
- Loading branch information
1 parent
989e0b3
commit 428dfaa
Showing
2 changed files
with
24 additions
and
0 deletions.
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |