I recently switched from Ubuntu to OSX. It was easy to get going with app engine development, but it was hard to downgrade my development environment to python 2.5 (used by app engine). Here's how I got things set up:
Install python 2.5
Here's the link: http://www.python.org/ftp/
When installing, I unchecked all of the configuration options, save the framework itself. I was worried about screwing up my system's python 2.6 installation (needlessly? I don't really want to find out. I have no use for python 2.5 outside of app engine development.).
Install a 2.5 virtualenv
I already had virtualenv installed. If you don't, run the command: easy_install virtualenv
Next, I created a python 2.5 virtual environment for app engine, and made it more convenient to boot up the environment:
virtualenv --no-site-packages -p /System/Library/Frameworks/
ln -s /usr/local/gae-virtual-env/
Now, to activate the environment, I can run
source activate-gae-env
Set up the environment:
I use nose for testing, with the nose-gae testing add-on (which is very convenient, but finicky, in my experience). After I activated my virtual environment, I ran this:
pip install nose nosegae webtest
Notes on testing:
One note on testing: I have to run nosetests with the --without-sandbox flag, otherwise I run into import errors. This sucks, but one can hope for the future.
Another note on testing: the App Engine installer for OSX offers to create handy symlinks in /usr/local/bin. Sounded great, so I did it. However, this broke my nose-gae tests, as app engine ships with two different files called "dev_appserver.py". The symlinks prevented the testing software from finding the appropriate dev_appserver. Don't do it! Or, rename dev_appserver to something ... unique.
Do you have a better approach? As a Mac n00b, I'd love to hear about how you're developing App Engine code.
Another note on testing: the App Engine installer for OSX offers to create handy symlinks in /usr/local/bin. Sounded great, so I did it. However, this broke my nose-gae tests, as app engine ships with two different files called "dev_appserver.py". The symlinks prevented the testing software from finding the appropriate dev_appserver. Don't do it! Or, rename dev_appserver to something ... unique.
Do you have a better approach? As a Mac n00b, I'd love to hear about how you're developing App Engine code.

If you are using Virtualenvtools, this command might be nicer for creating the environment:
ReplyDelete$ mkvirtualenv gae --no-site-packages --distribute --python /System/Library/Frameworks/Python.framework/Versions/2.5/Resources/Python.app/Contents/MacOS/Python
$ workon gae