[Grok-dev] Re: zc.sourcefactory
Philipp von Weitershausen
philipp at weitershausen.de
Mon Sep 3 06:26:58 EDT 2007
On 3 Sep 2007, at 11:20 , Jan Ulrich Hasecke wrote:
> Am 03.09.2007 um 10:26 schrieb Philipp von Weitershausen:
>> On 3 Sep 2007, at 10:22 , Jan Ulrich Hasecke wrote:
>>> Is zc.sourcefactory a default part of grok?
>>> I get an ImportError.
>>> ImportError: No module named sourcefactory.basic
>>> If it is not installed by default, how do I install it? Are there
>>> any howtos?
>> There aren't, but it'd be cool if someone could write one down.
>> Basically, by importing zc.sourcefactory in your code, you
>> introduce a *dependency*. Dependencies are managed in setup.py. So
>> edit setup.py and add 'zc.sourcefactory' to the install_requires
>> list. Then run bin/buildout again. It will download and install
>> zc.sourcefactory now.
>> This is, by the way, how all of the Zope packages are installed
>> automatically. Your package depends on 'grok' and 'grok' depends
>> on various 'zope.*' packages. buildout simply makes sure that all
>> the dependencies are installed.
> I would write a howto, but first of all I plead to call buildout sid.
> I get this error while calling buildout in my grokproject:
> Error: There is a version conflict.
> We already have: ZODB3 3.9.0-dev-r77011
> but grok 0.10 requires 'ZODB3==3.8.0b2'.
Hrmpf. Now I know why I objected to fixed version dependencies in
Anyway, setuptools's and zc.buildout's version dependency mechanism
is rather, uhm, dull. It wants to install zc.sourcefactory which
depends on ZODB3. So it tries to get the newest ZODB3 possible. Then
it wants to install grok which depends on a very specific ZODB3
A workaround is to tell buildout to only ever chose one particular
ZODB3 version. Add the following section to your buildout.cfg::
ZODB3 = 3.8.0b2
And in the [buildout] section, refer to it::
versions = versions
Then run bin/buildout again. It shouldn't break now (I've tested it).
More information about the Grok-dev