python - Generating cpps with Cython and then installing a C extension in one setup.py -
i have .cpp
s need generate .pyx
s , .pxd
s prior installing c/c++ extension in setup.py
(through pip local install-- pip install path/to/my_pkg
). used have .cpp
s generated separately, that's gotten annoying development , means have commit generated .cpp
s, bloat repo, , i'd rather not do.
i used generate cpp
s gen_cpp.sh
file so:
cython src/*.pyx src/*.pxd -a --cplus --include-dir ../
and once generated, i'd run setup.py install c/c++ extension so:
setup( name="mypkg", version="0.1.9", description="some description", author='me', author_email='me@me.com', url='http://www.myurl.com'', ext_modules = [ extension( "something", sources = glob.glob('src/*.cpp') + glob.glob('lib/b64/*.c'), include_dirs=['lib'], language = "c++", ) ] )
all want have gen_cpp.sh
file run through setup.py generate requisite cpps before rest of installation done, i'm running brick wall. can run gen_cpp.sh
subclassing install
in setuptools.command.install
:
class updateandinstall(install): def run(self): os.system("sh ./gen_cpp.sh") install.run(self)
but runs gen_cpp.sh
looking files in build directory, doesn't work. i've tried cd
ing current work directory in script prior doing anything, nothing gets me right place, , whole approach feeling hackier , hackier. how
Comments
Post a Comment