måndag 3 maj 2010

Plone dev on Snow Leopard, the real McCoy

I've got it down now. This is the way to set up your Snow Leopard for some serious Plone (>3.2) development. I work on Plone 3.3.5.

First, Get Xcode and MacPorts. Not entirely sure whether you need it with the instruction below, but it won't hurt unless you're really tight on disk space.

Now, don't even try to use any boiler plate Python-distributions for Mac OS X. The one that ships with Snow Leopard [SL] is of the wrong minor version, you need 2.4 and it's 2.6. The one that comes with Mac Ports doesn't work either because of some missing compiler directives, even though it's of the correct version. No, you have trust Florian to provide you with the Python-distro. Thus, in your directory of choice;

> svn co http://svn.plone.org/svn/collective/buildout/python/
> cd python

Next, you need easy_install for the native Python environment. You get it from http://peak.telecommunity.com/dist/ez_setup.py, and run;

> /usr/bin/python ez_setup.py

Now, use the SL native python interpreter (/usr/bin/python) to

> /usr/bin/python bootstrap.py

Next you build the python environment, but before you do that, take a look in buildout.cfg. Comment out or remove the lines with python25 and python26 if you don't explicitly want those. You don't need them for the purposes here.

> ./bin/buildout

After this step you have a Python distribution that will work for Plone. This is the Python that you'll have to use henceforth. You could set up your system path $PATH to point to this Python to not have to specifically point to it all the time.

> export MY_PYTHON=[the source directory]/python/python2.4
> export PATH=$MY_PYTHON/bin;$PATH

Next, get ZopeSkel;

> python-2.4/bin/easy_install -U ZopeSkel

And you're ready to go! The "paster" tool should be installed (try running "python-2.4/bin/paster create --list-templates"), which is the template engine for creating Plone things. From this point on, you have a working Python environment for working with Plone buildouts for your projects, which is currently the preferred way to do things. Feel free to dig into the tutorials at plone.org, e.g.

Creating a buildout for your project

Inga kommentarer: