-
Notifications
You must be signed in to change notification settings - Fork 250
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
URI parsing #120
Comments
Looking at what urllib does there:
It does seem that urllib.parse.urlparse may not be doing what is intended by that code (localbuilds is not a netloc). |
Isn't the |
There are at least a couple open issues around |
Please see pypa/pip#6658. I just wasted several hours breaking down this issue to its fullest as it pertains to The logic and error reporting can be drastically improved in this package, and I second @jaraco here - @benoit-pierre is 100% correct (#120 (comment)). |
Has an issue been filed with six? |
Nope. I'll open one. However, the error reporting can still be improved here. I might have time to open a PR today, we'll see :) |
@Qix- could you find some time to file an issue with six? |
@pradyunsg Yep, sorry for the delay. |
Okay, it seems like the bug originates from the standard library. Do we want to work around what the standard library does? |
I just tried the test parser with the standard library and the issue persists. Six is not bugged. import urllib.parse as urllib_parse
def tryparse(url):
print(url)
parsed = urllib_parse.urlparse(url)
unparsed = urllib_parse.urlunparse(parsed)
parsed_again = urllib_parse.urlparse(unparsed)
print(parsed)
print(unparsed)
print(parsed_again)
Looking at RFC 8089, it pretty clearly does not support local paths. This is something that I missed earlier. This means that, currently, a netloc and absolute path are required if the |
By local paths you mean relative paths (ones not starting with a slash) ?
|
The URI parsing logic also recently caused pypa/pip#10098. Pip allows some custom schemes like I’m wondering, due to the many intricacies around URI parsing in general, maybe |
I would be fine with @uranusjr 's suggestion. |
FYI for those in need (like I was) Hatch now supports relative paths using the new context formatting capability https://hatch.pypa.io/latest/config/dependency/#local |
I recently hit this problem when trying to install a local repository with Parsing the example in
|
Awesome @ofek. I’m also very interested in having support for relative path support, to enable path to relative local wheel files for pip installations. |
Since nobody seems to object with the validation logic going away entirely, I’m going to just propose it (see PR linked above). |
According to PEP 508 the following strings should all be parseable:
(I have fed them into the "test program" included in PEP 508 that uses
Parsley
for parsing. Note that there are several typos in the grammar in the document text)The following logic may be flawed:
packaging/packaging/requirements.py
Lines 102 to 104 in d2ed39a
The text was updated successfully, but these errors were encountered: