I have several python modules (organized into packages), which depend on each other. e.g.
Edit. First two options refer to Cython's specific code, what I've missed is that the question is about pure python modules, so option 3 is the solution.
There are a few options:
1. See this "How To Create A Hierarchy Of Modules In A Package": https://github.com/cython/cython/wiki/PackageHierarchy
2. I prefer the "include" statement: http://docs.cython.org/src/userguide/language_basics.html#the-include-statement I have many .pyx files and they are all included in main.pyx, it's all in one namespace. The result is one big module: http://code.google.com/p/cefpython/source/browse/cefpython.pyx
3. You can compile all your modules at once using setup by adding more than one "Extension":
setup(
cmdclass = {'build_ext': build_ext},
ext_modules = [Extension("example", sourcefiles), Extension("example2", sourcefiles2), Extension("example3", sourcefiles3)]
)
4. A more efficent compilation - see here.
setup (
name = 'MyProject',
ext_modules = cythonize(["*.pyx"]),
)