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

2017-03-21 Thread Thomas Güttler
Am 21.03.2017 um 15:26 schrieb Wes Turner:
> 
> 
> On Tue, Mar 21, 2017 at 3:13 AM, Thomas Güttler  > 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 
> 
> 
> 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://g...@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/
___
Distutils-SIG maillist  -  Distutils-SIG@python.org
https://mail.python.org/mailman/listinfo/distutils-sig


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

2017-03-21 Thread Thomas Güttler
Am 21.03.2017 um 14:35 schrieb Leonardo Rochael Almeida:
> Hi Thomas,
> 
> Besides figuring out where the repo url is, you have a second problem to 
> solve:
> 
> The command `pip install -e some/path` already has something 
> unpacked/checked-out in `some/path` to install in development mode.
> 
> In which folder would the command `pip install -e some.project` 
> unpack/checkout `some.project`?

Up to now I never specified a directory.

I used "pip install -e git+https://...#egg=foo; already very often.

Up to now pip cloned the git repo into a directory called "src".

Regards,
  Thomas Güttler

-- 
http://www.thomas-guettler.de/
___
Distutils-SIG maillist  -  Distutils-SIG@python.org
https://mail.python.org/mailman/listinfo/distutils-sig


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

2017-03-21 Thread Wes Turner
On Tue, Mar 21, 2017 at 3:13 AM, Thomas Güttler <
guettl...@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
>
> 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, }?

- https://github.com/pypa/warehouse/issues/1638
  - https://pypi.org/pypi/pip/json
  -

  -
https://github.com/pypa/warehouse/blob/master/warehouse/legacy/api/json.py
- [ ] add (existing, Metadata 2.0/3.0) JSON api to devpi

  - [ ] Create a PEP for a pypa JSON HTTP endpoint spec
- [ ] Static HTML support: Redirect to pkg-name-ver.tar.gz.json?

  - http://doc.devpi.net/latest/curl.html
  - http://doc.devpi.net/latest/userman/devpi_commands.html#getjson


- "Pip needs a dependency resolver"
  https://github.com/pypa/pip/issues/988
  -
https://github.com/awwad/depresolve/blob/master/depresolve/scrape_pypi_metadata.py

  - pip clone --recursive
  - pip install --clone --recursive --no-recursive


>
> But how cares for useless downloaded bytes? I don't care.
>

How is this usecase distinct from those solved for by?:

- requirements.txt
- pipenv install --dev pkgname
  - https://github.com/kennethreitz/pipenv


>
> 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://g...@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.

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?

git+git://git.apache.org/libcloud.git
git+https://github.com/apache/libcloud
git+ssh://g...@github.com/apache/libcloud

[1] https://github.com/pypa/interoperability-peps/issues/31


>
> Regards,
>   Thomas Güttler
>
> --
> Thomas Guettler http://www.thomas-guettler.de/
> ___
> Distutils-SIG maillist  -  Distutils-SIG@python.org
> https://mail.python.org/mailman/listinfo/distutils-sig
>
___
Distutils-SIG maillist  -  Distutils-SIG@python.org
https://mail.python.org/mailman/listinfo/distutils-sig


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

2017-03-21 Thread Leonardo Rochael Almeida
Hi Thomas,

Besides figuring out where the repo url is, you have a second problem to
solve:

The command `pip install -e some/path` already has something
unpacked/checked-out in `some/path` to install in development mode.

In which folder would the command `pip install -e some.project`
unpack/checkout `some.project`?

Cheers,

Leo


On 21 March 2017 at 05:13, Thomas Güttler 
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
>
> 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?
>
> But how cares for useless downloaded bytes? I don't care.
>
> 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?
>
> Regards,
>   Thomas Güttler
>
> --
> Thomas Guettler http://www.thomas-guettler.de/
> ___
> Distutils-SIG maillist  -  Distutils-SIG@python.org
> https://mail.python.org/mailman/listinfo/distutils-sig
>
___
Distutils-SIG maillist  -  Distutils-SIG@python.org
https://mail.python.org/mailman/listinfo/distutils-sig