[Cubicweb] Move sources to a sub-directory

Christophe de Vienne christophe at unlish.com
Mon Aug 25 16:58:23 CEST 2014

Hi everyone,

Studying how can pip / setuptools can make work on cubicweb easier, I 
hit a major problem : "pip install -e" (equivalent to "setup.py 
develop") will _not_ work.

It seems to me it is because the package files are directly in the root 
directory of the package.

To have "develop" working properly we need the sources to be in a 
directory named as the package, so that the project directory can be 
added in the python path.

For cubicweb for example, we would have :

     cubicweb/   <- all the python sources, including __pkginfo__.py

Additionnally, this layout would separated more clearly the packages 
sources, making the packages list easier to build (currently we need to 
specify manually which sub-packages need to be installed).

The main (and probably only) drawback such a change is the way you, at 
logilab, get all the sources of the projects to work on them, with 
guestrepo and a custom python path.

This can be workaround with a few symbolic links, so I do not think it 
is a blocking issue.

Once done, we would be able to make good use of pip and virtualenv to 
work on cubicweb and dependencies, by adding a "requirements.txt" at the 
root of grshell-cubicweb. Its content would look like :

    -e logilab/common
    -e logilab/database
    -e logilab/constraint
    -e logilab/mtconverter
    -e yams
    -e rql
    -e cubicweb

Starting to work with it would be like (I assume virtualenvwrapper is 

     mkvirtualenv --system-site-packages cubicweb
     pip install -r requirements.txt

Next times :

     workon cubicweb

Aside from theses 3 command lines, your current way of working on 
cubicweb would not change.

I am willing to propose patches for all the projects if that is what it 
takes, but I would like your feedback on this idea before.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cubicweb.org/pipermail/cubicweb/attachments/20140825/a307c884/attachment-0185.html>

More information about the Cubicweb mailing list