Skip to content

Commit

Permalink
Add global interpreter constraints to Python binary creation
Browse files Browse the repository at this point in the history
  • Loading branch information
Eric-Arellano committed Feb 26, 2019
1 parent 887a8ef commit 3bca020
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
has_python_sources, has_resources,
is_python_target)
from pants.backend.python.subsystems.python_native_code import PythonNativeCode
from pants.backend.python.subsystems.python_setup import PythonSetup
from pants.backend.python.targets.python_binary import PythonBinary
from pants.backend.python.targets.python_requirement_library import PythonRequirementLibrary
from pants.base.build_environment import get_buildroot
Expand Down Expand Up @@ -140,8 +141,9 @@ def _create_binary(self, binary_tgt, results_dir):
if is_python_target(tgt):
constraint_tgts.append(tgt)

# Add target's interpreter compatibility constraints to pex info.
# Add global and target-level interpreter compatibility constraints to pex info.
pex_builder.add_interpreter_constraints_from(constraint_tgts)
pex_builder.add_interpreter_constraints(PythonSetup.global_instance().interpreter_constraints)

# Dump everything into the builder's chroot.
for tgt in source_tgts:
Expand Down

0 comments on commit 3bca020

Please sign in to comment.