Re: [pyxpcom] PyXPCOM extension - PyEgg
by Lekma other posts by this author
Apr 3 2008 11:06PM messages near this date
view in the new Beta List Site
Re: [pyxpcom] PyXPCOM extension - PyEgg
|
[pyxpcom] FireFox Live Preview API
On Fri, 4 Apr 2008 11:47:33 +1100
"Mark Hammond" <mhammond@[...].au> wrote:
> That all sounds great!
>
> > All of that seems a little bit complicated, but it avoids the
> > management of pth files in pyxpcom (I must be crazy).
>
> Can you elaborate here? A long time ago I went to some pain to
> allow .pth files in a local pyxpcom directory to be sniffed, so stuff
> could be dropped there and "just work". The idea is that you might
> be sharing a Python between many xulrunner apps, so you need a
> "local" path in addition to the "global" Lib/site-packages folder
> which have .pth files processed. Indeed, I can't see a good reason
> why easy_install/eggs shouldn't "just work" already from a Python
> distribution hosting pyxpcom (but I've never tried)
what I did is only useful if you use the pyxpcomext extension, not if
you have the pyxpcom extension inside xulrunner (there might be some
confusion here).
In pyxpcomext there is no site-packages or any site-dir except for the
pyxpcom dir which might be in an xpi file (zipped) and/or in your
profile, which makes it difficult to write into.
But there is this nifty feature: any pylib folder in an extension will
get added to sys.path, that doesn't mean they can process pth files,
but you can import from them.
All pyegg do is turn its own pylib dir into a site-dir and install
setuptools into it (and then wrap it a little bit). That's why you have
to use it unzipped.
As you know, you can do all of that with much less hassle if you
use pyxpcom inside xulrunner (you can install setuptools directly in the
pyxpcom folder and start from here, or just use pth files that point to
your modules).
>
> I'm interested to know if you are explicitly trying to *avoid* some
> of this behavior, and why? I would have thought that .pth files
> working is a *feature* rather than a liability :) Or quite possibly
> I'm not understanding something...
Of course having pth files in pyxpcom is nice :), i just tried to solve
another problem (in a quick and dirty way, and i get to play with
pyxpcom).
One of the use of this could be the following scenario:
You ship your app with only setuptools bundled in it.
In your python code you use (i don't remember the exact syntax):
import pkg_resources
pkg_resources.require("package-name==package-version")
If your packages are correctly registered with PyPi (or anything else,
it's a config option), at the first start setuptools will download and
install requirements and then keep them up to date (in theory :)).
hope it helps
lekma
ps: I might have missed or overlooked something, in which case I'd
welcome corrections/pointers/help of any kind.
>
> Cheers,
>
> Mark
>
_______________________________________________
pyxpcom mailing list
pyxpcom@[...].com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Thread:
Lekma
Todd Whiteman
Mark Hammond
Lekma
|