Invoking setup.py in sub-packages

F

Francesc

Hi,

I'd like to setup a package that is make of other sub-packages,
modules and other extensions. What I have is something like (this is
very simplified indeed):

<foo>/
__init__.py
setup.py
foo1/
__init__.py
foo1.c
[...]
foo2/
setup.py
__init__.py
foo2.c
[...]

Now, I'd like to make a setup.py for package 'foo' that is able to
compile the 'foo1' extension directly, but invoke 'foo2/setup.py' in
order to generate the 'foo2' sub-package (which contains an extension
itself).

I'm currently trying:

setup(name = "foo",
...
ext_modules = [ Extension( "foo.foo1", sources=["foo1.c"] ) ],
packages = ["foo.foo1", "foo.foo2"],
...
)

Of course, the foo2 package is not made at all. Is there a way to get
the 'foo2/setup.py' invoked automagically and generate the desired
extensions? Or all the instructions to generate the extension in
sub-packages have to be hard-wired in main 'foo/setup.py'?

Thanks!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top