Skip to content
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

Inform users when vcs's are not in the path. #4461

Merged
merged 9 commits into from May 3, 2017
Merged

Inform users when vcs's are not in the path. #4461

merged 9 commits into from May 3, 2017

Conversation

AraHaan
Copy link
Contributor

@AraHaan AraHaan commented May 2, 2017

This fix clarifies the error given to suggest to the user what might be wrong.

This fixes an issue where when someone who tries to use git with pop but pip can't because git is not in the path environment variable. This explicitly tells them how they can fix the issue.
"rBot-devs/ffmpus/blob/master/pthmgr.e"
"xe and the source code can be found h"
"ere as well https://github.com/Decora"
"terBot-devs/pthmgr.".format(self.name))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Strong -1 on the advert for pthmgr. Users can manage PATH in whatever way they like - it's not pip's job to advise on this.

You're also making the assumption that the user has the VCS installed but not in PATH - surely it's equally possible that they didn't install it? A much simpler change would be to just improve the message a little (on all platforms): "Cannot find command %r - do you have it installed and on PATH?"

raise BadCommand('Cannot find command %r' % self.name)
raise BadCommand(
'Cannot find command %r - do you have '
'%r installed and in your PATH?' % self.name)
else:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You have 2 instances of %r but only one argument. Either add a second copy of self.name to the RHS or just go with "... do you have it installed ...".

news/4461.bugfix Outdated
This fixes an issue where when someone who tries to use git
with pip but pip can't because git is not in the path
environment variable. This explicitly tells them how they
can fix the issue.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given the changed wording of the error, I'd reword this as well - something like "clarifies the error given to suggest to the user what might be wrong".

@AraHaan AraHaan changed the title Inform windows users when vcs's are not in the path. Inform users when vcs's are not in the path. May 2, 2017
news/4461.bugfix Outdated
@@ -0,0 +1,2 @@
clarifies the error given to suggest to the user
what might be wrong.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't mean literally just that text :-( It was just a suggestion on the way to express what had changed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah

Copy link
Member

@pfmoore pfmoore left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the repeated changes needed here to what's really a fairly simple changes. As the history has got quite messy, would you also be OK with squashing the PR before it's committed? Alternatively, with your permission, I could simply make a the error message change (crediting you in the NEWS entry, of course) on your behalf.

Regardless of your preference, thanks for taking the time to help with improving pip - and sorry for the nitpicking!

raise BadCommand(
'Cannot find command %r - do you have '
'%r installed and in your '
'PATH?' % self.name % self.name)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should not chain % operators like this. To supply multiple arguments to the % operator you need to supply a tuple on the RHS. But in this case I think that repeating the VCS command name is unnecessary - I'd just use "it" in place of the second %r. If you prefer the repeat, though, that's fine (just implement it correctly, please).

One question - did you test this? As it stands the code will fail. I was considering asking you to write a test for this, but it seemed like a lot of additional work for a simple change. But I'm now wondering.

news/4461.bugfix Outdated
@@ -0,0 +1,2 @@
This fix clarifies the error given to suggest to the user
what might be wrong.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This still isn't wright, sorry - you need to think about how it would look in the larger NEWS file. There's no context here explaining which error message has been changed, or

What I was trying to suggest was that your original text:

This fixes an issue where when someone who tries to use git with pip but pip can't because git is not in the path
environment variable. This explicitly tells them how they can fix the issue.

needed to be changed because the revised error no longer explicitly told the user how to fix the issue, but rather suggested to the user how to check what the problem might be. So the text I suggested was intended as a possible replacement for the last sentence only.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh

@AraHaan
Copy link
Contributor Author

AraHaan commented May 2, 2017

I am alright with the change on my behalf and crediting me on it because I can't squash this PR on my iPhone and my laptop that I can do it on is not running and does not have internet unlike my iPhone. And so that is another reason why I didn't test my changes earlier to not know it would not work. Not only that but I am so used to python 3's string tuple formatting. I never really did the formatting like above before to really know. I just pushed an commit to attempt the fix to the formatting I did without using python 3's string formatting.

Edit: right after sending this I now have a way to get my laptop online to squash this. It might take a few hours or Soto do it as I also plan to rename and edit the commit title and message.

@pfmoore
Copy link
Member

pfmoore commented May 2, 2017

I just found out that Github has a "squash and merge" option. So you don't need to do the squash - I can do it for you. Sorry for the confusion, I didn't know that feature existed.

Unless you have any further changes you want to make, I can merge this - it looks good to me now. Just let me know you're OK for it to go.

@dstufft
Copy link
Member

dstufft commented May 2, 2017

Squash Merges are great, I mostly always use them now :)

@pfmoore
Copy link
Member

pfmoore commented May 2, 2017

@dstufft Yeah, TIL :-)

@AraHaan
Copy link
Contributor Author

AraHaan commented May 2, 2017

Alright I think it is good to go. I was thinking to make the commit match the PR's name and the message to match the contents in the 4461.bugfix.

@pfmoore pfmoore merged commit 0d513ac into pypa:master May 3, 2017
@pfmoore
Copy link
Member

pfmoore commented May 3, 2017

Thanks very much for this, and for your patience with my requests for edits! I hope I didn't make your first experience of contributing too painful :-)

@AraHaan AraHaan deleted the patch-1 branch May 3, 2017 13:14
@AraHaan
Copy link
Contributor Author

AraHaan commented May 3, 2017

You did not make it bad at all. You did help with the suggestions.

@lock lock bot added the auto-locked Outdated issues that have been locked by automation label Jun 3, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Jun 3, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
auto-locked Outdated issues that have been locked by automation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants