Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow force-enabling or force-disabling colorized output #2041

Commits on Jan 3, 2024

  1. 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.
    aneeshusa committed Jan 3, 2024
    Configuration menu
    Copy the full SHA
    010db60 View commit details
    Browse the repository at this point in the history