From d9316dd3ac9a06b74c27923e900d3531eef48906 Mon Sep 17 00:00:00 2001 From: Eric Arellano Date: Tue, 24 Jul 2018 15:27:30 -0400 Subject: [PATCH] Python 3 - fix cffi resolver issues (#6225) --- 3rdparty/python/requirements.txt | 2 +- src/python/pants/backend/python/subsystems/python_setup.py | 2 +- src/python/pants/core_tasks/clean.py | 2 +- src/python/pants/invalidation/cache_manager.py | 7 +++---- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/3rdparty/python/requirements.txt b/3rdparty/python/requirements.txt index 885279d2bc5..ffb1aa049a3 100644 --- a/3rdparty/python/requirements.txt +++ b/3rdparty/python/requirements.txt @@ -27,7 +27,7 @@ pywatchman==1.4.1 requests[security]>=2.5.0,<2.19 scandir==1.2 setproctitle==1.1.10 -setuptools==30.0.0 +setuptools==33.1.1 six>=1.9.0,<2 subprocess32==3.2.7 ; python_version<'3' thrift>=0.9.1 diff --git a/src/python/pants/backend/python/subsystems/python_setup.py b/src/python/pants/backend/python/subsystems/python_setup.py index 9acd174f3eb..183b0ddea12 100644 --- a/src/python/pants/backend/python/subsystems/python_setup.py +++ b/src/python/pants/backend/python/subsystems/python_setup.py @@ -33,7 +33,7 @@ def register_options(cls, register): "or 'PyPy' (A pypy interpreter of any version). Multiple constraint strings will " "be ORed together. These constraints are applied in addition to any " "compatibilities required by the relevant targets.") - register('--setuptools-version', advanced=True, default='30.0.0', + register('--setuptools-version', advanced=True, default='33.1.1', help='The setuptools version for this python environment.') register('--wheel-version', advanced=True, default='0.29.0', help='The wheel version for this python environment.') diff --git a/src/python/pants/core_tasks/clean.py b/src/python/pants/core_tasks/clean.py index bbf5fc22e50..fec55d02ea8 100644 --- a/src/python/pants/core_tasks/clean.py +++ b/src/python/pants/core_tasks/clean.py @@ -41,7 +41,7 @@ def execute(self): safe_concurrent_rename(pants_wd, tmp_trash) safe_concurrent_rename(tmpdir, pants_wd) - if self.get_options().async: + if self.get_options()['async']: # The trash directory is deleted in a child process. pid = os.fork() if pid == 0: diff --git a/src/python/pants/invalidation/cache_manager.py b/src/python/pants/invalidation/cache_manager.py index 53325793c10..8ac4a1e444d 100644 --- a/src/python/pants/invalidation/cache_manager.py +++ b/src/python/pants/invalidation/cache_manager.py @@ -6,10 +6,11 @@ import os import shutil -import sys from builtins import object from hashlib import sha1 +from future.utils import raise_from + from pants.build_graph.build_graph import sort_targets from pants.build_graph.target import Target from pants.invalidation.build_invalidator import CacheKey @@ -389,8 +390,6 @@ def _key_for(self, target): except Exception as e: # This is a catch-all for problems we haven't caught up with and given a better diagnostic. # TODO(Eric Ayers): If you see this exception, add a fix to catch the problem earlier. - exc_info = sys.exc_info() new_exception = self.CacheValidationError("Problem validating target {} in {}: {}" .format(target.id, target.address.spec_path, e)) - - raise self.CacheValidationError, new_exception, exc_info[2] + raise_from(self.CacheValidationError(new_exception), e)