[openstack-dev] Requests + urllib3 + distro packages

Monty Taylor mordred at inaugust.com
Thu Oct 15 13:59:26 UTC 2015

On 10/15/2015 02:53 AM, Thomas Goirand wrote:
> On 10/15/2015 12:18 AM, Robert Collins wrote:
>> On 15 October 2015 at 11:11, Thomas Goirand <zigo at debian.org> wrote:
>>> One major pain point is unfortunately something ridiculously easy to
>>> fix, but which nobody seems to care about: the long & short descriptions
>>> format. These are usually buried into the setup.py black magic, which by
>>> the way I feel is very unsafe (does PyPi actually execute "python
>>> setup.py" to find out about description texts? I hope they are running
>>> this in a sandbox...).

You should go look at $package.egg-info/PKG-INFO in the source tarball. 
The short and long description are in that and it's a parseable format

It's an RFC822 format information file - so the following python gets 
the short description inside of an unpacked shade tarball:

import rfc822
a=rfc822.Message(open('shade.egg-info/PKG-INFO', 'r'))
print a['summary']

I think this should solve your problem of getting the information. (you 
don't need python - rfc822 is pretty parseable by a human)

>>> Since everyone uses the fact that PyPi accepts RST format for the long
>>> description, there's nothing that can really easily fit the
>>> debian/control. Probably a rst2txt tool would help, but still, the long
>>> description would still be polluted with things like changelog, examples
>>> and such (damned, why people think it's the correct place to put that...).

The reason they think that is because PyPI is a place where people go to 
download things, and often quick and easy examples of how the library 
works help people to decide if it's for them or not. The uses cases are 

>>> The only way I'd see to fix this situation, would be a PEP. This will
>>> probably take a decade to have everyone switching to a new correct way
>>> to write a long & short description...
>> Perhaps Debian (1 thing) should change, rather than trying to change
>> all the upstreams packaged in it (>20K) :)
>> -Rob
> Well, having the changlog (and other stuff) of packages merged into the
> long description is not helpful, not for Debian, nor for upstream Python
> packages.

I actually have gotten multiple requests from people to get changelogs 
uploaded to PyPI (which involves appending to the long description) 
because it is helpful to them. . I think right now people find value in 
the information being there so I don't think this one is very winnable 
right now. Sorry ...


More information about the OpenStack-dev mailing list