[Cubicweb] CWEP 0004 - Cubes as distributions

Denis Laxalde denis.laxalde at logilab.fr
Thu Oct 23 08:56:39 CEST 2014

Hi Christophe,

Quoting http://hg.logilab.org/review/cwep/file/tip/CWEP-004.rst:

> The central idea is to use standard python packages as containers, and rely on
> entry-points to discover the cubes.

Does this mean that cubes will be install in site-packages? Something 
like "/usr/lib/python2.7/dist-packages/cubes/" on a system installation?

It seems to me that one of the "feature" of the current layout is that 
cubes are somehow private Python packages that are only meant to be used 
by a CubicWeb application.

The current layout probably has other advantages, it'd be nice if they 
could be listed along with drawbacks.

> This situation leads to several problematic situations, with no easy solution:
> -   If modules are imported from one cube to another, multiple values in
>     CUBES_PATH is not possible, because the root "cubes" directory is expected
>     to be in the PYTHONPATH.
>     This particular issue makes it difficult, if not impossible, to install
>     cubes system-wide (or in a virtualenv) and work on cubes in a work
>     directory.

This is the workflow I use most of the times, and it just works fine 
(most of the times ;)). Setting CW_MODE=user and 
CW_CUBES_PATH=~/src/cw/cubes, one can certainly use system-wide cubes 
along with cubes in the CW_CUBES_PATH, the latter being preferred in 
case of redundant installation. I sometimes went into little problems 
with this setup for testing (don't remember the details); so I wouldn't 
say it works perfectly, but this is certainly not "difficult" nor 

> -   The (unperfect but popular) "develop" mode of setuptools and pip does not
>     work. It can be worked around but it is a pain (See
>     http://lists.cubicweb.org/pipermail/cubicweb/2014-September/002160.html)

So the development mode does not work out of the box, but wouldn't it be 
possible to define a custom "develop" target that would make it work 
with the current layout (maybe setting the "install-dir" mentionned in 
the documentation). If this is related to the "private" status of cubes 
in the current layout that I mentioned above, do you know how other 
applications also using "private modules/package" work with this 
development mode (if they do)?

Denis Laxalde
Logilab         http://www.logilab.fr

More information about the Cubicweb mailing list