Skip to content

Commit

Permalink
Allow manylinux wheels when resolving plugins. (#5959)
Browse files Browse the repository at this point in the history
Also plumb manylinux resolution support for the python backend, on by
default, but configurable via `python_setup.resolver_use_manylinux`.

Fixes #5958
  • Loading branch information
jsirois authored Jun 14, 2018
1 parent 3082cd6 commit 8e848c6
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
7 changes: 7 additions & 0 deletions src/python/pants/backend/python/subsystems/python_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ def register_options(cls, register):
'NOTE: this keyword is a temporary fix and will be reverted per: '
'https://github.com/pantsbuild/pants/issues/5696. The long term '
'solution is tracked by: https://github.com/pantsbuild/pex/issues/456.')
register('--resolver-use-manylinux', advanced=True, type=bool, default=True, fingerprint=True,
help='Whether to consider manylinux wheels when resolving requirements for linux '
'platforms.')

@property
def interpreter_constraints(self):
Expand Down Expand Up @@ -124,6 +127,10 @@ def resolver_allow_prereleases(self):
def resolver_blacklist(self):
return self.get_options().resolver_blacklist

@property
def use_manylinux(self):
return self.get_options().resolver_use_manylinux

@property
def artifact_cache_dir(self):
"""Note that this is unrelated to the general pants artifact cache."""
Expand Down
3 changes: 2 additions & 1 deletion src/python/pants/backend/python/tasks/pex_build_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ def _resolve_multi(interpreter, requirements, platforms, find_links):
cache=requirements_cache_dir,
cache_ttl=python_setup.resolver_cache_ttl,
allow_prereleases=python_setup.resolver_allow_prereleases,
pkg_blacklist=python_setup.resolver_blacklist)
pkg_blacklist=python_setup.resolver_blacklist,
use_manylinux=python_setup.use_manylinux)

return distributions
5 changes: 4 additions & 1 deletion src/python/pants/init/plugin_resolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,10 @@ def _resolve_plugins(self):
context=self._python_repos.get_network_context(),
cache=self.plugin_cache_dir,
cache_ttl=10 * 365 * 24 * 60 * 60, # Effectively never expire.
allow_prereleases=PANTS_SEMVER.is_prerelease)
allow_prereleases=PANTS_SEMVER.is_prerelease,
# Plugins will all depend on `pantsbuild.pants` which is distributed as
# a manylinux wheel.
use_manylinux=True)

@memoized_property
def plugin_cache_dir(self):
Expand Down

0 comments on commit 8e848c6

Please sign in to comment.