Get dependencies of a package without full download
Hi, just out of curiosity: Is it possible to get the dependencies of a package without full download from pypi? If you want to build a graph of dependencies this would be nice, since it would reduce the network traffic a lot. Regards, Thomas Güttler
On Apr 01, 2015, at 04:14 PM, Thomas Güttler wrote:
Is it possible to get the dependencies of a package without full download from pypi?
It would be kind of nice if you could get the package's metadata (e.g egg-info/entry_points.txt) out of its PyPI JSON blob: https://pypi.python.org/pypi/flufl.i18n/json Cheers, -Barry
The answer to this is technically yes, but realistically no. If you build Wheels and you upload a Wheel *first* and you use twine to do so, then you will register the dependency information with PyPI and that will be available in the JSON API. If you upload a sdist first (or you type setup.py register) or you don’t use twine then they will not get registered. Look for “requires_dist” in https://pypi.python.org/pypi/twine/json If anyone has specific things they’d like to see in an API I urge you to open issues on the Warehouse issue tracker (https://github.com/pypa/warehouse) so that we can make sure we consider them for inclusion into Warehouse.
On Apr 1, 2015, at 2:17 PM, Barry Warsaw <barry@python.org> wrote:
On Apr 01, 2015, at 04:14 PM, Thomas Güttler wrote:
Is it possible to get the dependencies of a package without full download from pypi?
It would be kind of nice if you could get the package's metadata (e.g egg-info/entry_points.txt) out of its PyPI JSON blob:
https://pypi.python.org/pypi/flufl.i18n/json
Cheers, -Barry _______________________________________________ Distutils-SIG maillist - Distutils-SIG@python.org https://mail.python.org/mailman/listinfo/distutils-sig
--- Donald Stufft PGP: 7C6B 7C5D 5E2B 6356 A926 F04F 6E3C BCE9 3372 DCFA
Vinay Sajip was maintaining metadata as described here, I'm sure there are functions in distil to help fetch it. http://distil.readthedocs.org/en/latest/packaging.html#packaging-metadata. The most severe problem with this data is of course that it is not always correct because the environment he evaluated setup.py in to get the data may be different than yours. On Wed, Apr 1, 2015 at 2:20 PM, Donald Stufft <donald@stufft.io> wrote:
The answer to this is technically yes, but realistically no.
If you build Wheels and you upload a Wheel *first* and you use twine to do so, then you will register the dependency information with PyPI and that will be available in the JSON API. If you upload a sdist first (or you type setup.py register) or you don’t use twine then they will not get registered.
Look for “requires_dist” in https://pypi.python.org/pypi/twine/json
If anyone has specific things they’d like to see in an API I urge you to open issues on the Warehouse issue tracker (https://github.com/pypa/warehouse) so that we can make sure we consider them for inclusion into Warehouse.
On Apr 1, 2015, at 2:17 PM, Barry Warsaw <barry@python.org> wrote:
On Apr 01, 2015, at 04:14 PM, Thomas Güttler wrote:
Is it possible to get the dependencies of a package without full download from pypi?
It would be kind of nice if you could get the package's metadata (e.g egg-info/entry_points.txt) out of its PyPI JSON blob:
https://pypi.python.org/pypi/flufl.i18n/json
Cheers, -Barry _______________________________________________ Distutils-SIG maillist - Distutils-SIG@python.org https://mail.python.org/mailman/listinfo/distutils-sig
--- Donald Stufft PGP: 7C6B 7C5D 5E2B 6356 A926 F04F 6E3C BCE9 3372 DCFA
_______________________________________________ Distutils-SIG maillist - Distutils-SIG@python.org https://mail.python.org/mailman/listinfo/distutils-sig
From: Daniel Holth <dholth@gmail.com>
Vinay Sajip was maintaining metadata as described here, I'm sure there are functions in distil to help fetch it.
Yes, though there is no need for any special API to access it - the metadata is in JSON files served statically. You just make a standard HTTP request, using the client library of your choice, to get a specific URL. The files are under http://www.red-dove.com/pypi/projects/ And you can just use a browser to browse the metadata from this starting point.
The most severe problem with this data is of course that it is not always correct because the environment he evaluated setup.py in to get the data may be different than yours.
Indeed, which is why declarative metadata is so important. Down with setup.py! Regards, Vinay Sajip
Am 01.04.2015 um 20:20 schrieb Donald Stufft:
The answer to this is technically yes, but realistically no.
If you build Wheels and you upload a Wheel *first* and you use twine to do so, then you will register the dependency information with PyPI and that will be available in the JSON API. If you upload a sdist first (or you type setup.py register) or you don’t use twine then they will not get registered.
Look for “requires_dist” in https://pypi.python.org/pypi/twine/json
If anyone has specific things they’d like to see in an API I urge you to open issues on the Warehouse issue tracker (https://github.com/pypa/warehouse) so that we can make sure we consider them for inclusion into Warehouse.
Just my feelings, without technical/logical background: I hate the "ORs" and "IFs" in the python packaging world. Can't it be done "condition less"? I want a stupid straight forward step by step way. Regards, Thomas Güttler
On 2 April 2015 at 20:27, Thomas Güttler <guettliml@thomas-guettler.de> wrote:
I hate the "ORs" and "IFs" in the python packaging world.
Can't it be done "condition less"?
Unfortunately, that's currently only possible for programming languages tailored primarily for a specific usage domain and with relatively young packaging systems that got to benefit (or not) from everyone else's software distribution experience without backwards compatibility concerns.
I want a stupid straight forward step by step way.
Aye, so do we, the 17 years of history since distutils was first released just makes life a little interesting trying to get there :) Cheers, Nick. -- Nick Coghlan | ncoghlan@gmail.com | Brisbane, Australia
We should do a mode where dependencies come from setup.cfg statically and everything else (setup.py build script) works the same. On Apr 2, 2015 7:02 AM, "Nick Coghlan" <ncoghlan@gmail.com> wrote:
On 2 April 2015 at 20:27, Thomas Güttler <guettliml@thomas-guettler.de> wrote:
I hate the "ORs" and "IFs" in the python packaging world.
Can't it be done "condition less"?
Unfortunately, that's currently only possible for programming languages tailored primarily for a specific usage domain and with relatively young packaging systems that got to benefit (or not) from everyone else's software distribution experience without backwards compatibility concerns.
I want a stupid straight forward step by step way.
Aye, so do we, the 17 years of history since distutils was first released just makes life a little interesting trying to get there :)
Cheers, Nick.
-- Nick Coghlan | ncoghlan@gmail.com | Brisbane, Australia _______________________________________________ Distutils-SIG maillist - Distutils-SIG@python.org https://mail.python.org/mailman/listinfo/distutils-sig
On 2 Apr 2015 21:05, "Daniel Holth" <dholth@gmail.com> wrote:
We should do a mode where dependencies come from setup.cfg statically and
everything else (setup.py build script) works the same. I believe that's what Robert Collins pip PR is aimed at providing. It's still quite limited, as the vast majority of projects aren't going to switch to a declarative devdir, hence PEP 426's dependence on generated declarative metadata in the sdist (that way most folks will just be upgrading to a newer setuptools rather than having to switch to a new build toolchain and change their own development practices) Cheers, Nick.
On Apr 2, 2015 7:02 AM, "Nick Coghlan" <ncoghlan@gmail.com> wrote:
On 2 April 2015 at 20:27, Thomas Güttler <guettliml@thomas-guettler.de>
wrote:
I hate the "ORs" and "IFs" in the python packaging world.
Can't it be done "condition less"?
Unfortunately, that's currently only possible for programming languages tailored primarily for a specific usage domain and with relatively young packaging systems that got to benefit (or not) from everyone else's software distribution experience without backwards compatibility concerns.
I want a stupid straight forward step by step way.
Aye, so do we, the 17 years of history since distutils was first released just makes life a little interesting trying to get there :)
Cheers, Nick.
-- Nick Coghlan | ncoghlan@gmail.com | Brisbane, Australia _______________________________________________ Distutils-SIG maillist - Distutils-SIG@python.org https://mail.python.org/mailman/listinfo/distutils-sig
participants (6)
-
Barry Warsaw
-
Daniel Holth
-
Donald Stufft
-
Nick Coghlan
-
Thomas Güttler
-
Vinay Sajip