Beispiel #1
0
def dump_requirement_libs(builder, interpreter, req_libs, log, platforms=None):
    """Multi-platform dependency resolution for PEX files.

  :param builder: Dump the requirements into this builder.
  :param interpreter: The :class:`PythonInterpreter` to resolve requirements for.
  :param req_libs: A list of :class:`PythonRequirementLibrary` targets to resolve.
  :param log: Use this logger.
  :param platforms: A list of :class:`Platform`s to resolve requirements for.
                    Defaults to the platforms specified by PythonSetup.
  """
    deprecated(
        '1.11.0.dev0',
        'This function has been moved onto the PexBuilderWrapper class.')
    PexBuilderWrapper(builder, PythonRepos.global_instance(),
                      PythonSetup.global_instance(),
                      log).add_requirement_libs_from(req_libs, platforms)
Beispiel #2
0
def resolve_multi(interpreter, requirements, platforms, find_links):
    """Multi-platform dependency resolution for PEX files.

  Returns a list of distributions that must be included in order to satisfy a set of requirements.
  That may involve distributions for multiple platforms.

  :param interpreter: The :class:`PythonInterpreter` to resolve for.
  :param requirements: A list of :class:`PythonRequirement` objects to resolve.
  :param platforms: A list of :class:`Platform`s to resolve for.
  :param find_links: Additional paths to search for source packages during resolution.
  :return: Map of platform name -> list of :class:`pkg_resources.Distribution` instances needed
           to satisfy the requirements on that platform.
  """
    deprecated(
        '1.11.0.dev0',
        'This function has been moved onto the PexBuilderWrapper class.')
    python_setup = PythonSetup.global_instance()
    python_repos = PythonRepos.global_instance()
    return PexBuilderWrapper(builder=None,
                             python_repos_subsystem=python_repos,
                             python_setup_subsystem=python_setup,
                             log=None)._resolve_multi(interpreter,
                                                      requirements, platforms,
                                                      find_links)