Skip to content

Commit

Permalink
Add quiet parameter to be able to show pip output (bazelbuild#42)
Browse files Browse the repository at this point in the history
  • Loading branch information
gergelyfabian authored Jul 3, 2020
1 parent 8b3f2d5 commit c6a29a0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion defs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ def _pip_repository_impl(rctx):
target = rctx.attr.python_interpreter_target
python_interpreter = rctx.path(target)
else:
if '/' not in python_interpreter:
if "/" not in python_interpreter:
python_interpreter = rctx.which(python_interpreter)
if not python_interpreter:
fail("python interpreter not found")
Expand Down Expand Up @@ -41,6 +41,7 @@ def _pip_repository_impl(rctx):
"PYTHONPATH": pypath,
},
timeout = rctx.attr.timeout,
quiet = rctx.attr.quiet,
)
if result.return_code:
fail("rules_python_external failed: %s (%s)" % (result.stdout, result.stderr))
Expand All @@ -60,6 +61,7 @@ python_interpreter.
"""),
# 600 is documented as default here: https://docs.bazel.build/versions/master/skylark/lib/repository_ctx.html#execute
"timeout": attr.int(default = 600),
"quiet": attr.bool(default = True),
},
implementation = _pip_repository_impl,
)
Expand Down
2 changes: 1 addition & 1 deletion extract_wheels/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def main() -> None:

pip_args = [sys.executable, "-m", "pip", "wheel", "-r", args.requirements]
# Assumes any errors are logged by pip so do nothing. This command will fail if pip fails
subprocess.check_output(pip_args)
subprocess.run(pip_args, check=True)

extras = requirements.parse_extras(args.requirements)

Expand Down

0 comments on commit c6a29a0

Please sign in to comment.