fedora-python / pyp2rpm

Tool to convert a package from PyPI to RPM SPECFILE or to generate SRPM.
MIT License
127 stars 39 forks source link

pyp2rpm could do better job at processing descriptions #1

Closed mcyprian closed 8 years ago

mcyprian commented 9 years ago

pyp2rpm takes current description code and preserves linebreaks. This causes the description to be ugly. An improvement can be made by

1) wordwraping paragraphs 2) preserving linebreaks in bullet point items 3) removing url links in text


frenzymadness commented 8 years ago

I've found this problem too when I tried to convert package 'vex' from PyPi to RPM. Vex has a really long long_description (whole readme with examples etc) and pyp2rpm cannot handle them.

Original pyp2rpm output: vex.spec.txt

marbu commented 8 years ago

Yeah, but the thing is that %description in a spec file doesn't have the same purpose as a README file.

For example, see description of ansible rpm package:

$ rpm -qi ansible
Name        : ansible
Version     : 2.1.0.0
Release     : 1.fc23
Architecture: noarch
Install Date: Thu 02 Jun 2016 10:58:58 PM CEST
Group       : Development/Libraries
Size        : 15908294
License     : GPLv3+
Signature   : RSA/SHA256, Wed 25 May 2016 07:54:43 PM CEST, Key ID 32474cf834ec9cba
Source RPM  : ansible-2.1.0.0-1.fc23.src.rpm
Build Date  : Wed 25 May 2016 05:51:47 PM CEST
Build Host  : buildhw-05.phx2.fedoraproject.org
Relocations : (not relocatable)
Packager    : Fedora Project
Vendor      : Fedora Project
URL         : http://ansible.com
Summary     : SSH-based configuration management, deployment, and task execution system
Description :

Ansible is a radically simple model-driven configuration management,
multi-node deployment, and remote task execution system. Ansible works
over SSH and does not require any software or daemons to be installed
on remote nodes. Extension modules can be written in any language and
are transferred to managed machines automatically.

And compare that with ansible README file or ansible entry on PyPI.

So when a description detected by pyp2rpm is too long, I don't think that pyp2rpm could fix such special case itself and manual intervention is needed. Or maybe pyp2rpm could at least prefer description over long_description when it is too long.

frenzymadness commented 8 years ago

Yeah, I understand. Maybe pyp2rpm could use only first (or more) paragraphs if the long description is too long and show warning "manual fix needed". But this is only idea.

mcyprian commented 8 years ago

If description on PyPI contains version and downloads tags, for example python-designateclient, URLs of the images appears in specfile's %description section.

Python bindings to the OpenStack Cinder API .. image:: https://img.shields.io/pypi/v/pythoncinderclient.svg :target: https://pypi.python.org/pypi/pythoncinderclient/ :alt: Latest Version.. image:: https://img.shields.io/pypi/dm/pythoncinderclient.svg :target: https://pypi.python.org/pypi/pythoncinderclient/ :alt: DownloadsThis is a client for the OpenStack Cinder API. There's ...