Skip to content
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
prebeta wants to merge 9 commits intomasterfrom
tonyliang-verbose-errors
Closed

Allow consumers of pip_import to turn off quiet mode#5
prebeta wants to merge 9 commits intomasterfrom
tonyliang-verbose-errors

Conversation

@prebeta
Copy link
Copy Markdown

@prebeta prebeta commented May 6, 2020

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.

Nathan Lawrence and others added 9 commits January 8, 2020 15:46
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),
       }),
   )
   ```
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
@prebeta
Copy link
Copy Markdown
Author

prebeta commented May 7, 2020

bazel-contrib#305

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants