revert(bzlmod)!: allow bzlmod pip.parse to implicitly use default python version#1341
Merged
revert(bzlmod)!: allow bzlmod pip.parse to implicitly use default python version#1341
Conversation
Collaborator
|
Mostly LGTM, but I want to rewrite the description to give more context. "causes bugs" and "we decided" doesn't give enough information for future readers. It's my EOD now, though, so I don't have the energy to the description and add to the merge queue. |
rickeylev
approved these changes
Jul 26, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reverts #1303
The main issue is that
pip.parse()accepts a locked requirements file -- this meansthe requirements are specific to a particular Python version[1]. Because the default Python
version can arbitrarily change, the lock file may not be valid for the Python version
that is used at runtime. The net result is a module will use dependencies for e.g. Python
3.8, but will use 3.9 at runtime. Additionally, the dependencies resolved for 3.8 will
be created under names such as
@foo_39(because that's the python_version pip.parse sees),which is just more confusing.
BREAKING CHANGE:
python_versionexplicitly set. Set it to the Python versionused to resolve the requirements file.
[1] Lock files aren't necessarily version specific, but we don't currently support the
environment markers in lock files to make them cross-python-version compatible.