Skip to content

fix editable URL parsing / support (hg) URL Schemes: urllib #754

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

Closed
westurner opened this issue Dec 20, 2012 · 2 comments
Closed

fix editable URL parsing / support (hg) URL Schemes: urllib #754

westurner opened this issue Dec 20, 2012 · 2 comments
Labels
auto-locked Outdated issues that have been locked by automation

Comments

@westurner
Copy link

Defect

Currently, pip fails to parse URLs to editables which contain multiple + signs.

$ pip install -e hg+bb+ssh://pypy/pypy@tip#egg=pypy
Obtaining pypy from hg+bb+ssh://pypy/pypy@tip#egg=pypy
  Cloning hg bb+ssh://pypy/pypy (to revision tip#egg=pypy) to ./test/src/pypy

It would be great if the output would be:

$ pip install -e hg+bb+ssh://pypy/pypy@tip#egg=pypy
Obtaining pypy from hg+bb+ssh://pypy/pypy@tip#egg=pypy
  Cloning hg bb+ssh://pypy/pypy (to revision tip) to ./test/src/pypy

Use Case

As a package developer, I would like to install packages from Mercurial repositories that are addressed with Mercurial "schemes" for brevity and consistency.

The Schemes Extension for Mercurial supports custom URL schemes. [1]

For example, with a scheme defined in .hgrc (hg showconfig | grep '^scheme')

[schemes]
bb+ssh = ssh://[email protected]/
example = https://{1}.example.org/hg/

This will clone ssh://[email protected]/pypy/pypy

hg clone bb+ssh://pypy/pypy

[1] http://mercurial.selenic.com/wiki/SchemesExtension

Relevant

Sources

  • pip.req.parse_requirements [1]
  • tests.test_requirements [2]
  • tests.test_install_requirements [3]
  • docs/requirements.txt [4]

Are there test cases that demonstrate why Python 2urlparse [5] / Python 3 urllib.parse should or should not be utilized here?

The docstrings for urlparse [6] list a handful of RFCs that may or may not be relevant to describing editable python packages as URLs with

  • schemes containing multiple plus signs
    • hg+https://
    • hg+bb+ssh://
    • git+https://
    • git+git://
  • fragments containing
    • egg names: #egg=
    • file hashes: #md5=

[1] https://github.com/pypa/pip/blob/develop/pip/req.py#L1291
[2] https://github.com/pypa/pip/blob/develop/tests/test_requirements.py
[3] https://github.com/pypa/pip/blob/develop/tests/test_install_requirement.py
[4] https://github.com/pypa/pip/blob/develop/docs/requirements.txt#L45
[5] http://docs.python.org/2/library/urlparse.html
[6] http://hg.python.org/cpython/file/2.7/Lib/urlparse.py

@westurner
Copy link
Author

@dstufft
Copy link
Member

dstufft commented Mar 22, 2017

I'm going to close this issue. While it's true that we don't support this, I think it's unlikely to be a good idea to support it. Instructions or files created using this mercurial feature are not going to work on any other developer machines without extra configuration. Further more, in 5 years there has been a single request for it, so I do not believe that the demand is high enough to warrant inclusion.

@dstufft dstufft closed this as completed Mar 22, 2017
@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

No branches or pull requests

2 participants