Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow force-enabling or force-disabling colorized output
`click` allows emitted colored text via `click.style`, which is used by pip-compile to emit colorized e.g. comments to stderr. click uses auto-detection to only enable colors when writing to a TTY. At Lyft, we operate pip-compile as a service: pip-compile invocations are forwarded to a set of remote machines, which leverage a shared cache for much faster compiles. However, they run pip-compile as a subprocess without a TTY attached meaning the output we stream back to the user is not colorized. Therefore, add a `--color` and matching `--no-color` argument to force-enable as well as force-disable color (the default remains click's auto-detection). This could also be used for e.g. running pip-compile in CI. AFAIK pip-sync does not emit colored output, so I did not add the `--color/--no-color` options there.
- Loading branch information