setuptools strangeness: bdist_egg works only in svn checkout

19 views
Skip to first unread message

Felix Schwarz

unread,
Mar 26, 2008, 6:20:50 AM3/26/08
to turbo...@googlegroups.com
Hi,

I just noticed a behavior of setuptools which seems very alien to me: If I
checkout the 1.0 branch and issue an "python setup.py bdist_egg", the
resulting egg file is good and contains all files.

If I put the source into another directory (e.g. by using "svn export"),
bdist_egg produces an incomplete egg file. The issue can be reproduced by
using the egg_info command, too which is faster than building the egg. You
will see that SOURCES.txt is only ~10kB afterwards (the good egg has a
SOURCES.txt which is ~20kB big).

Obviously, setuptools gets some information from the svn directories. But how
can I build a complete egg using just the source without svn metadata?

fs

Florent Aide

unread,
Mar 26, 2008, 6:48:43 AM3/26/08
to turbo...@googlegroups.com
On Wed, Mar 26, 2008 at 11:20 AM, Felix Schwarz <felix....@web.de> wrote:
>
> Hi,
>
> I just noticed a behavior of setuptools which seems very alien to me: If I
> checkout the 1.0 branch and issue an "python setup.py bdist_egg", the
> resulting egg file is good and contains all files.

We need to be more explicit in the setup.py file and add data files in
the find_packages or data_files argument to setup()

Florent.

Christopher Arndt

unread,
Mar 26, 2008, 6:57:01 AM3/26/08
to turbo...@googlegroups.com
Florent Aide schrieb:

What I usually do, is having a MANIFEST.in with something like this:

global-include *.cfg
recursive-include <mypackage>/static *
recursive-include <mypackage>/templates *.kid

graft doc
prune dist
prune build
global-exclude *.bak

This way, "python setup.py sdist" also works as expected. Maybe we
should include this in the quickstart templates?

Also, we should probably include finddata.py in the quickstart
templates, so you don't need TurboGears installed to run the setup.py of
your application.

Chris

Jorge Godoy

unread,
Mar 26, 2008, 7:21:40 AM3/26/08
to turbo...@googlegroups.com
Em Wednesday 26 March 2008 07:57:01 Christopher Arndt escreveu:
>
> What I usually do, is having a MANIFEST.in with something like this:
>
> global-include *.cfg
> recursive-include <mypackage>/static *
> recursive-include <mypackage>/templates *.kid
>
> graft doc
> prune dist
> prune build
> global-exclude *.bak
>
> This way, "python setup.py sdist" also works as expected. Maybe we
> should include this in the quickstart templates?

+1000 for that.

> Also, we should probably include finddata.py in the quickstart
> templates, so you don't need TurboGears installed to run the setup.py of
> your application.

Hmmm... I think this is needed only for packagers. You need TG to run, you
need TG to develop. If you are someone that is packaging applications / TG
to be used by other people you don't need it installed.

Maybe this is interesting, but I don't see it being used all that much.
Specially because people package TG, but not apps.

--
Jorge Godoy <jgo...@gmail.com>

Christopher Arndt

unread,
Mar 26, 2008, 7:31:40 AM3/26/08
to turbo...@googlegroups.com
Jorge Godoy schrieb:

It could be interesting for people wanting to deploy TG apps by checking
out the source on the target host and then running "python setup.py
install" or something similar. This would allow to do this without
having TG installed on the target host. It would then be downloaded and
installed by the app's installation.

Granted, this is usually handled better by using eggs, but it would
provide another option.

Chris

Christopher Arndt

unread,
Mar 26, 2008, 7:34:29 AM3/26/08
to turbo...@googlegroups.com
Felix Schwarz schrieb:

Looking at the standard quickstart setup.py file and the
findata.find_package_data implementation, I currently don't see why this
should be happening. Do you use the "include_package_data" option in
your setup.py file? Can you paste it somewhere?

Chris

Felix Schwarz

unread,
Mar 26, 2008, 8:13:57 AM3/26/08
to TurboGears


On 26 Mrz., 12:34, Christopher Arndt <chris.ar...@web.de> wrote:
> Looking at the standard quickstart setup.py file and the
> findata.find_package_data implementation, I currently don't see why this
> should be happening. Do you use the "include_package_data" option in
> your setup.py file? Can you paste it somewhere?

Sorry, I was not explicit enough: It's not about my own application
but TurboGears itself. Therefore the quickstarted setup.py does not
come into play here.

fs

Christopher Arndt

unread,
Mar 26, 2008, 10:25:13 AM3/26/08
to turbo...@googlegroups.com
Felix Schwarz schrieb:

Ah, sorry, it was me who didn't your mail properly. The setup.py of
TurboGears indeed uses "include_package_date=True", which causes this
behaviour:

http://trac.turbogears.org/browser/branches/1.0/setup.py#L117

For an explanation, see the setuptools docs:

http://peak.telecommunity.com/DevCenter/setuptools#including-data-files

Can you file a ticket? Shoudl probably be for the "Deployment" or
"Installation" component.

Chris

Felix Schwarz

unread,
Mar 26, 2008, 5:10:00 PM3/26/08
to TurboGears

On Mar 26, 3:25 pm, Christopher Arndt <chris.ar...@web.de> wrote:
> Can you file a ticket? Shoudl probably be for the "Deployment" or
> "Installation" component.

http://trac.turbogears.org/ticket/1768

I filed this for 1.1 although I really would like to see this fixed
for 1.0 too :-)

fs

Florent Aide

unread,
Mar 26, 2008, 6:03:48 PM3/26/08
to turbo...@googlegroups.com
On Wed, Mar 26, 2008 at 10:10 PM, Felix Schwarz <felix....@web.de> wrote:
> I filed this for 1.1 although I really would like to see this fixed
> for 1.0 too :-)

You'll have to bye me one or two beers next time I visit you in Berlin :-)

Felix Schwarz

unread,
Mar 27, 2008, 6:51:30 AM3/27/08
to TurboGears

On 26 Mrz., 23:03, "Florent Aide" <florent.a...@gmail.com> wrote:
> On Wed, Mar 26, 2008 at 10:10 PM, Felix Schwarz <felix.schw...@web.de> wrote:
> > I filed this for 1.1 although I really would like to see this fixed
> > for 1.0 too :-)
>
> You'll have to bye me one or two beers next time I visit you in Berlin :-)

No problem, just give me (or Diez) a call :-)

fs
Reply all
Reply to author
Forward
0 new messages