Skip to content
Permalink
Browse files

Squashed commit of the following:

commit 9c754dc
Merge: 3f30d39 7819724
Author: Eric Arellano <ericarellano@me.com>
Date:   Tue Feb 26 17:17:34 2019 -0700

    Merge branch 'master' of github.com:pantsbuild/pants into pex-interpreter-constraints

commit 3f30d39
Author: Eric Arellano <ericarellano@me.com>
Date:   Tue Feb 26 17:12:01 2019 -0700

    Fix issue with compatibility_or_constraints() returning a tuple

    add_interpreter_constraints() expects a str, so we must unpack the tuple when calling it.

commit ff17f73
Author: Eric Arellano <ericarellano@me.com>
Date:   Mon Feb 25 22:46:16 2019 -0700

    Revert "Constrain ci.sh to the exact Python interpreter version"

    This reverts commit 887a8ef.

    This change is necessary to fix the original motivation for this PR, but it does not really belong in this PR anymore. Instead, it should be in the Py2 ABI PR (7235). This PR should be kept more generic, and there is no logical connection to the changes being made with ci.sh, beyond that original motivating problem.

commit 6b07abd
Author: Eric Arellano <ericarellano@me.com>
Date:   Mon Feb 25 21:49:52 2019 -0700

    Remove bad import

    My bad for not catching this before pushing.

commit 2c6fdb0
Author: Eric Arellano <ericarellano@me.com>
Date:   Mon Feb 25 21:37:41 2019 -0700

    Generify solution by using compatibility_or_constraints()

    Instead of applying a bandaid for only `./pants binary`, John proposed fixing the issue with our PexBuilderWrapper itself. So, we use `compatibility_or_constrains()`, which will first try to return the target's compatibility, else will return the Python Setup subystem's value.

    The wrapper still is not ideal and John proposes killing add_interpreter_constraint() and add_interpreter_constraints_from() to instead automatically be setting the interpreter constraints from the targets graph. This PR does not make that change for the scope, but this should be noted.

commit b71f164
Author: Eric Arellano <ericarellano@me.com>
Date:   Mon Feb 25 21:03:46 2019 -0700

    Fix typo

commit 3bca020
Author: Eric Arellano <ericarellano@me.com>
Date:   Mon Feb 25 20:31:14 2019 -0700

    Add global interpreter constraints to Python binary creation

commit 887a8ef
Author: Eric Arellano <ericarellano@me.com>
Date:   Fri Feb 22 21:05:50 2019 -0700

    Constrain ci.sh to the exact Python interpreter version

    Earlier we allowed the patch version to float. We discovered in pantsbuild#7235 with the CI run https://travis-ci.org/pantsbuild/pants/jobs/497208431#L891 that PEX was building with 2.7.10 but running with 2.7.13.

    The fix will require having Pants pass interpreter constraints to Pex. Even with that change though, the CI shard would still have the issue because the constraint would be floating.

    Now, we have the constraint be exact.
  • Loading branch information...
Eric-Arellano committed Feb 27, 2019
1 parent 0d25bcc commit 4cb6caea48c0f2200092dc6adc2c8481f2a8cf5c
Showing with 4 additions and 3 deletions.
  1. +4 −3 src/python/pants/backend/python/subsystems/pex_build_util.py
@@ -255,9 +255,10 @@ def add_interpreter_constraints_from(self, constraint_tgts):
# TODO this would be a great place to validate the constraints and present a good error message
# if they are incompatible because all the sources of the constraints are available.
# See: https://github.com/pantsbuild/pex/blob/584b6e367939d24bc28aa9fa36eb911c8297dac8/pex/interpreter_constraints.py
constraints = {self._python_setup_subsystem.compatibility_or_constraints(tgt) for tgt in constraint_tgts}
for constraint in constraints:
self.add_interpreter_constraint(constraint)
constraint_tuples = {self._python_setup_subsystem.compatibility_or_constraints(tgt) for tgt in constraint_tgts}
for constraint_tuple in constraint_tuples:
for constraint in constraint_tuple:
self.add_interpreter_constraint(constraint)

def add_direct_requirements(self, reqs):
for req in reqs:

0 comments on commit 4cb6cae

Please sign in to comment.
You can’t perform that action at this time.