MCPcopy
hub / github.com/pex-tool/pex / download

Function download

pex/resolver.py:1797–1874  ·  view source on GitHub ↗

Downloads all distributions needed to meet requirements for multiple distribution targets. :keyword targets: The distribution target environments to download for. :keyword requirements: A sequence of requirement strings. :keyword requirement_files: A sequence of requirement file paths.

(
    targets=Targets(),  # type: Targets
    requirements=None,  # type: Optional[Iterable[ParsedRequirement]]
    requirement_files=None,  # type: Optional[Iterable[str]]
    constraint_files=None,  # type: Optional[Iterable[str]]
    allow_prereleases=False,  # type: bool
    transitive=True,  # type: bool
    repos_configuration=ReposConfiguration(),  # type: ReposConfiguration
    resolver_version=None,  # type: Optional[ResolverVersion.Value]
    network_configuration=None,  # type: Optional[NetworkConfiguration]
    build_configuration=BuildConfiguration(),  # type: BuildConfiguration
    dest=None,  # type: Optional[str]
    max_parallel_jobs=None,  # type: Optional[int]
    observer=None,  # type: Optional[ResolveObserver]
    pip_log=None,  # type: Optional[PipLog]
    pip_version=None,  # type: Optional[PipVersionValue]
    resolver=None,  # type: Optional[Resolver]
    use_pip_config=False,  # type: bool
    extra_pip_requirements=(),  # type: Tuple[Requirement, ...]
    keyring_provider=None,  # type: Optional[str]
    dependency_configuration=DependencyConfiguration(),  # type: DependencyConfiguration
)

Source from the content-addressed store, hash-verified

1795
1796
1797def download(
1798 targets=Targets(), # type: Targets
1799 requirements=None, # type: Optional[Iterable[ParsedRequirement]]
1800 requirement_files=None, # type: Optional[Iterable[str]]
1801 constraint_files=None, # type: Optional[Iterable[str]]
1802 allow_prereleases=False, # type: bool
1803 transitive=True, # type: bool
1804 repos_configuration=ReposConfiguration(), # type: ReposConfiguration
1805 resolver_version=None, # type: Optional[ResolverVersion.Value]
1806 network_configuration=None, # type: Optional[NetworkConfiguration]
1807 build_configuration=BuildConfiguration(), # type: BuildConfiguration
1808 dest=None, # type: Optional[str]
1809 max_parallel_jobs=None, # type: Optional[int]
1810 observer=None, # type: Optional[ResolveObserver]
1811 pip_log=None, # type: Optional[PipLog]
1812 pip_version=None, # type: Optional[PipVersionValue]
1813 resolver=None, # type: Optional[Resolver]
1814 use_pip_config=False, # type: bool
1815 extra_pip_requirements=(), # type: Tuple[Requirement, ...]
1816 keyring_provider=None, # type: Optional[str]
1817 dependency_configuration=DependencyConfiguration(), # type: DependencyConfiguration
1818):
1819 # type: (...) -> Downloaded
1820 """Downloads all distributions needed to meet requirements for multiple distribution targets.
1821
1822 :keyword targets: The distribution target environments to download for.
1823 :keyword requirements: A sequence of requirement strings.
1824 :keyword requirement_files: A sequence of requirement file paths.
1825 :keyword constraint_files: A sequence of constraint file paths.
1826 :keyword allow_prereleases: Whether to include pre-release and development versions when
1827 resolving requirements. Defaults to ``False``, but any requirements that explicitly request
1828 pre-release or development versions will override this setting.
1829 :keyword transitive: Whether to resolve transitive dependencies of requirements.
1830 Defaults to ``True``.
1831 :keyword repos_configuration: Configuration for package repositories to resolve packages from.
1832 :keyword resolver_version: The resolver version to use.
1833 :keyword network_configuration: Configuration for network requests made downloading and building
1834 distributions.
1835 :keyword build_configuration: The configuration for building resolved projects.
1836 :keyword dest: A directory path to download distributions to.
1837 :keyword max_parallel_jobs: The maximum number of parallel jobs to use when resolving,
1838 building and installing distributions in a resolve. Defaults to the number of CPUs available.
1839 :keyword observer: An optional observer of the download internals.
1840 :keyword pip_log: Preserve the `pip download` log and print its location to stderr.
1841 Defaults to ``False``.
1842 :returns: The local distributions meeting all requirements and constraints.
1843 :raises Unsatisfiable: If the resolution of download of distributions fails for any reason.
1844 :raises ValueError: If a foreign platform was provided in `platforms`, and `use_wheel=False`.
1845 :raises ValueError: If `build=False` and `use_wheel=False`.
1846 """
1847 return download_requests(
1848 requests=tuple(
1849 DownloadRequest(
1850 download_target=DownloadTarget(target),
1851 requirements=requirements,
1852 requirement_files=requirement_files,
1853 constraint_files=constraint_files,
1854 )

Callers 1

test_download2Function · 0.90

Calls 9

TargetsClass · 0.90
ReposConfigurationClass · 0.90
BuildConfigurationClass · 0.90
download_requestsFunction · 0.85
DownloadRequestClass · 0.85
DownloadTargetClass · 0.85
_parse_reqsFunction · 0.85
unique_targetsMethod · 0.80

Tested by 1

test_download2Function · 0.72