Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add fetch_dependencies and fetch_dependency_graph util functions #10

Open
ravwojdyla opened this issue Jul 13, 2021 · 0 comments
Open
Labels
enhancement New feature or request

Comments

@ravwojdyla
Copy link
Contributor

It would be a useful function to have. Given an Artifact return all dependencies (recursively) with a given Artifact spec (id, optionally version/partition):

def fetch_dependencies(a: Artifact, a_dep_spec: Optional[Artifact] = None) -> Set[Artifact]:
  ...

and we recursively walk the deps from a, and compare then with the a_dep_spec, return all matches. And if a_dep_spec is None, we get a full set of dependencies. Internally this could implement say:

def fetch_dependency_graph(a: Artifact, max_depth: int = -1) -> Dict[Artifact, ...]:
 ...

Note: pseudocode above uses set/dict of Artifact, see #9.

@ravwojdyla ravwojdyla added the enhancement New feature or request label Jul 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant