I'm writing a setup.py to install my package reboundx, which has a single dependency, rebound. My package builds an extension libreboundx.so that needs to link to librebound.so in setup.py
rebxExt = Extension('libreboundx', libraries=['rebound'], library_dirs = [rebound_path]...)
I'd like to be able to use install_requires in the setup(...) call to build the reboundx module to make sure the right version of rebound is installed. Is there any way to resolve the circularity?
If rebound is not installed, I would somehow need setuptools to detect this through install_requires, install rebound, and THEN find the right paths and build the extension libreboundx.so.
You should use the
setup_requiresargument tosetup(). From the docs,https://pythonhosted.org/setuptools/setuptools.html#new-and-changed-setup-keywords
Edit: It should create an egg directory for each entry in
setup_requires. However, I just tried this with rebound and it actually fails to build under easy install.