Re: [Distutils] zip imports ftw

2012-09-17 Thread Erik Bray
On Sun, Sep 16, 2012 at 3:33 PM, Daniel Holth wrote: > It is because the file has a controversial coding style, with up to 25 > lines of whitespace between classes, and includes functionality for > eggs and some other stuff that was unwanted on top of the resources > stuff that partly made its way

Re: [Distutils] zip imports ftw

2012-09-17 Thread Daniel Holth
On Mon, Sep 17, 2012 at 10:38 AM, Barry Warsaw wrote: > On Sep 16, 2012, at 03:40 PM, Chris McDonough wrote: > >>On Sun, 2012-09-16 at 15:33 -0400, Daniel Holth wrote: >>> It is because the file has a controversial coding style, with up to 25 >>> lines of whitespace between classes, and includes f

Re: [Distutils] zip imports ftw

2012-09-17 Thread Barry Warsaw
On Sep 16, 2012, at 03:40 PM, Chris McDonough wrote: >On Sun, 2012-09-16 at 15:33 -0400, Daniel Holth wrote: >> It is because the file has a controversial coding style, with up to 25 >> lines of whitespace between classes, and includes functionality for >> eggs and some other stuff that was unwant

Re: [Distutils] zip imports ftw

2012-09-17 Thread Barry Warsaw
On Sep 16, 2012, at 03:33 PM, Daniel Holth wrote: >It is because the file has a controversial coding style, with up to 25 >lines of whitespace between classes, and includes functionality for >eggs and some other stuff that was unwanted on top of the resources >stuff that partly made its way into p

Re: [Distutils] zip imports ftw

2012-09-16 Thread Daniel Holth
On Sun, Sep 16, 2012 at 3:40 PM, Chris McDonough wrote: > On Sun, 2012-09-16 at 15:33 -0400, Daniel Holth wrote: >> It is because the file has a controversial coding style, with up to 25 >> lines of whitespace between classes, and includes functionality for >> eggs and some other stuff that was un

Re: [Distutils] zip imports ftw

2012-09-16 Thread Chris McDonough
On Sun, 2012-09-16 at 15:33 -0400, Daniel Holth wrote: > It is because the file has a controversial coding style, with up to 25 > lines of whitespace between classes, and includes functionality for > eggs and some other stuff that was unwanted on top of the resources > stuff that partly made its wa

Re: [Distutils] zip imports ftw

2012-09-16 Thread Daniel Holth
It is because the file has a controversial coding style, with up to 25 lines of whitespace between classes, and includes functionality for eggs and some other stuff that was unwanted on top of the resources stuff that partly made its way into pkgutil. I am really impressed with the file after seei

Re: [Distutils] zip imports ftw

2012-09-16 Thread Barry Warsaw
On Sep 16, 2012, at 1:23 PM, Chris McDonough wrote: > On Sun, 2012-09-16 at 08:07 -0400, Daniel Holth wrote: >> Of course the major potentially non obvious caveats are that a lot of python >> code doesn't use the API to load data from the importer path, instead using >> __file__ and assuming eve

Re: [Distutils] zip imports ftw

2012-09-16 Thread Paul Moore
On 16 September 2012 18:41, Daniel Holth wrote: >> This is easy to work around in brand new code using pkg_resources, so >> it's generally only a problem with older code, or code which can depend >> only on the stdlib. Unfortunately, the stdlib doesn't have much to help >> here. There's pkgutil.

Re: [Distutils] zip imports ftw

2012-09-16 Thread Daniel Holth
> This is easy to work around in brand new code using pkg_resources, so > it's generally only a problem with older code, or code which can depend > only on the stdlib. Unfortunately, the stdlib doesn't have much to help > here. There's pkgutil.get_data but it doesn't really work well if you > nee

Re: [Distutils] zip imports ftw

2012-09-16 Thread Chris McDonough
On Sun, 2012-09-16 at 08:07 -0400, Daniel Holth wrote: > Of course the major potentially non obvious caveats are that a lot of python > code doesn't use the API to load data from the importer path, instead using > __file__ and assuming everything is one, and that sometimes (shared > libraries) t

Re: [Distutils] zip imports ftw

2012-09-16 Thread Daniel Holth
Of course the major potentially non obvious caveats are that a lot of python code doesn't use the API to load data from the importer path, instead using __file__ and assuming everything is one, and that sometimes (shared libraries) the system can't load it unless its a real file. Daniel Holth

Re: [Distutils] zip imports ftw

2012-09-15 Thread Chris Jerdonek
On Sat, Sep 15, 2012 at 8:19 PM, Daniel Holth wrote: > I'd like to take this moment to note how awesome importing from > zipfile is. Did you know you can execute a zip file with Python, and > if it has a __main__.py in the root it will be executed, with the > zipfile's contents on the PYTHONPATH?

[Distutils] zip imports ftw

2012-09-15 Thread Daniel Holth
I'd like to take this moment to note how awesome importing from zipfile is. Did you know you can execute a zip file with Python, and if it has a __main__.py in the root it will be executed, with the zipfile's contents on the PYTHONPATH? file.zip: __main__.py somedep.py other/code.py python file.z