michael@d2m.at  |  +43 (664) 948-8084
You are here: Home Blog 2008 03 21 Running grokproject with an unreleased grok

Running grokproject with an unreleased grok

by Michael Haubenwallner last modified Jun 26, 2010 10:57 PM

Installing grokproject and creating a new project is straight forward.

Grokproject is a script that sets up a grok project directory, installs Zope 3 and grok and creates a template for a grok application.

By default your project is installed with the latest released version of grok (and its dependencies). This behaviour can be overridden by passing the '--version-info-url' option to specify the URL pointing to a custom versions file.

If you want to develop your project with the unreleased version of grok (svn trunk) there is no such 'version-info-url', you will need to do a few adjustments to your project instead:

  1. checkout the grok trunk to your project directory: svn co svn://svn.zope.org/repos/main/grok/trunk grok
  2. edit your projects 'buildout.cfg' file to make buildout accept the grok dev package instead of the already installed grok egg:
    1. change the 'develop' line to: develop = . grok
    2. comment out the 'extends' and 'versions' lines

Now in your project directory run 'bin/buildout' again.

If newer packages are needed by the grok trunk they are downloaded by 'buildout'. All paths are now set to include the grok package instead of the egg version. If you want to switch back to the released grok version, just undo the changes in 'buildout.cfg' and run 'bin/buildout' again.

I've tinkered with this setup for some days now, i thought about adding a new commandline option to grokproject to support the use of the grok trunk. But its just too easy to checkout a package and add a few characters to a file - so, i'll go with it for now.

Brandon Craig Rhodes has created this great page and screencast on buildout on his blog - don't miss it.

Btw, z3c.testsetup is definitely a must for your next grokproject project (just add it to your projects 'setup.py/install_requires' and run 'bin/buildout' again). 'z3c.testsetup' supports the most easy way of adding and running unit/functional doctests by enabling auto-discovery of testfiles by type and extension. I vote for including it with grok, for supporting OOTB testing without the need for writing setups.

 

Comment

Posted by d2m at 2008-03-26 17:31:04
Update: Peter Bengtsson today published this fine intro Writing tests, discovering and running them with z3c.testsetup for dummies on the grok.zope.org website

Comment

Posted by Peter Bengtsson at 2008-05-02 07:59:08
FYI, as of Grok 0.13 z3c.testsetup is going to be part of core Grok and it means two things:

1) No need to extend install_requires

2) Replace "z3c.testsetup" with "grok.testing" in your code.

Filed under: , , ,