[Chicago] import question

Kumar McMillan kumar.mcmillan at gmail.com
Wed Jan 23 21:01:01 CET 2008

On Jan 23, 2008 1:42 PM, Massimo Di Pierro <mdipierro at cs.depaul.edu> wrote:
> Sorry but I follow a different philosophy in web2py.
> While my users are free to run from source and install any module
> they want, I try to make it easier for them.

why is this a "different" philosophy?  We're just suggesting that your
approach of transforming each 3rd party module into a submodule will
create lots of tedious work since you will likely have to change
import paths in multiple places, those places varying each time the
package changes.  If you were to bundle your dependencies in a way
similar to how python allows one to install a dependency, your life
might be a lot easier and your users' lives will not get any harder
(this is all an implementation detail that they don't need to know
about anyway).

The 6th or so line on the py2exe FAQ is this:

"After py2exe has done its magic, you should have a "dist" directory
with all the files necessary to run your python script. No install
necessary. Click and run. No DLL hell, nothing else to download."

it goes on to say, one of the dist files is "library.zip," a standard
zip file where all the pure source modules will be inserted.  Is that
not a place you can put 3rd party libs?  If you are trying to get this
working in py2exe only as an option then when not in py2exe you should
be able to use a custom sys.path; I don't see why not.


> They must be able to find a appliance they like from the appliances
> web site http://mdp.cti.depaul.edu/appliances (source of bytecode
> compiled), click on it and have it running on their web2py installation.
> My users are not supposed to know anything about dependencies.
> Third party packages are either in the contrib folder (when the
> license permits it) which I maintain and gets updated every new
> web2py release, or in packaged in the appliances (again compatibly
> with licenses). The developers and the consumers of the appliances
> are free to upgrade those packages as they like but it their
> responsibility not to break them.  I guarantee my users that web2py
> upgrades (and relative contrib modules upgrades) do not break
> appliances.
> Massimo
> On Jan 23, 2008, at 1:21 PM, Tim Ottinger wrote:
> > Pete wrote:
> >> On Wednesday January 23 2008 12:34:32 pm Massimo Di Pierro wrote:
> >>
> >>> When people write code, they should not assume that their modules
> >>> are
> >>> going to be installed in site-packages or in a location in sys.path.
> >>>
> >>
> >> Umm, yes, they should.  Prior to 2.5's relative imports, you
> >> didn't have a
> >> choice, and I don't think relative imports solve every situation.
> >>
> >> Perhaps *you* shouldn't assume you can just take someone's code
> >> and install it
> >> however you happen to feel like today and expect it to work.
> >>
> > Especially if you have some kind of package management like apt
> > or YUM or the like.  If you embed it, the users won't get upgrades.
> > Better to have your package include a list of dependencies so the
> > installer can take care of it.
> >
> >
> > _______________________________________________
> > Chicago mailing list
> > Chicago at python.org
> > http://mail.python.org/mailman/listinfo/chicago
> _______________________________________________
> Chicago mailing list
> Chicago at python.org
> http://mail.python.org/mailman/listinfo/chicago

More information about the Chicago mailing list