mirror of https://github.com/pypa/pip
Preserve the query portion of URL-type InstallRequirement URLs.
With this patch, install commands like: pip install 'http://foo.com/?p=bar.git;a=snapshot;h=v0.3;sf=tgz' will work as expected.
This commit is contained in:
parent
dfe39ed160
commit
c3d51bd891
|
@ -621,6 +621,11 @@ class Link(object):
|
|||
url = url.rstrip('/')
|
||||
return url
|
||||
|
||||
@property
|
||||
def url_without_fragment(self):
|
||||
scheme, netloc, path, query, fragment = urlparse.urlsplit(self.url)
|
||||
return urlparse.urlunsplit((scheme, netloc, path, query, None))
|
||||
|
||||
_egg_fragment_re = re.compile(r'#egg=([^&]*)')
|
||||
|
||||
@property
|
||||
|
|
|
@ -95,7 +95,7 @@ class InstallRequirement(object):
|
|||
# If the line has an egg= definition, but isn't editable, pull the requirement out.
|
||||
# Otherwise, assume the name is the req for the non URL/path/archive case.
|
||||
if link and req is None:
|
||||
url = link.url_fragment
|
||||
url = link.url_without_fragment
|
||||
req = link.egg_fragment
|
||||
|
||||
# Handle relative file URLs
|
||||
|
|
Loading…
Reference in New Issue