[reportlab-users] Pypi package incorrect

Marius Gedminas marius at gedmin.as
Fri Mar 5 07:36:40 EST 2010


tl;dr: please add a fixed MANIFEST.in to the right place in the source
tree and then use 'python setup.py sdist' to produce pip- and
easy_install-compatible tarballs.

Long version follows:

On Fri, Mar 05, 2010 at 10:18:38AM +0100, Klaas van Schelven wrote:

> The ReportLab_2_4 package on Pypi is, as far as I understand, incorrect.

>

> It contains PKG-INFO in the root, and setup.py in a ReportLab_2_4 subdir.

>

> Easy_install recursively searches dirs, but pip does not.

>

> The package that can be downloaded from the reportlab site works fine.

> http://www.reportlab.com/ftp/ReportLab_2_4.tar.gz

>

> This was initially reported as a bug at pip:

> http://bitbucket.org/ianb/pip/issue/56/pip-fails-to-install-reportlab

>

> But is now won't-fix, because setup.py should be at the root of the package.


Not it shouldn't. .tar.gz archives have a single directory with
all the files underneath it, by convention. 'python setup.py sdist'
produces such tarballs by default. If you use distutils, the tarball
(pkgname-version.tar.gz) will look like this:

pkgname-version/PKG-INFO
pkgname-version/setup.py
pkgname-version/other
pkgname-version/files

If you use setuptools, the tarball (also pkgname-version.tar.gz) will
look like this:

pkgname-version/pkgname.egg-info/PKG-INFO
pkgname-version/pkgname.egg-info/SOURCES.txt
pkgname-version/pkgname.egg-info/other-setuptools-metadata
pkgname-version/setup.py
pkgname-version/other
pkgname-version/files

pip handles both kinds of packages just fine.

I don't know how reportlab-2.4.tar.gz from PyPI was produced, but I
think it is wrong for it to have a PKG-INFO file outside of the
ReportLab_2_4 subdirectory. I also find the directory name a bit
strange; I think it should be reportlab-2.4/ rather than ReportLab_2_4/.

Incidentally, since you say that ReportLab_2.4.tar.gz from the FTP site
works fine with pip, then pip doesn't need setup.py to be at the archive
root, it just needs the PKG-INFO not to be outside the main directory.


> A fix would be most welcome!


+1 for that.

How are the PyPI releases made? Is it an automated process that we
could experiment with (without the final upload, of course) and find how
to produce tarballs both easy_install and pip will like?

When I release my packages to PyPI, I simply use 'python setup.py sdist
register upload'. I have tried

python setup.py sdist

in the ReportLab_2.4 directory extracted from
http://www.reportlab.com/ftp/ReportLab_2_4.tar.gz and got a
dist/reportlab-2.4.tar.gz that looks correct to me:

reportlab-2.4/PKG-INFO
reportlab-2.4/setup.py
...

and I could install it into a virtualenv using both easy_install and
pip.

Unfortunately I also saw "No rl_accel code found" and "Failed to
download standard T1 font curves" warnings that may indicate some
problems with the source distribution when produced this way.

Comparing the original .tar.gz with the one produced by setup.py sdist,
I see the latter is missing a lot of files:

CHANGES.txt
INSTALL.txt
LICENSE.txt
VERSION.txt
ez_setup.py
demos/*
docs/*
tests/*
tools/*
src/rl_addons/*
src/reportlab/fonts/*
src/reportlab/MANIFEST.in
src/reportlab/licence.txt
src/reportlab/graphics/barcode/README
src/reportlab/graphics/barcode/TODO
src/reportlab/graphics/barcode/VERSION

Missing files in the source distribution can be fixed by adding a
MANIFEST.in in the same directory as the setup.py. I moved the one in
src/reportlab/ over to the correct place and added file patterns to it
until I got 'setup.py sdist' to produce a complete archive. Here's the
new MANIFEST.in:

global-include *.dtd *.txt *.xml *.yml
global-include *.c *.h *.in *.mashed
global-include *.gif *.png *.jpg .a85
global-include *.AFM *.PFB *.ttf *.pfb *.afm *.sfd
global-include *.py *.bat *.sh *.am *.m4 *.dsp *.dsw *.java
global-include README TODO VERSION AUTHORS COPYING ChangeLog NEWS
README.*
include docs/gen_epydoc

Can we please get it committed to the svn repository? (Hm, didn't I
used to have commit access to it at some time?)

A 2.4.1 release uploaded to PyPI with 'python sdist upload' would be
nice, but I'm not personally in great need of it.

An automated test to ensure you always have complete source
distributions would be nice as well. Do you have a continuous
integration system? Hudson is rather easy to set up.
A job that compares the directory tree produced by 'svn export' with the
tree produced by 'python setup.py sdist; tar xvzf
dist/reportlab-*.tar.gz' would be useful; I volunteer in helping
somebody set it up.

Marius Gedminas
--
In short, at least give the penguin a fair viewing. If you still don't
like it, that's ok: that's why I'm boss. I simply know better than you
do.
-- Linus "what, me arrogant?" Torvalds, on c.o.l.advocacy
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: Digital signature
Url : <http://two.pairlist.net/pipermail/reportlab-users/attachments/20100305/d4f366f4/attachment.pgp>


More information about the reportlab-users mailing list