David Bolen <db3l@...> writes:
> I've got some modules in a common directory (since they happen to share
> a module under test/development) that I was building into separate
> executables. So I created independent setup files for each executable
> (I'm not looking to build a single output directory with a common library).
> However, when I run one of the simpler setup files, the resultant library
> file actually has a bunch of pyc modules from other test applications,
> rather than just those the application module in the setup file needs.
> Is py2exe blinding including all pyc files it finds in the current
> directory into the resulting library.zip, rather than just those
> referenced by the module being constructed? I guess I had assumed I
> could run these setups independently while in the same working
> directory, but should I instead be manually purging all local pycs in
> between each independent setup execution?
py2exe uses a a tempoary build directory which is used to collect the
pyc files that are needed for the final executable. This directory
isn't cleaned after running the setup script, so it will probably
eventually contain all the pycs from all your applications. You should
remove it before running the next setup. This is an artifact of
distutils, probably, and maybe it would be better to remove it
The downside of this would be that if your setup script does not only
specify the py2exe stuff but also other packages needed by your exe the
compiled extensions would be recompiled on each run.