-
-
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
Incorrect output on pip-compile upgrade with --dry-run and --quiet flags #845
Comments
I think the state now is that the dry run message is indeed suppressed by the quiet flag, but so is the output. Do we want the dry run flag to effectively bypass the log level for the stderr copy of output? Something like --- a/piptools/writer.py
+++ b/piptools/writer.py
@@ -245,10 +245,12 @@ class OutputWriter:
) -> None:
for line in self._iter_lines(results, unsafe_requirements, markers, hashes):
- log.info(line)
if not self.dry_run:
+ log.info(line)
self.dst_file.write(unstyle(line).encode())
self.dst_file.write(os.linesep.encode())
+ else:
+ log.log(line)
|
The above change would break two current tests:
This is because the command pip-compile --quiet --dry-run would produce the header comment in stderr, instead of an empty stderr. That doesn't violate what the tests intend to check for exactly, IMO. |
- content to stderr - omit the dry run message Fixes jazzband#845
) - content to stderr - omit the dry run message Fixes #845
Environment Versions
Steps to replicate
echo "six" > requirements.in
pip-compile
pip-compile --upgrade --dry-run --quiet
Expected result
--dry-run
should print changes to stdout/stderr--quiet
should suppress "Dry-run, so nothing updated." messageActual result
But currently it behaves the opposite way:
Refs:
The text was updated successfully, but these errors were encountered: