Daniel Nouri's Blog

Wed, 28 Feb 2007

FOSDEM 2007

Last weekend, I went to my first FOSDEM (video recordings). I took my girlfriend with me, which I believe helped her understand my nerdy side better. ;-)

Paul Everitt did a nice presentation on Plone 3, where he showed how you set up a Plone 3 instance using ploneenv, and then an easy example of using KSS, and some other Plone 3 niceties. The ploneenv screencast is available now, and so is the rest of the screencasts that Paul demos at the presentation.

Paul was followed by Dries Buytaert's Drupal presentation, which was also really good. It was more a demo of what Drupal is and what it can do for the end user, as opposed to how you can develop for the platform and some legal background, which Paul concentrated on.

Unfortunately, I missed the OLPC talk, but nevertheless I was able to get my hands on one of those laptops, and they really do look cool.

Elixir, a library built on top of SQLAlchemy that's recently gone into beta, looks like a very convenient way to talk to relational databases.

Amazing how a conference with so many good talks can be totally free. Next FOSDEM? I'll be there...

Update: Added a link to the ploneenv screencast.

posted at: 21:34 | 0 comments | category: /devel rss | permanent link | add to del.icio.us or digg it

Mon, 26 Feb 2007

Baarn Sprint 2007

/media/baarn-2007.jpg

This year's Baarn sprint was way cool! And we got a lot of stuff done.

I really like the multi-cultural aspect to Plone sprints. Where else do you get to meet and work face to face with people from Norway, the Netherlands, Scotland, Great Britain, Germany, United States, Hungary, Belgium, Finland and Austria in the course of a couple of days?

Seeing some people that I've never met in real life before was very nice, too. That'll help with communicating with those people through IRC and mailing lists.

Thanks everyone for a fantastic time! I'm totally looking forward to the Sorrento sprint, where over 60 people are expected!

posted at: 21:50 | 0 comments | category: /devel/zope rss | permanent link | add to del.icio.us or digg it

Fri, 16 Feb 2007

ploneenv recipes

I've updated the experimental Plone 3.0 setuptools distribution and ploneenv today a bit and fixed some bugs along the way.

Here are some small recipes that show you how ploneenv works, and how you can make use of it.

A requirement for all of these recipes is that you have ploneenv installed, which you can install like this:

sudo easy_install ploneenv

The recipes will also assume that you have two shell variables set. One is MKZO, the path to the mkzopeinstance.py script of your Zope 2.10 installation. The other is INSTANCE_HOME, the folder where you want your Zope instance to go into. This is an example of setting those variables:

MKZO=~/lib/Zope-2.10/bin/mkzopeinstance.py
INSTANCE_HOME=~/myplone3.0

Create a pristine Zope instance

Goal

You want to create a pure Zope instance, in which you can use tools like easy_install and yolk to manage Python packages and install Products the usual way.

Recipe

Use this command:

ploneenv $INSTANCE_HOME -m $MKZO --no-requirements
What this does

Calling ploneenv with --no-requirements will create a blank Zope instance that's also a workingenv. This method of installation is perfectly compatible with Plone 2.5 or other Products!

To install packages from the Cheese Shop, you must first activate the environment and then use easy_install, like this:

source $INSTANCE_HOME/bin/activate
easy_install yolk

This will install yolk, a tool that provides a lot of useful functions for querying the metadata of installed setuptools packages and querying the Cheese Shop. For example, if you want a list of all packages that are installed in your Zope instance, run:

yolk -l

Create an instance with Plone 3 from Subversion in it

Goal

You want to try out Plone's latest development version straight from Subversion.

Recipe

Follow the steps from Create a pristine Zope instance and then, after having activated the instance's environment via source $INSTANCE_HOME/bin/activate, do:

easy_install Plone==dev
What this does

This will download and install Plone's current development version. This way you can experience the latest and greatest (and potentially most unstable) Plone.

Create an instance with a Plone 3 release in it

Goal

You want to create a Zope instance with the latest Plone 3 release in it.

Recipe

Use this command:

ploneenv $INSTANCE_HOME -m $MKZO
What this does

This will install the latest Plone version from the Cheese Shop. Right now this is 3.0-r12165, an experimental and arbitrary snapshot of Plone 3 dating back to the 4th of February. Note that it's not related to the real Plone 3.0a2 release, which is the latest official release of Plone 3 and what you normally want to use.

Develop packages for Plone 3

Goal

You want to develop a package for Plone 3.0. We'll call this package mypackage.

Recipe

Follow the steps in Create an instance with Plone 3 from Subversion in it.

Install ZopeSkel and create your package if you haven't one already:

easy_install ZopeSkel
paster create -t plone mypackage

Activate your instance's environment if you haven't yet and install your package in development mode:

source $INSTANCE_HOME/bin/activate
cd mypackage
python setup.py develop
What this does

You are encouraged to create your new Plone 3 modules outside of the Products directory/package. ZopeSkel helps you with quickly setting up a distribution.

Invoking python setup.py develop inside of your newly created project will install your package in development mode.

There are good reasons to still use Products. When you develop a Product, just link it into your instance's Products directory as usual.

