-
-
Notifications
You must be signed in to change notification settings - Fork 616
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
no straightforward way to call pip-compile without writing to a file #275
Comments
Correct, we're not doing a great job here yet. PR #265 already brought
Should read |
Sounds good, thanks! |
This now works if you specify the output file as |
Thanks! Do you know what release this functionality was or will be added
in, and if there was an associated PR fixing it?
…On Wed, May 2, 2018 at 4:52 AM Tyson Clugg ***@***.***> wrote:
This now works if you specify the output file as -.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#275 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAVt7twEQ3PbygdREWGt8b_Ryui3smR_ks5tuZ3wgaJpZM4G48Ws>
.
|
FYI, I just checked, and I don't see any evidence in the code this functionality was ever added. I also tried running with |
Apologies, reopened! |
The click library automatically treats "-" as stdout, so this works, kind of. The problem is that pip-compile also prints its output on standard output regardless, so you get each line duplicated. Personally I don't like command line tools printing to standard output as a side effect. Standard output should always be the default output of any command line program (if possible). In fact, output files are only necessary if more than one output is required (otherwise the user can just redirect stdout himself). if some kind of "pretty" output is required then stderr can be used instead. I could go ahead and make these changes to bring this tool more in line with standard command line utilities, but unfortunately this will break existing code that depends on the unfortunate current behaviour of implicitly writing to requirements.txt, for example. Are the authors prepared to break the current CLI and issue a new major version? |
It works |
For scripting purposes, it would be nice to have a straightforward way to call
pip-compile
that writes only to stdout, and not to a file.A
--no-output-file
option seems like the most straightforward approach given the other--no-*
options.Some observations:
--dry-run
seems like the only way, but the option isn't intuitively named since this would be a "real run" for the use case I described.--dry-run
also gives the warning "Dry-run, so nothing updated." It would be nice if no warning was emitted for the use case I described.--dry-run
with multiple*.in
files still gives the error "Error: Invalid value: --output-file is required if two or more input files are given."--dry-run
, passing--output-file /dev/null
when usingsubprocess.Popen
gives the following error.Error:
The text was updated successfully, but these errors were encountered: