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

Fix Travis environment variable overriding interpreter_selection test's config #6939

Merged
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
3 changes: 1 addition & 2 deletions build-support/bin/ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,8 @@ fi

# NB: Ordering matters here. We (currently) always bootstrap a Python 2 pex.
if [[ "${python_three:-false}" == "true" ]]; then
# The 3.4 end of this constraint is necessary to jive with the travis ubuntu trusty image.
banner "Setting interpreter constraints for 3!"
export PANTS_PYTHON_SETUP_INTERPRETER_CONSTRAINTS='["CPython>=3.4,<4"]'
export PANTS_PYTHON_SETUP_INTERPRETER_CONSTRAINTS='["CPython>=3.5,<4"]'
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was fixed by 7da3ab5, but we didn't notice then.

I think this might be fine for scope creep, because it directly ties to the failing test, but let me know.

# TODO: Clear interpreters, otherwise this constraint does not end up applying due to a cache
# bug between the `./pants binary` and further runs.
./pants.pex clean-all
Expand Down
4 changes: 1 addition & 3 deletions testprojects/src/python/interpreter_selection/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@ python_library(
sources = ['echo_interpreter_version.py'],
dependencies = [],
# Play with this to test interpreter selection in the pex machinery.
# TODO(John Sirois): Allow `<4` when the issues with `3.7` are fixed. See:
# https://github.com/pantsbuild/pants/issues/6363
compatibility = ['CPython>=2.7,<3.7']
compatibility = ['CPython>=2.7,<4']
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I noticed while debugging this that this line seems out of date now. But fixing it might be scope creep? Lmk if better to remove this from PR.

)

python_binary(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,17 @@


class InterpreterSelectionIntegrationTest(PantsRunIntegrationTest):

testproject = 'testprojects/src/python/interpreter_selection'

@classmethod
def hermetic(cls):
# We must set as true to ignore `PANTS_PYTHON_SETUP_INTERPRETER_CONSTRAINTS`
# preconfiguring the interpreter_constraint. For example, in `ci.sh` we set
# this environment variable to Python 3, which overrides any config defined
# in the below tests.
return True

def test_cli_option_wins_compatibility_conflict(self):
# Tests that targets with compatibility conflicts collide.
binary_target = '{}:deliberately_conficting_compatibility'.format(self.testproject)
Expand Down