-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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 #1664: Include path in error message when version is missing #1706
Fix #1664: Include path in error message when version is missing #1706
Conversation
2333a67
to
0ed96f2
Compare
@pypa/setuptools-developers On this PR, would you be okay with me making also the argument passed to setuptools/pkg_resources/__init__.py Lines 2666 to 2667 in 702f2d9
This will make the exception easier to read for users because it won't introduce additional escaping of slashes in the path due to calling repr() on the string.
|
Thanks for this PR; I haven't had a chance to review it carefully though, but it looks very thorough!
Hm, I find it a little weird when errors set an args tuple instead of a string as the message anyway, so I don't have a big problem with changing it conceptually, the question is whether anyone is using the fact that it currently raises a Might be a little overboard, but maybe we could do this for "best of both worlds"? class MissingVersionError(ValueError):
def __repr__(self):
return "%s(%s, %s)" % (self.__class__.name + self.args) Haven't looked at this too much, maybe it should be something like |
Okay, thanks, @pganssle. I'll think about it what I can do here to preserve that aspect, along the lines you suggest. I was already planning to propose a new |
0ed96f2
to
af2eb35
Compare
Okay, I gave this a bit of thought. To keep the scope of this PR limited, I'll keep everything the same here like the type of the In the meantime, I adjusted the tests I created to also check that the How does that sound? |
e0928af
to
f1c7d2a
Compare
@cjerdonek I'm fine with either thing, tightly scoped PR or bigger one. I think your proposed course of action is prudent. It seems like there's a test failure on Windows. Hard for me to tell what's going on there, but I think it's related to the fact that windows uses backslashes for path separators, and if you're testing against the |
e461e21
to
d737332
Compare
Oops, it was working before, and I didn't check after my last force-push. (I had reversed two positional arguments It is ready 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.
This seems like a lot of internal changes for a fairly minor convenience feature, but I do think a lot of what you have done is just a bit of refactoring of existing methods in a way that is independent of the necessary change (boy scout rule), so I think that's mostly fine.
Other than that, I have left a few specific comments in-line. Sorry for the delay in this review.
4b84ef7
to
0764bfb
Compare
Thanks for all of your comments, @pganssle. I've updated the PR with all of your suggested changes. |
Hi @pganssle, just pinging you on this. I answered the question that you asked before, and also included another test case in response to your question. |
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.
OK, this looks good. I would like to re-word the changelog a bit, but I'll do that as part of the merge. Thanks @cjerdonek and sorry again for the delay in approving/merging this.
01565aa
to
33f7e98
Compare
You might want to reference #6177 and/or #6283 on pip’s tracker as well. |
33f7e98
to
e92f16f
Compare
@cjerdonek Thanks, updated the commit message. Not sure why the pypy job is failing. Seems unrelated? Hopefully restarting the job enough times will work. |
Yes, seems unrelated. Are other PR’s failing? |
Could the PR need to be rebased? (not sure if master is auto-merged prior to running tests) |
@cjerdonek I rebased it when I was messing around with the commit history, though I think Travis does auto-merge the base branch if possible. I have occasionally seen intermittent multi-threading issues like this in pypy in the past. I seem to remember that they were resolved upstream, though, so maybe this is something different. |
Related to pip's github issue pypa/pip#6194. This has come up in pip's issue tracker (github) multiple times: - pypa/pip#6177 - pypa/pip#6283 - pypa/pip#6194
e92f16f
to
80ec85c
Compare
Thanks @cjerdonek, sorry for the delays and that last hiccup! |
Thank you, @pganssle! 🎉This will help users a lot by letting them quickly locate and diagnose problematic installs. |
@cjerdonek This is included in the 40.9.0 release - hot off the presses! |
Fixes #1664.