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

Python 3 - fix cffi resolver issues #6225

Merged
merged 3 commits into from
Jul 24, 2018
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
2 changes: 1 addition & 1 deletion 3rdparty/python/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. Fixed with latest commit. Thanks!

six>=1.9.0,<2
subprocess32==3.2.7 ; python_version<'3'
thrift>=0.9.1
Expand Down
2 changes: 1 addition & 1 deletion src/python/pants/backend/python/subsystems/python_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.')
Expand Down
2 changes: 1 addition & 1 deletion src/python/pants/core_tasks/clean.py
Original file line number Diff line number Diff line change
Expand Up @@ -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']:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

async is a reserved word in Py3

# The trash directory is deleted in a child process.
pid = os.fork()
if pid == 0:
Expand Down
7 changes: 3 additions & 4 deletions src/python/pants/invalidation/cache_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

raise from is Python 3 syntactic sugar that provides the same functionality as exc_info[2].