Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > generating .zip including __main__.py file in top root using distutils

Reply
Thread Tools

generating .zip including __main__.py file in top root using distutils

 
 
aspineux
Guest
Posts: n/a
 
      02-12-2011
Python 2.6 can run a zip file, searching for __main__.py 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 setup.py bdist --format=zip
I get a "dumb" zip file with a deep tree structure from "/" and I
cannot put the __main__.py in the root archive

If I use
# python setup.py sdist --format=zip
I get a more compact tree. But the tree start bellow directory named
"mypackage-version",

my-package-1.0/
setup.py
__main__.py
........

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.

Help




 
Reply With Quote
 
 
 
 
alain.spineux
Guest
Posts: n/a
 
      02-15-2011
I answer myself to put my question on top of the list again.


On Feb 12, 7:47*pm, aspineux <(E-Mail Removed)> wrote:
> Python 2.6 can run a zip file, searching for __main__.py 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 setup.py bdist --format=zip
> I get a "dumb" zip file with a deep tree structure from "/" and I
> cannot put the __main__.py in the root archive
>
> If I use
> # python setup.py sdist --format=zip
> I get a more compact tree. But the tree start bellow directory named
> "mypackage-version",
>
> my-package-1.0/
> * setup.py
> * __main__.py
> * ........
>
> 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.
>
> Help


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Generating a pkg config file with distutils Tycho Andersen Python 0 03-28-2012 02:01 AM
Generating a .pc file using distutils Tycho Andersen Python 0 01-23-2012 11:31 PM
distutils, No module named numpy.distutils.fcompiler.conv_template Luis Alberto Zarrabeitia Gomez Python 0 03-30-2009 03:56 PM
Including python and wxPython in distutils diffuser78@gmail.com Python 0 08-11-2006 05:37 PM
can distutils windows installer invoke another distutils windows installer timw.google Python 1 05-11-2006 10:07 PM



Advertisments