osqp / osqp-python

Python interface for OSQP
https://osqp.org/
Apache License 2.0
109 stars 41 forks source link

New 'compile_python_ext' argument for codegen. #71

Closed maxschaller closed 2 years ago

maxschaller commented 2 years ago

Users might want to generate code without compiling the python extension. One such case is when OSQP codegen is used within CVXPY codegen, and the CVXPY python extension is used for prototyping.

This PR introduces the argument compile_python_ext for the codegen methods. If True (default), the python extension is compiled. If False, all files related to the python extension are still rendered and the CMake project is still created. This way, advanced users can still compile the python extension by hand, for example by:

cd dir_name/src
python setup.py --quiet build_ext --inplace