On 10/27/2011 04:34 PM, PJ Eby wrote:

You're making this way too hard.  ;-)

All of the APIs you're using are low-level things, used only for advanced plugin frameworks or installer tools. All you need for a simple script is:

sys.path.insert(0, abspath('egg_directory'))
import pkg_resources
pkg_resources.require('foolproof')
import foolproof



Thanks, that's much better right :)
So anyway I do have to work with plugins, specifically envisage plugins.

Moreover, our applications are normally composed by more than one egg, and each of them has
its own setup_requires requiring a set of the global eggs.

At the moment the run system is a bit complicated and uses pkg_resources.find_plugins...

That said reading the API was still interesting, and for example I found the

working_set.subscribe

In theory I can register a callback function that when something is "found" does something, and I thought immediately that it might be possible to hot-swap some plugins at run-time,
is that true doing some tricks with that, is that correct?

def mycallback(dist):
    if dist == 'name':
           # reload(dist), if anything like this can be done at all
_______________________________________________
Distutils-SIG maillist  -  [email protected]
http://mail.python.org/mailman/listinfo/distutils-sig

Reply via email to