food for thought

70 views
Skip to first unread message

Massimo DiPierro

unread,
Jun 30, 2015, 12:20:59 PM6/30/15
to web2py-d...@googlegroups.com
I added a new module to web2py. I am not sure whether it should stay or not but I could use your opinion. I basically allows web2py apps to specify the module they need. If not installed web2py gets them and installs them.

from gluon import module_installer
REQUIRED_PACKAGES = [‘png’, ‘pyqrcode']
module_installer.install(REQUIRED_PACKAGES)

I have not tried it on the windows version nor the OSX version. We may need to specify a target folder (site-packages or Library on OSX).
Is this a very bad idea?

Massimo

Niphlod

unread,
Jun 30, 2015, 2:51:01 PM6/30/15
to web2py-d...@googlegroups.com
oh yes! bad, bad, bad. 
1) not all modules are ready to be put in site-packages and work without issues
2) some modules needs compiling
2) not all apps depend on the latest version of the module
3) pip is the the-facto standard

Michele Comitini

unread,
Jun 30, 2015, 4:29:04 PM6/30/15
to web2py-developers
That was what stopped me a long time ago from finishing something similar.  But I think it can be solved, with some effort.
Anyway I would keep the mandatory dependency part.  i.e. the app ask with a proper error and proper instructions what third party libraries are needed to run.

--
-- mail from:GoogleGroups "web2py-developers" mailing list
make speech: web2py-d...@googlegroups.com
unsubscribe: web2py-develop...@googlegroups.com
details : http://groups.google.com/group/web2py-developers
the project: http://code.google.com/p/web2py/
official : http://www.web2py.com/
---
You received this message because you are subscribed to the Google Groups "web2py-developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to web2py-develop...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Massimo DiPierro

unread,
Jun 30, 2015, 4:38:07 PM6/30/15
to web2py-d...@googlegroups.com
Granted that is not the best way to install modules.

Right now we do not have a way to declare with modules an app needs and we do not have a way to install them automatically.

That code provides the former and attempts the latter. Ok in 50% of the case it will not work. But probably that 50% of the cases is troublesome anyway for lots of users (thinking about installing binary python packages on OS is always a lottery).

Before deciding to take it out. I do not want to take it out. What can we do to salvage it.

Massimo

Niphlod

unread,
Jun 30, 2015, 5:02:22 PM6/30/15
to web2py-d...@googlegroups.com
This goes far beyond "letting unexperienced users publish a self-deploying app in even more unexperienced users's computers". Considering it won't ever work on binaries in most of the cases (pure-python modules SHOULD be shipped within appname/modules) ...
Python packages are a hell (maybe wheels would be the answer) and frankly a whole lotta users would adopt easily web2py if it was on pypi. This requirement surfaced lots of times with various degrees of promises but never took place.

This is just a shortcircuit IMHO: packaging (and distribution) should be delegated to python's tools, not web2py's.
I'm a lot worried about users asking to fix the impossible.
IMHO a thing that doesn't work even in the 20% of the cases isn't worth publishing, but YMMV.

Consider how much awesom(er) would be to create an app that is a package on pypi, set web2py as a requirement (plus any other module as in EVERY other framework) in setup.py or requirements.txt and publish the following README


-------
to install
pip install w2p-mysuperapp

start with
web2py.py -app w2p-mysuperapp
-------

instead of reinventing (poorly) the wheel.

Michele Comitini

unread,
Jun 30, 2015, 5:05:10 PM6/30/15
to web2py-developers
I must agree with niphlod on this.  It would be a killer feature.

--

Massimo DiPierro

unread,
Jun 30, 2015, 5:12:07 PM6/30/15
to web2py-d...@googlegroups.com
I agree. What you propose is awsom(er). 

The problem is that there are two types of users. Those who understand shell and those who do not. Most windows users fall in the latter category and it is them I am concerned about. They do not have stuptools, distutil, nor pip installed. Somebody tells them “you need pytz” or “you need pyqrcode” and they do not even know where to start. 50% of my master students do not know about pip and easy_install and after I tell them they still do not know what to do.

Anyway, let’s table it for now. And I will take it out. 
Can you help with pip install w2p-mysuperapp?




Reply all
Reply to author
Forward
0 new messages