generating .zip including file in top root using distutils

aspineux aspineux at
Sat Feb 12 13:47:50 EST 2011

Python 2.6 can run a zip file, searching for in the root
of the zip archive and running it.
How can I create such an archive using distutils (and not
setuptools) ?

If I use
# python bdist --format=zip
I get a "dumb" zip file with a deep tree structure from "/" and I
cannot put the in the root archive

If I use
# python sdist --format=zip
I get a more compact tree. But the tree start bellow directory named


If I use setuptool, generating .EGG I get exacly what I want !
But I read it is bad to use setuptool and EGGs since pip is
available :-)

I was hopping distutils have been updated when adding the zip trick,
but I didn't find the trick.


More information about the Python-list mailing list