-
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
Raise an exception if revision is empty in git url #7927
Raise an exception if revision is empty in git url #7927
Conversation
I’m wondering whether it would be good enough to fallback to the default (i.e. remove the |
Hi @uranusjr I personally think it's better being explicit to the user about the problem in the URL, rather than taking decisions on his behalf, and using for e.g. If we want to do that, we should ask the user about it beforehand, or during installation perhaps. But if that is what would serve a user better, I can update my PR to do the same :) |
I am honestly not sure which is better. I would definitely agree explicitness is better if we didn’t already allow a ref-less URL, but since there is already a default, I feel it is equally good to use that default or not. Let’s see if other maintainers have more useful opinions 😅 |
Agreed @uranusjr , I will wait for other maintainers to provide their opinions, and then make changes accordingly, but assuming if we go with the explicit approach, does the PR I submitted look good, or are there issues in the code somewhere? |
No, the patch looks good to me if we want to raise an error in this case. |
Thanks @uranusjr. |
One additional though: We can probably raise an |
For the sake of keeping the pip code base slightly simpler, falling back to I have no strong opinion on this though. |
Hi @sbidoul In that case, we can always add a I think that will inform the user to take a decision to fix his url if he wants to, while also not failing immediately and letting the installation fail. |
I think that we should throw an explicit exception here for two reasons:
That doesn't mean that we shouldn't change the behavior, but if someone feels strongly about it then I think it should be a separate issue and this PR (and the issue it addresses) can just be about making an error scenario more user-friendly. |
Thanks folks. So seems like @uranusjr and @sbidoul are on the fence for this, while @chrahunt and even I think that we should let it remain an error, and if needed, create another PR/issue for discussion around this to make it more user friendly. Given this is the scenario, I think I will go ahead and keep this PR to report an error, but probably raise an Should I make the above change and then close out this PR to be merged? |
@deveshks Yes. However, it's possible that we end up deciding that we don't want to error out, so there's a possibility that the PR doesn't get merged. |
Hi @pradyunsg Yes sure, also @chrahunt did mention that if we want to include a warning instead of erroring out, there should be a separate issue and this PR (and the issue it addresses) can just be about making an error scenario more user-friendly. |
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.
LGTM
Thanks @sbidoul , Can I get it merged as well :) |
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.
LGTM, other than the NEWS file entry.
And, I tend toward a "be strict and loosen if users would need that" approach, so I'm fine with being strict here and just plain erroring out.
3ec4164
to
59df536
Compare
Hi @pradyunsg , seems like the new commit caused some checks to error out: https://github.com/pypa/pip/actions/runs/67463960 |
Fixes and closes #7402
If URL's listed in VCS Support of pip install of the type
git://git.example.com/MyProject.git@master#egg=MyProject
have a missing revision, e.g.master
here, raise an exception.e.g.