direct_dependencies

pyscripts.direct_dependencies(pyfile, pkg_name, abspath=False)[source]

Get the direct dependencies of the given python file on a given package. The package must be importable from the current environment.

Parameters:
  • pyfile (str) – path to the python file to process.
  • pkg_name (str) – name of the package.
  • abspath – whether to return absolute paths.
  • abspath – bool
Returns:

list with the paths to the dependencies.

Return type:

list(str)

See also

dependencies()