On Oct 15, 11:59 am, Matt Feifarek <[email protected]> wrote:
> On Thu, Oct 15, 2009 at 12:10 AM, Ian Bicking <[email protected]> wrote:
>
> > I personally got too annoyed with testing and general interactivity
> > (there's a nose extension though, which I cribbed from -- but I never
> > actually got it to work myself).
>
> This process has been EXTREMELY annoying. I've spent many hours trying to
> get things to work that I should have been spending working on my project.
> Mostly, its my own ignorance of current magical techniques:

I'm not sold on the platform, either. It does seem to be a bundle of
limitations with a few features. But I suppose we have to get things
running on it to do a hands-on evaluation.

> I still don't get setuptools. I don't understand namespace packages, or
> rather their deployment. I don't get why I can't move (for example) paste,
> and the Paste* items to another directory that is ON sys.path and have it be
> import-able. All of my frustrations with GAE have been of this sort.

When you install eggs with easy_install, it adds the egg's path to
easy_install.pth. If you move the egg somewhere else, it won't work
unless it's added to the path somehow. BTW, I don't think GAE
uses .pth files, which is why sys.path manipulation is necessary.

When you install Paste packages with easy_install, they go into
separate eggs and in each one, paste/__init__.py has code that
modifies the path to make the namespacing work. It's not something
that just works because of setuptools. Took me a while to find that.

When you install them with pip, I think they overlap (i.e. one paste/
directory in site-packages/).

> And one cannot simply add things to sys.path because of setuptools.

I'm not sure what all the problems you're having with setuptools
entail, but my app.py *prepends* to sys.path, which works a little
better because it gets around installed versions of libraries in the
GAE environment.

Here's part of app.py:

sys.path = [appdir, libdir] + ['%s/%s' % (libdir, n) for n in
os.listdir(libdir) if n.endswith('.egg')] + sys.path

Performance would probably be better with a hard-coded list of
packages, but this is more flexible of course. On the other hand, I
think a switch to pip would make the listdir part unnecessary.

> My status: I can take a stock pylons application in a virtualenv, wedge-in
> the google libraries for yaml, datastore and the like, and run the app with
> paster serve. If one moves the pylons-required libraries from the standard
> site-packages to the GAE app's lib/python and add that location to sys.path,
> you're almost there. Hacking in some ENVIRONMENT variables at boot-strap
> time and you are there.

I use the GAE SDK instead of paster serve, because then all the GAE-
specific libs should be provided without moving anything. Can you use
datastore, etc, locally without the SDK?

> I didn't need to patch paste like Jason did, but maybe I'm missing
> something. I'll be writing up my new recipe asap.

Interesting. Maybe that step could be eliminated. I think I was
getting DistributionNotFound from pkg_resources and figured that it
would be better to work around eggs/the egg loader.

Jason
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to