python - Generating cpps with Cython and then installing a C extension in one setup.py -


i have .cpps need generate .pyxs , .pxds prior installing c/c++ extension in setup.py (through pip local install-- pip install path/to/my_pkg). used have .cpps generated separately, that's gotten annoying development , means have commit generated .cpps, bloat repo, , i'd rather not do.

i used generate cpps 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 cding current work directory in script prior doing anything, nothing gets me right place, , whole approach feeling hackier , hackier. how


Comments

Popular posts from this blog

javascript - How to get current YouTube IDs via iMacros? -

c# - Maintaining a program folder in program files out of date? -

emulation - Android map show my location didn't work -