Google Mail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
New Pylons on AppEngine article in wiki
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  10 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Follow-up To:
Add Cc | Add Follow-up to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers that you hear
 
Matt Feifarek  
View profile   Translate to Translated (View Original)
 More options 17 Oct, 02:42
From: Matt Feifarek <matt.feifa...@gmail.com>
Date: Fri, 16 Oct 2009 20:42:49 -0500
Local: Sat 17 Oct 2009 02:42
Subject: New Pylons on AppEngine article in wiki

http://wiki.pylonshq.com/display/pylonscookbook/Pylons+Running+on+Goo...

This how-to tries to get Pylons running on GAE with as little customization
to the Pylons App as possible.

In other discussions on this mailing list, I've heard that this isn't a good
idea, but I wanted to get this "out there" for discussion.

Thanks to Jason S. for his write-up here:
http://countergram.com/articles/pylons-google-app-engine/
(discussed here:
http://groups.google.com/group/pylons-discuss/browse_thread/thread/e7...
)

And to Mike and Ian for their continued help and advice.

So, what do we think about this? It's pretty close to Jason's work, but
slightly different in that no patch to Paste is required, and since I use
pip rather than easy_install, things work out a little differently for
sys.path. Also, I have managed to get the DataStore working on the local
standard Pylons install.


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Matt Feifarek  
View profile   Translate to Translated (View Original)
 More options 22 Oct, 18:57
From: Matt Feifarek <matt.feifa...@gmail.com>
Date: Thu, 22 Oct 2009 12:57:19 -0500
Local: Thurs 22 Oct 2009 18:57
Subject: Re: New Pylons on AppEngine article in wiki

I would love a little feedback on this...  Bump ;-)

On Fri, Oct 16, 2009 at 8:42 PM, Matt Feifarek <matt.feifa...@gmail.com>wrote:


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
reco  
View profile   Translate to Translated (View Original)
 More options 29 Oct, 20:19
From: reco <r...@nex9.com>
Date: Thu, 29 Oct 2009 13:19:32 -0700 (PDT)
Local: Thurs 29 Oct 2009 20:19
Subject: Re: New Pylons on AppEngine article in wiki
hi matt

just tried the wiki page
i got the following probs:

  File "lib/setuptools-0.6c11-py2.5.egg/pkg_resources.py", line 24, in
<module>
    from os import utime, rename, unlink, mkdir
ImportError: cannot import name mkdir
INFO     2009-10-29 19:56:30,793 dev_appser

reco

On Oct 22, 1:57 pm, Matt Feifarek <matt.feifa...@gmail.com> wrote:


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Matt Feifarek  
View profile   Translate to Translated (View Original)
 More options 1 Nov, 17:06
From: Matt Feifarek <matt.feifa...@gmail.com>
Date: Sun, 1 Nov 2009 12:06:44 -0500
Local: Sun 1 Nov 2009 17:06
Subject: Re: New Pylons on AppEngine article in wiki

On Thu, Oct 29, 2009 at 3:19 PM, reco <r...@nex9.com> wrote:
> just tried the wiki page
> i got the following probs:

>  File "lib/setuptools-0.6c11-py2.5.egg/pkg_resources.py", line 24, in
> <module>
>    from os import utime, rename, unlink, mkdir
> ImportError: cannot import name mkdir
> INFO     2009-10-29 19:56:30,793 dev_appser

Yeah, I'm now getting this too. I think that the 1.2.7 release of GAE broke
this. I'm going to look into it.

This is the kind of thing I'm worried about with trying to hack our way into
running GAE apps on Paster. Everything works fine, then Google does
something mysterious and then a fundamental breakage occurs.

I'm going to see if I can figure this out, but I think that we should take
Ian Bicking's advice and put our efforts into getting the Pylons stack
running on the dev appserver from Google.


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mike Orr  
View profile   Translate to Translated (View Original)
 More options 1 Nov, 18:02
From: Mike Orr <sluggos...@gmail.com>
Date: Sun, 1 Nov 2009 10:02:36 -0800
Local: Sun 1 Nov 2009 18:02
Subject: Re: New Pylons on AppEngine article in wiki

mkdir is one of those operations that's prohibited on App Engine.  The
development server is faithfully mimicking the production server in
this regard.  Appengine Monkey puts stub functions into the os module
to make this work.  (You can't actually create a directory, but you
can import a module that imports the functions.)  I don't know how
Google implemented support for Setuptools, whether they did it this
way or not.

So the question is, what's the difference between Matt's code and the
appengine-homedir code that accounts for this exception?

This is why I wish Pylons/Paste didn't use Setuptools at runtime,
because it's hard to trace why things like this are happening.  I
think runner.py in appengine-homedir instantiates the application and
HTTPServer manually, bypassing pkg_resources precisely to avoid
problems like this.

Also, make sure you're not using an old Appengine SDK.

--
Mike Orr <sluggos...@gmail.com>


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jason S.  
View profile   Translate to Translated (View Original)
 More options 1 Nov, 18:12
From: "Jason S." <jas...@tuffmail.com>
Date: Sun, 1 Nov 2009 10:12:23 -0800 (PST)
Local: Sun 1 Nov 2009 18:12
Subject: Re: New Pylons on AppEngine article in wiki
On Oct 29, 2:19 pm, reco <r...@nex9.com> wrote:

>   File "lib/setuptools-0.6c11-py2.5.egg/pkg_resources.py", line 24, in
> <module>
>     from os import utime, rename, unlink, mkdir
> ImportError: cannot import name mkdir
> INFO     2009-10-29 19:56:30,793 dev_appser