Note that you can override Products or packages that come with Plone this way, which enables you to develop parts of Plone itself.

Status quo

Plone 3.0, ploneenv and the Plone egg distribution are under heavy development still. Therefore you might encounter errors while trying out these recipes. Please report those!

There is one known problem with ploneenv, where easy_install attempts to compile Script (Python) files and spews a lot of error messages. However, those error messages are not critical, and the installation succeeds nevertheless.

If you're developing Plone 3 itself, you might want to go for ploneout, which is the mechanism used by most Plone developers who actively develop Plone.

My previous blog on ploneenv has some more pointers and info.

Update: Thanks to Paul Everitt, there is now a ploneenv screencast.

posted at: 19:35 | 2 comments | category: /devel/zope rss | permanent link | add to del.icio.us or digg it

Sat, 03 Feb 2007

ploneenv, or YAWTSUYP (yet another way to set up your Plone)

What is ploneenv?

ploneenv builds a Zope instance that is also a workingenv and installs (by default) Plone 3.0 in it.

There are other packages out there that can do the same:

The most prominent of these packages is ploneout, a Zope Buildout configuration (including add-ons) that allows you to install Zope and Plone 3.0 in one step. While this is a very appealing solution in most situations, sometimes it is more comfortable for a developer to work more interactively, in an environment where packages can be installed and tested out, removed, replaced and queried using the standard easy_install and tools like Yolk.

So what is ploneenv? ploneenv is a one module Python script that builds heavily on workingenv and setuptools. What it does:

  • It creates a Zope instance for you. You always provide the mkzopeinstance.py script that you want to use as an argument. E.g.:

    ploneenv ~/myzopeinstance --mkzo=~/lib/Zope-2.10/bin/mkzopeinstance.py
    
  • It creates a workingenv in the Zope instance for you.

  • It installs the Plone egg by default. However, you could just as well install something else in your new Zope instance using the --requirements argument. ploneenv is not Plone specific.

These steps are quite similiar to what you do manually when you make your Zope instance a workingenv.

Give me some examples

This is how you use ploneenv to install Plone:

easy_install ploneenv

MKZO=~/lib/Zope-2.10/bin/mkzopeinstance.py
INSTANCE_HOME=$HOME/myplone30

ploneenv $INSTANCE_HOME -m $MKZO

At this point, you can install any extra packages. This would install simplegeneric:

source $INSTANCE_HOME/bin/activate
easy_install simplegeneric

Old-style Products that aren't wrapped in eggs are installed as usual:

cd $INSTANCE_HOME/Products
wget http://plone.org/products/ploneformgen/releases/1.0.3/ploneformgen_1-0-3.tgz
tar xzfv ploneformgen_1-0-3.tgz

You can also override Products that come with Plone. For example, you could set a symlink from your local CMFPlone checkout into the $INSTANCE_HOME/Products directory and hack away.

To use a local SVN checkout to develop an existing or new new-style Plone package, you would simply do:

cd ~/myproject
python setup.py develop

Note that except for the activation of the environment, this is exactly how you would install a package for development in Python (=setuptools). That is, this is not ploneenv nor workingenv specific.

Try it out!

Please try it out and give me feedback. As mentioned before, this is all you need to type:

easy_install ploneenv

MKZO=~/lib/Zope-2.10/bin/mkzopeinstance.py
INSTANCE_HOME=$HOME/myplone30

ploneenv $INSTANCE_HOME -m $MKZO

That's it! Just make sure that you set the MKZO and INSTANCE_HOME according to where your mkzopeinstance.py script is and where you want to create your instance respectively.

Now you can start Zope using $INSTANCE_HOME/bin/zopectl fg.

What's inside the Plone egg and why

The Plone egg goes back to some early experiments I did to package Plone. Plone is a meta-package that has a Products namespace and currently all old-style Products that Plone requires contained in it. On top of that, it defines a number of requirements, like elementtree and plone.openid.

By not mixing installation code with the package itself, the Plone egg makes sure that it can be installed in any context, for example in a ploneout.

If the CMF were to became available as an egg, Plone would remove it from its own contents and just define another requirement.

The tagged and released Plone egg (or bundle, if you like) should arguably not have svn externals that point to other Products' SVN trunks. Instead it should either use svn externals to SVN tags of Products where possible or include the Product itself if it's not maintained in subversion. This might seem a bit hacky, and Rocky says I'm cheating, but it effectively brings the Plone package more inline with other Python packages out there, with all the benefits that this brings. IMO, this should be the way to release Plone 3.0.

Discussion happens on the Plone development list.

Update: I've updated this entry to reflect the fact that ploneenv and Plone are now in the Cheeseshop, so the installation becomes a lot easier.

Update: I've retired ploneenv in favour of repoze (especially repoze.plone). repoze is what ploneenv wanted to be, and more.

posted at: 21:45 | 0 comments | category: /devel/zope rss | permanent link | add to del.icio.us or digg it


< February 2007 >
SuMoTuWeThFrSa
     1 2 3
4 5 6 7 8 910
11121314151617
18192021222324
25262728   

Feed of all categories: rss rss | atom

Categories: