-
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
Warn if an invalid URL is passed with --index-url #7965
Conversation
Thank you very much for working on this! |
One question: from a comment on that ticket, it seems index-url can point to directories. Is that the case? How does that factor here? |
Hi @SalomonSmeke , Thanks for the comment, the document on --index-url does state that the url should So it pointing to a local directory might cause a warning in my current case, unless I explicitly check if the url is a valid local directory path. I will add that check using os.path.exists perhaps. On another thought, I think that even for a local directory, we have to use a |
@deveshks thank you very much for checking! |
No worries @SalomonSmeke . Hi @uranusjr , As per your comment , #7430 (comment) , I have created this PR to handle cases with invalid |
da8f958
to
634eb5d
Compare
Hi @uranusjr , I have made the requested changes in the PR. Please take a look :) |
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.
One more comment, otherwise LGTM
Oh and also, remember the news fragment. |
Hi @uranusjr , I have already added the news fragment. Is there an issue with the content or the file extension, which is |
@deveshks Sorry, I mis-read the diff. The news fragment is fine 🙂 |
Thanks @uranusjr. Also for your earlier about not needing Please let me know if there are any other concerns 🙂 |
634eb5d
to
4c70c6d
Compare
Thanks @uranusjr for the approval. Hi @pradyunsg , could I please get this PR merged as well 😊 |
More of a question than a review, but what's pip's position to newline use recommended by PEP 8? |
@McSinyx The lint jobs handle that. We have a flake8 config somewhere, but to be honest I personally just tend to follow the surrounding code as best I can,. then run lint and fix whatever it complains about. (IIRC, it's 2 blank lines between top-level definitions, 1 blank line between definitions in a class, and must have a newline at the end of the file). |
@pfmoore, sorry for not phrasing the question clearly enough. I was referring to this part of PEP 8:
Since logical section is totally up to us to decide, within |
Hi @uranusjr I forgot about it earlier, but I have also added a test case to verify the behaviour for the change in the PR. Please look at the same as well 😊 |
@McSinyx Ah right, I understand what you mean. My personal view would be that if you're changing the code, then tidying up line spacing is fine, although you should be aware that "readability" is very personal, so err on the side of caution. I would not recommend doing a larger "tidying up" pass on the code. It tends to cause merge conflicts in other PRs, and generally do more harm than good. |
ea9a79a
to
98cc1de
Compare
98cc1de
to
ac65f13
Compare
4dc7ee3
to
78ddfd8
Compare
@deveshks, there's a lint issue. Edit: seems like CI issue 😞 |
78ddfd8
to
efd6dd2
Compare
It's passing now. I wonder if we can lower the number of CIs to avoid false alarms like this. |
Thanks @uranusjr for the approval. Hi @xavfernandez , @pradyunsg , If the changes look good, could I please get this PR merged as well 😊 |
Fixes and Closes #7430
The idea was taken from https://github.com/pypa/pip/blob/master/src/pip/_vendor/distlib/util.py#L192