def parse_wdl(wdl_path: Path, import_dirs: Optional[Sequence[Path]] = (), check_quant: bool = False, **_) -> Document: return Tree.load(str(wdl_path), path=[str(path) for path in import_dirs], check_quant=check_quant)
def load(uri: str, path: List[str] = [], check_quant: bool = True) -> Document: """ Parse a WDL document given filename/URI, recursively descend into imported documents, then typecheck the tasks and workflow. :param path: local filesystem directories to search for imports, in addition to the current working directory :param check_quant: set to ``False`` to relax static typechecking of the optional (?) and nonempty (+) type quantifiers. This is discouraged, but may be useful for older WDL workflows which assume less-rigorous static validation of these annotations. """ return Tree.load(uri, path, check_quant)
def _get_workflow_name(self, wdl_path: Path, kwargs: dict): if "workflow_name" in kwargs: return kwargs["workflow_name"] elif Tree: if "check_quant" not in kwargs: kwargs["check_quant"] = False doc = Tree.load(str(wdl_path), path=[str(path) for path in self.import_dirs], **kwargs) return doc.workflow.name else: # TODO: test this return safe_string(wdl_path.stem)