Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolve only stable releases by default. #4201

Merged
merged 1 commit into from
Jan 25, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions 3rdparty/python/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ isort==4.2.5
lmdb==0.89
Markdown==2.1.1
mock==1.3.0
packaging==16.7
packaging==16.8
pathspec==0.3.4
pep8==1.6.2
pex==1.1.20
pex==1.2.1
psutil==4.3.0
pyflakes==1.1.0
Pygments==1.4
Expand Down
3 changes: 2 additions & 1 deletion src/python/pants/backend/python/python_chroot.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,7 @@ def _resolve_multi(self, requirements, find_links):
platform=platform,
context=context,
cache=requirements_cache_dir,
cache_ttl=self._python_setup.resolver_cache_ttl)
cache_ttl=self._python_setup.resolver_cache_ttl,
allow_prereleases=self._python_setup.resolver_allow_prereleases)

return distributions
6 changes: 6 additions & 0 deletions src/python/pants/backend/python/python_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ def register_options(cls, register):
default=10 * 365 * 86400, # 10 years.
help='The time in seconds before we consider re-resolving an open-ended requirement, '
'e.g. "flask>=0.2" if a matching distribution is available on disk.')
register('--resolver-allow-prereleases', advanced=True, type=bool, default=False,
fingerprint=True, help='Whether to include pre-releases when resolving requirements.')
register('--artifact-cache-dir', advanced=True, default=None, metavar='<dir>',
help='The parent directory for the python artifact cache. '
'If unspecified, a standard path under the workdir is used.')
Expand Down Expand Up @@ -82,6 +84,10 @@ def resolver_cache_dir(self):
def resolver_cache_ttl(self):
return self.get_options().resolver_cache_ttl

@property
def resolver_allow_prereleases(self):
return self.get_options().resolver_allow_prereleases

@property
def artifact_cache_dir(self):
"""Note that this is unrelated to the general pants artifact cache."""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ def _resolve_multi(self, interpreter, requirements, find_links):
platform=None if platform == 'current' else platform,
context=python_repos.get_network_context(),
cache=requirements_cache_dir,
cache_ttl=python_setup.resolver_cache_ttl)
cache_ttl=python_setup.resolver_cache_ttl,
allow_prereleases=python_setup.resolver_allow_prereleases)

return distributions
1 change: 1 addition & 0 deletions src/python/pants/bin/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ python_library(
'src/python/pants/subsystem:subsystem',
'src/python/pants/util:dirutil',
'src/python/pants/util:memo',
'src/python/pants:version',
]
)

Expand Down
5 changes: 3 additions & 2 deletions src/python/pants/bin/plugin_resolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
from pants.subsystem.subsystem import Subsystem
from pants.util.dirutil import safe_open
from pants.util.memo import memoized_property

from pants.version import PANTS_SEMVER

logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -90,7 +90,8 @@ def _resolve_plugins(self):
context=self._python_repos.get_network_context(),
precedence=precedence,
cache=self.plugin_cache_dir,
cache_ttl=self._python_setup.resolver_cache_ttl)
cache_ttl=self._python_setup.resolver_cache_ttl,
allow_prereleases=PANTS_SEMVER.is_prerelease)

@memoized_property
def plugin_cache_dir(self):
Expand Down