This repository was archived by the owner on Jan 19, 2024. It is now read-only.
Allow consumers of pip_import to turn off quiet mode#5
Closed
Allow consumers of pip_import to turn off quiet mode#5
Conversation
1. Instead of calling `pip_main` as a function, we're using `subprocess`
to call `python -m pip`. PIP behaves differently based on the
version of Python being run and so we want to run PIP with Python 2
when we're in Python 2 mode, and vice versa.
2. We're exposing the full `requirements` dict instead of just the keys.
This is to support dynamically changing between the Python 2 and
Python 3 version of a library, e.g.:
```
native.alias(
name = requirement_name,
actual = select({
"@bazel_tools//tools/python:PY2": requirement2(requirement_name),
"@bazel_tools//tools/python:PY3": requirement3(requirement_name),
}),
)
```
Use METADATA, not metadata.json
Temporary changes to support running PY2 and PY3 in parallel
That refactor was entirely unnecessary, rules_python *does* apparently call the .par files with the appropriate python interpreter so things work in Python 2 and Python 3 as expected. Note that this *does* keep the change to expose `requirements` publicly.
Revert the earlier switch to subprocess.call
Author
prebeta
pushed a commit
that referenced
this pull request
Sep 22, 2020
…pport Namespace pkgs support
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
We've found that turning off the quiet flag is useful for debugging issues with pip_import. Maybe it would be beneficial for us to let users pass in quiet=False if they wanted to debug.
This might be a reasonable change that we propose for upstream.