Directory layout for a Python project with C extension modules

We have numerous projects in our organization that are mixed Python / C. We are currently trying to standardize the catalog layout for our projects and are trying to develop a convenient layout. One of the problems is where you can put the C extension modules in the tree.

We collect several options (relative to the root of the project):

./src/package/subpackage/module.c

or next to python modules in the package tree:

./package/subpackage/module.c

or in a directory srcin a subfolder:

./package/subpackage/src/module.c

One of the reasons for saving them from package directories may be due to the fact that this will lead to confusion, especially if there are other .c and .h files that are not modules themselves, but still need to be compiled. Also in the "integrated" scheme, what do you do with the headers and files that are used by more than one module? Put them in a top-level shared directory?

I would be interested to know what other people use, or if there are some advanced methods for this.

+5
source share
1 answer

, Python : trunk, SVN repo (net of branch & c), Modules .c .h, Lib - .py.

, , ( , Cython Pyrex, SWIG .., , , ), (, , ).

+1

All Articles