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 method for dependencies(uuid) #4011

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Sbozzolo
Copy link

@Sbozzolo Sbozzolo commented Sep 2, 2024

The function dependencies has two methods:

  • First, with an EnvCache. When called with this, it returns the list of dependencies of the environment.

  • Second, with a function and a UUID. When called with these arguments, it returns the list of dependencies of given UUID and applies the function.

This second method is not documented, but, when called with the identity function, provides a very simple way to answer the question "What are the direct dependencies of a given package?".

This is a valuable piece of information when developing tooling that assist people keeping the number dependencies minimal.

As things are, one has to call Pkg.dependencies(identity, uuid) to answer the abovementioned question. With this commit, a new method Pkg.dependencies(uuid) is added providing a natural way to obtain the list of direct dependencies of a package.

The function `dependencies` has two methods:

- First, with a `EnvCache`. When called with this, it returns the
  list of dependencies of the environment.

- Second, with a function and a UUID. When called with these arguments, it
  returns the list of dependencies of given UUID and applies the function.

This second method is not documented, but, when called with the identity
function, provides a very simple way to answer the question "What are the direct
dependencies of a given package?".

This is a valuable piece of information when developing tooling that assist
people keeping the number dependencies minimal.

As things are, one has to call `Pkg.dependencies(identity, uuid)` to answer the
abovementioned question. With this commit, a new method `Pkg.dependencies(uuid)`
is added providing a natural way to obtain the list of direct dependencies of a
package.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant