You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Consolidate bazel invocations in the Python code (#47952)
### What does this PR do?
Unify calls to `bazel` from Python with _tailored_ `ctx.run`s.
This includes the transitional `bazel` helper and callers predating the helper.
### Motivation
Favor a single point of maintenance (tested) that:
1. provides an actionable error message should `bazel` be missing (`inv install-tools`),
2. preserves `bazel`'s colored output (pseudo-tty, unless captured),
3. doesn't bury actual errors under frames of Python internals (incurred by `subprocess.check_call`/`check_output`),
4. takes over the burden of `invoke` lacking shell-agnostic command lines (pyinvoke/invoke#2, pyinvoke/invoke#312, pyinvoke/invoke#341, pyinvoke/invoke#514, pyinvoke/invoke#698 and counting).
### Describe how you validated your changes
Ran the existing unit tests:
```sh
python -m pytest tasks/unit_tests/libs/build/bazel_tests.py
```
Co-authored-by: regis.desgroppes <regis.desgroppes@datadoghq.com>
0 commit comments