-
Notifications
You must be signed in to change notification settings - Fork 444
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
fix: append pip errors to log file rather than overwrite #1133
Conversation
Resolves pypa#1132 An alternative would be to create new log files for each pip invocation, but this would require deeper changes. Appending seems like a decent solution as a first fix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Automated tests please.
@gaborbernat I'm struggling to think of a good way to produce multiple error messages in a deterministic way. The PR that added the log files tests the functionality by doing Lines 256 to 266 in 9639e2c
The whole logfile content doesn't seem to be tested at all. Just the existence of the error log file. It could be empty and tests would pass at the moment, it seems. |
Yeah, this would fix that. Can't you do this:
but use the same python version, with the seeded pacakges? |
Sorry I'm not quite sure what you mean by "seeded packages". I'm also not sure that this particular combination of packages and python versions will be a stable way to get multiple errors in the future. |
These https://github.com/pypa/pipx/blob/main/testdata/tests_packages/primary_packages.txt#L1, you can pick to known failing versions there |
Hmm, there's only one expected fail that I can see I managed to get multiple errors due to a bug that will get fixed eventually. The only way I can think of getting multiple errors is an upgrade where the old versions installed, but the new latest ones throw errors. This would require two packages that fail for the latest version in perpetuity. Not sure something like that exists on Pypi. |
What if we added a test to check basic content of the error file, but not this particular case of multiple errors in one file? Append will only produce different results in a small subset of use cases and it's much harder to test. |
Ok 👌 |
Seems stalled, we can reopen if you pick it up again. |
Resolves #1132
An alternative would be to create new log files for each pip invocation, but this would require deeper changes. Appending seems like a decent solution as a first fix.
docs/changelog.md
Summary of changes
Test plan
Tested by running
The logs now contain pip error output from both errors: visidata and pycowsay. Exactly what should happen.