Actually, the latest setuptools is what changed. There didn't used to
be a specific import of mkdir.

I solved it in my app.py by setting os.mkdir to a value before
importing anything else. Hackish, but it works fine. This leaves you
open to breakage from something else the next time you upgrade any
third-party deps, of course. But an attempt to preemptively handle all
such errors would itself be prone to breakage if the supported set of
modules/functions changed in the future, so it's probably better just
to spread the idea of setting such functions equal to a value before
other imports that use them.

As for what will raise errors, the GAE Python runtime docs make the oh-
so-helpful statement that "the os module is available, but with
unsupported features disabled," without mentioning exact function
names. I generated a list, though, and it's pretty long. Another issue
is that while some will raise ImportError/AttributeError (e.g.
os.mkdir), others will import fine but not work (tempfile.mkstemp).

Has anyone published a list of standard library functions that result
in ImportError/AttributeError when accessed under GAE?  Otherwise, I
might create an automated process for locating them dynamically, for,
eh, fun or something.

Jason


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mike Orr  
View profile   Translate to Translated (View Original)
 More options 2 Nov, 03:45
From: Mike Orr <sluggos...@gmail.com>
Date: Sun, 1 Nov 2009 19:45:20 -0800
Local: Mon 2 Nov 2009 03:45
Subject: Re: New Pylons on AppEngine article in wiki

On Sun, Nov 1, 2009 at 10:12 AM, Jason S. <jas...@tuffmail.com> wrote:

> On Oct 29, 2:19 pm, reco <r...@nex9.com> wrote:

>>   File "lib/setuptools-0.6c11-py2.5.egg/pkg_resources.py", line 24, in
>> <module>
>>     from os import utime, rename, unlink, mkdir
>> ImportError: cannot import name mkdir
>> INFO     2009-10-29 19:56:30,793 dev_appser

> Actually, the latest setuptools is what changed. There didn't used to
> be a specific import of mkdir.

This is an App Engine bug then and should be raised on is issue
tracker.  They specifically made App Engine compatible with
Setuptools, so they;'re probably not aware the latest version broke.
(They don't use Setuptools themselves.)

> This leaves you
> open to breakage from something else the next time you upgrade any
> third-party deps, of course.

This is one of the general limitations of App Engine.  It works best
with packages that are written for it, or at least don't do any disk
I/O.

> As for what will raise errors, the GAE Python runtime docs make the oh-
> so-helpful statement that "the os module is available, but with
> unsupported features disabled," without mentioning exact function
> names. I generated a list, though, and it's pretty long. Another issue
> is that while some will raise ImportError/AttributeError (e.g.
> os.mkdir), others will import fine but not work (tempfile.mkstemp).

> Has anyone published a list of standard library functions that result
> in ImportError/AttributeError when accessed under GAE?  Otherwise, I
> might create an automated process for locating them dynamically, for,
> eh, fun or something.

There is probably a list somewhere.  If not, you can write a quick
webapp to test all of them.  I don't think they'll be changing the
list.  They're pretty smart about backward compatibility, which is why
runtime version 1 is sticking with Python 2.5.

--
Mike Orr <sluggos...@gmail.com>


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mike Orr  
View profile   Translate to Translated (View Original)
 More options 2 Nov, 03:50
From: Mike Orr <sluggos...@gmail.com>
Date: Sun, 1 Nov 2009 19:50:23 -0800
Local: Mon 2 Nov 2009 03:50
Subject: Re: New Pylons on AppEngine article in wiki
The main Pylons-Appengine article needs a rewrite to include all this
new research and findings.  If something works for you and you've
tested it, it's worth featuring.  We need to keep the current advice
in one central place so it doesn't get lost.  If you're unsure about
your approach, it's still worth mentioning; just list what you're
unsure about so the reader can make up their own mind.

http://pylonshq.com/appengine

Anybody care to update it?

--
Mike Orr <sluggos...@gmail.com>


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Matt Feifarek  
View profile   Translate to Translated (View Original)
 More options 2 Nov, 23:12
From: Matt Feifarek <matt.feifa...@gmail.com>
Date: Mon, 2 Nov 2009 17:12:35 -0600
Local: Mon 2 Nov 2009 23:12
Subject: Re: New Pylons on AppEngine article in wiki

On Sun, Nov 1, 2009 at 11:06 AM, Matt Feifarek <matt.feifa...@gmail.com>wrote:

Actually, it turns out I have a *different* error; I'm getting a problem
with os.makedirs. I patched it thusly in my runpylons.py:

# fix the setuptools bug introduced in GAE 1.2.7
def dummyfunc(*args, **kwargs):
    pass
os.makedirs = dummyfunc

That allows the app to be run under the dev_appserver. Reco, what version of
the SDK are you running when you have this problem?


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
pyshao  
View profile   Translate to Translated (View Original)
 More options 6 Nov, 08:13
From: pyshao <pys...@gmail.com>
Date: Fri, 6 Nov 2009 00:13:27 -0800 (PST)
Local: Fri 6 Nov 2009 08:13
Subject: Re: New Pylons on AppEngine article in wiki
i just modified the code in file appengine_monkey.py, add a line of
code after line 37:

Missing.patch(os, 'mkdir')

because of the implementation of Ian Bicking's "filesystem.py" module,
i think, it works.
but i do not know the risk behind that change, someone knows?

On Nov 3, 12:12 am, Matt Feifarek <matt.feifa...@gmail.com> wrote:


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google