(
dependencies: Optional[List[str]],
repo: List[str],
branch: List[str],
api_path: List[str],
)
| 116 | |
| 117 | |
| 118 | def parse_dependencies( |
| 119 | dependencies: Optional[List[str]], |
| 120 | repo: List[str], |
| 121 | branch: List[str], |
| 122 | api_path: List[str], |
| 123 | ) -> List[DependencySource]: |
| 124 | num_deps = max( |
| 125 | len(dependencies) if dependencies is not None else 0, len(repo), len(branch) |
| 126 | ) |
| 127 | if ( |
| 128 | (dependencies and len(dependencies) != num_deps) |
| 129 | or (api_path and len(api_path) != num_deps) |
| 130 | or (repo and len(repo) not in [1, num_deps]) |
| 131 | or (branch and len(branch) not in [1, num_deps]) |
| 132 | ): |
| 133 | raise ValueError( |
| 134 | "Number of defined repos/branches/api_paths did not match the " |
| 135 | "number of templates." |
| 136 | ) |
| 137 | inner_deps = _list_arg_to_length(dependencies, num_deps) |
| 138 | inner_api_paths = _list_arg_to_length(api_path, num_deps) |
| 139 | inner_repos = _list_arg_to_length(repo, num_deps) |
| 140 | inner_branches = _list_arg_to_length(branch, num_deps) |
| 141 | |
| 142 | return [ |
| 143 | parse_dependency_string(iter_dep, iter_repo, iter_branch, iter_api_path) |
| 144 | for iter_dep, iter_repo, iter_branch, iter_api_path in zip( |
| 145 | inner_deps, inner_repos, inner_branches, inner_api_paths |
| 146 | ) |
| 147 | ] |
| 148 | |
| 149 | |
| 150 | def _get_repo_path(gitstring: str, ref: Optional[str], repo_dir: Path) -> Path: |
no test coverage detected