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

Conversation

Eric-Arellano
Copy link
Contributor

Problem

In test_conflict_via_config(), we try to constraint Python to < 2.7. However, this fails to do anything when running on Python 3, because it's overriden by ci.sh's environment variable export PANTS_PYTHON_SETUP_INTERPRETER_CONSTRAINTS='["CPython>=3.5,<4"]'.

This is expected behavior, that the environment variable overrides the command line argument. So, the issue is not with the source code, but this test should also not be failing.

Solution

Set the integration test to be hermetic.

# 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.

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.

@Eric-Arellano Eric-Arellano merged commit 62995e3 into pantsbuild:master Dec 15, 2018
@Eric-Arellano Eric-Arellano deleted the fix-interpreter-selection-test branch December 15, 2018 05:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants