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

Add a version check to __pip-runner__.py #11342

Merged
merged 1 commit into from
Aug 6, 2022

Conversation

pfmoore
Copy link
Member

@pfmoore pfmoore commented Aug 3, 2022

This adds a check to the "pip runner" script to ensure that it is being run by a supported version of Python. This is not needed for the "isolated build" use case, as we always know which Python version is running the script in that case. But now that the script is also being used for the --python option, this makes the error handling a bit more robust if an unsupported python version is supplied.

Note that in order to avoid an ugly backtrace, this change now requires __pip-runner__.py to conform to Python 2 compatible syntax (although Python 3 features may be used once the version check is complete).

I'm not sure if it's worth adding tests (we don't currently have tests that explicitly target this file).

@pfmoore pfmoore mentioned this pull request Aug 3, 2022
4 tasks
@sbidoul sbidoul added this to the 22.3 milestone Aug 3, 2022
news/11342.feature.rst Outdated Show resolved Hide resolved
news/11342.feature.rst Outdated Show resolved Hide resolved
@pfmoore pfmoore force-pushed the runner_version_check branch from c6b4f48 to c69ea02 Compare August 4, 2022 09:28
@pfmoore pfmoore added the skip news Does not need a NEWS file entry (eg: trivial changes) label Aug 4, 2022
@pfmoore
Copy link
Member Author

pfmoore commented Aug 4, 2022

Given that I have two approvals, and I've withdrawn my objections to maintaining the code as Python 2 compatible, I'll assume this is OK and merge it at the weekend when I merge the --python option.

@pfmoore pfmoore merged commit 1880f4a into pypa:main Aug 6, 2022
@pfmoore pfmoore deleted the runner_version_check branch August 6, 2022 14:25
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 22, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
skip news Does not need a NEWS file entry (eg: trivial changes)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants