[Distutils] Canonical Repo URL: Make "pip install -e foo" work

Thomas Güttler guettliml at thomas-guettler.de
Tue Mar 21 11:58:30 EDT 2017


Am 21.03.2017 um 15:26 schrieb Wes Turner:
> 
> 
> On Tue, Mar 21, 2017 at 3:13 AM, Thomas Güttler <guettliml at thomas-guettler.de <mailto:guettliml at thomas-guettler.de>> wrote:
> 
>     AFAIK it is impossible to do this:
> 
>      pip install -e foo
> 
>     You need to use the repo URL up to now:
> 
>      pip install -e git+https://example.com/repos/foo#egg=foo <https://example.com/repos/foo#egg=foo>
> 
>     AFAIK the fast/short implementation of "pip install -e foo" does
>     not work, since pip can't access metadata of package foo without downloading
>     the whole package. Or am I wrong - is this possible?
> 
> 
> These read metadata from an already-downloaded package with a setup.py?:
> 
> ```bash
> pip install -e .
> pip install -e "${VIRTUAL_ENV}/src/foo"
> ```
> 

> You can download the JSON metadata from {PyPI, Warehouse} but IDK about {devpi, }?

I don't understand above sentence. Is downloading metadata possible or not?


> How is this usecase distinct from those solved for by?:
> 
> - requirements.txt
> - pipenv install --dev pkgname
>   - https://github.com/kennethreitz/pipenv

I have never heard of pipenv before. But have read the name
of the author before and for me "Kenneth Reitz" means "for human beings".
With other words: nice, simple and elegant API.


>  
> 
> 
>     It should be possible to download the whole package "foo",
>     then look at the metadata which is provided by it. Take
>     the canonical repo url, and then get the source from
>     the repo.
> 
>     AFAIK there is no official way to define a "Canonical Repo URL" up to now.
> 
>     If I want to provide it for my custom packages. How could I do this?
> 
> 
> With JSONLD [1],
> you could just add a "source" attribute (with your own namespaced URI: "myns:source") to the package metadata:
> 
> sourceURL: "git+ssh://git@github.com/pypa/pip@master <http://git@github.com/pypa/pip@master>"
> sourceURL: "git+https://github.com/pypa/pip@master"
> 


> Or, we could add "sourceURL" (pending bikeshedding on the property name) to the metadata 3.0 PEP.

"sourceURL" sound good. 


> 
> ````bash
> pip clone pip
> pip install --clone --rev-override=develop pip
> ```
> 
> And then, if you give a mouse a cookie,
> what about multiple sourceURLs: which is the canonical URL?
> 

I think it only makes sense to publish one sourceURL. If someone publishes two then ...
I don't know. Maybe the first wins? 

Regards,
  Thomas Güttler


-- 
http://www.thomas-guettler.de/


More information about the Distutils-SIG mailing list