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

Revert unnecessary runtime check for valid Python interpreter #7451

Conversation

Projects
None yet
3 participants
@Eric-Arellano
Copy link
Contributor

commented Mar 28, 2019

Problem

Pants developers run Pants differently than end users do. Whereas they either download the wheel from PyPi or use a Pex, developers build from source. This allows us to run Pants with any Python version we'd like.

Due to a misunderstanding thinking this meant end users could also run Pants with any Python interpreter they wanted, we added in #7365 a runtime check to ensure they use 2.7 or 3.6+.

However, we realized it is impossible (or at least extremely unlikely) that end users will run Pants with an invalid interpreter, due to install time checks, as follows:

  • Pip will not resolve for invalid interpreters like 3.5, as it will not be able to find a valid wheel.
  • Pex includes interpreter constraints when being built, so the Pex cannot be ran with an invalid interpreter.

Thus, the runtime check is unnecessary.

Solution

Remove the runtime check.

Result

Less code and slightly faster performance due to one less check.

@Eric-Arellano Eric-Arellano requested review from stuhood and jsirois Mar 28, 2019

@jsirois

This comment has been minimized.

Copy link
Member

commented Mar 28, 2019

Pip will not resolve for invalid interpreters like 3.5, as it will not be able to find a valid interpreter.

The end of the sentence above in the PR description should s/interpreter./wheel./.

@Eric-Arellano Eric-Arellano added this to the 1.15.x milestone Mar 29, 2019

@Eric-Arellano Eric-Arellano merged commit 03d0c5f into pantsbuild:master Mar 29, 2019

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@Eric-Arellano Eric-Arellano deleted the Eric-Arellano:revert-interpreter-runtime-check branch Mar 29, 2019

stuhood added a commit that referenced this pull request Mar 29, 2019

Revert unnecessary runtime check for valid Python interpreter (#7451)
### Problem
Pants developers run Pants differently than end users do. Whereas they either download the wheel from PyPi or use a Pex, developers build from source. This allows us to run Pants with any Python version we'd like.

Due to a misunderstanding thinking this meant end users could also run Pants with any Python interpreter they wanted, we added in #7365 a runtime check to ensure they use 2.7 or 3.6+.

However, we realized it is impossible (or at least extremely unlikely) that end users will run Pants with an invalid interpreter, due to install time checks, as follows:

* Pip will not resolve for invalid interpreters like 3.5, as it will not be able to find a valid wheel.
* Pex includes interpreter constraints when being built, so the Pex cannot be ran with an invalid interpreter.

Thus, the runtime check is unnecessary.

### Solution
Remove the runtime check.

### Result
Less code and slightly faster performance due to one less check.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.