findPythonDeps
Find Python dependencies for a given Python package after loading dependencies specified in an EasyConfig. This is intended for writing or updating PythonBundle EasyConfigs: 1. Create a EasyConfig with at least 'Python' as a dependency. When updating to a new toolchain it is a good idea to reduce the dependencies to a minimum as e.g. the new "Python" module might have different packages included. 2. Run this script 3. For each dependency found by this script search existing EasyConfigs for ones providing that Python package. E.g many are contained in Python-bundle-PyPI. Some can be updated from an earlier toolchain. 4. Add those EasyConfigs as dependencies to your new EasyConfig. 5. Rerun this script so it takes the newly provided packages into account. You can do steps 3-5 iteratively adding EasyConfig-dependencies one-by-one. 6. Finally you copy the packages found by this script as "exts_list" into the new EasyConfig. You usually want the list printed as "in install order", the format is already suitable to be copied as-is.
can_run(cmd, *arguments)
¶
Check if the given cmd and argument can be run successfully
extract_pkg_name(package_spec)
¶
Get the package name from a specification such as 'package>=3.42'
find_deps(pkgs, dep_tree)
¶
Recursively resolve dependencies of the given package(s) and return them
get_dep_tree(package_spec, verbose)
¶
Get the dep-tree for installing the given Python package spec
main()
¶
Entrypoint of the script
print_deps(package, verbose)
¶
Print dependencies of the given package that are not installed yet in a format usable as 'exts_list'
run_in_venv(cmd, venv_path, action_desc)
¶
Run the given command in the virtualenv at the given path
run_shell_cmd(arguments, action_desc, capture_stderr=True, **kwargs)
¶
Run the command and return the return code and output
temporary_directory(*args, **kwargs)
¶
Resource wrapper over tempfile.mkdtemp