-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Improve presentation of errors from subprocesses, during installation #10795
Conversation
The new version looks amazing! No time for a review right now, but purely based on the usability of the new version, I approve 🙂 |
There is one major difference (you know, other than all the aesthetic improvements) -- there's a lot more lines in the output, on failures with
|
d6cb30f
to
b1a977d
Compare
Okay, the unit test failures are string mismatches, as far as I can tell. I'll fix those in a bit. This is ready for cloning and playing around with it, so... I'd appreciate feedback on this. You'll get a proverbial cookie if you're able to make the pretty error formatting logic fail with an exception. ^>^ Barring any showstopper concerns, I'd like to get this out in 22.0. Last I checked, the release manager is very excited about this change. ;) |
436270b
to
90c2719
Compare
90c2719
to
5e0a7a0
Compare
OK, I'm gonna need some help figuring out what exactly the Windows failure is. You should be able to attach a debugger on the failing test, since this is a failure happening in-process. |
Hi @pradyunsg this is a great improvement ! I made a couple of tests with metadata preparation and build errors. Works fine. Looking at your screenshots above I was reminded that it is weird that it prints "Preparing metadata (setup.py)... error" after the error in verbose mode, and before in non verbose mode. The former is a bit weird, but it was like that before and is probably a side effect of the absence of the spinner. So that can be left for future improvements. 👍 |
4ece2fd
to
b9804e2
Compare
I got myself a clean Windows VM, and I still can't reproduce the CI failure -- the test passes in that VM. >.< |
Hmm... let me try it on my Windows computer ;) |
I can reproduce the failure, I actually get 5 failures compared to main, including the 1 in the CI, not sure if that makes this less helpful but here are my steps:
Got 5 errors compared to main:
Main currently passes for me (as long as I switch to UTC, filed issue for that #10816) |
I tested with WIndows 10, Python 3.9. Ran
Some of them came from the issue that @notatallshaw pointed in #10816. I would like to note that Pytest catched some "stderr outputs", that are just what this PR wanted to do:
|
Does that test also fail on main for you? |
Which one? |
test_unhashed_deps_on_require_hashes |
Ok. Seems like it doesn't fail:
|
OH. Ok ok, Windows paths and escaping is the issue. 🤦🏽 |
Thanks for testing this and posting that output @DiddiLeija! ^>^ It would've taken me a lot longer to figure out what I'd done wrong, if you hadn't posted the output of the runs as you were able to reproduce. Thanks! ^>^ |
This serves as additional context that can be presented in error messages.
Modernise the shim, to account for the Python 3.2+ support matrix. This also presents clearer error messages on failures, the included comment helps inform users about why this shim exists and the traceback now explicitly mentions `<pip-setuptools-shim>` to make it clearer to users that this shim exists.
This is more in line with the rest of our output presentation logic.
This file should be importable in all other modules, which means it can't be importing any of those modules (to prevent an import loop).
These errors now more clearly note where the error occurred and what component is at fault.
This more clearly states where the error came from, presents it in a more approachable format with context provided for what this error is related to.
These are more pleasing colours and, more importantly, a clearer presentation style of the package vs the error.
I'd like to use this in screenshots, but the os.environ makes it a bit tricky to do.
42300f9
to
d39a252
Compare
This helps ensure that they aren't improperly handled due to the newer string-in-string design for the setuptools invocation script.
d39a252
to
723b2df
Compare
Hurray! It passes! |
I tested again. I only had 6 failures.
But they are exactly the same failures than the |
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.
I think this can be merged now :)
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.
Droool.
Toward #10421
Before:
After this PR: