Friday, September 22

Having fun with setuptools

As already noted yesterday the CheeseShop is getting interesting for the common Zope folks. So I took the opportunity to play around a bit more with i18ndude and setuptools.

The result is a new i18ndude 2.1 release that is available as an egg from the CheeseShop. All you need to do, is to run easy_install i18ndude to get the latest version.

But while reading the setuptools documentation I found yet another useful feature which is called automatic script creation. Now I have developed on the MS Windows platform for quite some years and have always hated to have to write wrapper scripts around Python scripts myself in order to make them callable.

Now thanks to setuptools this step is automatically taken care of and an i18ndude.exe is created automatically if you easy_install i18ndude :)

But I was even more adventurous and tried out the integrated distutils support for building nice installers and found that I only had to type in a single command to get a nice Windows installer in addition to the egg build and have them automatically uploaded to the CheeseShop:

python setup.py register bdist_egg bdist_wininst upload -s

While you have to be on a Windows system to be able to create that installer, this is not harder than doing an tar.gz release.

So make sure to grab the new experimental installer for i18ndude 2.1.1 and report back any issues you find in the bug tracker.

If this turns out to be as easy as it looks like right now, you might find new installers for the various plone.* packages in the future as well. Now a way to register those releases on plone.org from the command line as well would be nice ;)

Thursday, September 21

Cheeseshop gets zopified

After reading Phillips blog post about the new framework categories for Zope 2 and 3 in the Cheeseshop I got to work and updated the i18ndude registration as well as pre-registered the plone.i18n and plone.app.i18n packages, so right now we have four packages registered for the two frameworks which are all around internationalization :)

For a nice short explanation how-to register a package in the Cheeseshop you should read Daniels blog post on the topic.

For those of you that have already upgraded to Subversion 1.4 you might find that setuptools does not work anymore.

If you see a AttributeError: 'NoneType' object has no attribute 'group' you want to try these steps (stolen from a post of Phillip J. Eby):
easy_install -eb. setuptools==dev06

This will create a setuptools subdirectory in the current directory. Then do:

cd setuptools
python2.4 setup.py install

If you haven't yet upgraded to Subversion 1.4 you can spare yourself this hassle and upgrade setuptools first ;)

Sunday, September 17

DZUG conference sprint 2006

Last week I have been in St. Augustin at a three days pre-conference sprint before the annual DZUG e.V. conference which extended into the two conference days as well. We had a room in the University of Applied Sciences Bonn-Rhein-Sieg where the conference took place, but thanks to the excellent organization of Nina Schütz all of us five sprinters shared an apartment in Cologne, where we soon discovered a free wireless network that allowed us to work all day long. In the evenings we familiarized ourselves with the local flavor of beer called Kölsch in quite some nice pubs and bars as well ;)

While I originally planned to polish up the last bits of my PLIP's for Plone 3.0 (CMF 2.1 and some i18n features) I had an idea the night before the sprint which I worked on instead.

If you have looked into Plone 2.5 you will have noticed the introduction of a new product called GenericSetup that is used to configure a Plone site. If you are not yet familiar with it, you should really learn about it by reading Rob Miller's excellent tutorial that is available on plone.org.

GenericSetup supports both setting up a site (a persistent Plone portal) from scratch through something called base profiles but also supports a concept of extension profiles that can be used to extend the configuration of a site after it has been created.

Now these extension profiles can be used for installation of add-on products that need to register new content types, workflows, actions, create tools or anything else an add-on product would like to do. But right now there is one essential thing missing for this kind of additional configuration: Uninstall support.

Right now we use CMFQuickInstallerTool to provide us with an easy way of installing add-ons and it has integrated support for recording the changes each individual product makes at install time, on which it's uninstall feature is based on. While this recording feature is far from perfect it handles at least 90% of the use-cases and has proven to be working quite well.

Now the most obvious thing is: Why don't we teach CMFQuickInstallerTool how to install add-on products based on extension profiles rather than through an external method?

After skimming through the code I realized that this is far easier than I would have imagined. So I spent the most part of the sprint working on this and had it fully functional at the end, including some nice test coverage. Right now you can find the code on a branch in the collective. It is tested with Plone 2.5 and Zope 2.9 only but should work for any supported combination of Plone 2.5 and up.

Please try it out and report back any issues you find. You just need to replace the CMFQuickInstallerTool with my branch, there are no additional dependencies. If everything goes as planned we might have this included in Plone 3.0 and eventually even in Plone 2.5.2+

As a personal note I might add that I begin to fall in love with sprint driven development. I think I begin to understand those developers out there that would like to see their life being a never-ending-sprint ;)

Sprintingly yours,
Hanno