Ask HN: Advice for cross-platform dev environments for Python Extensions
I've been dipping my toes into extending Python with C/C++. I've experimented with ctypes, raw native Python C (#include <python.h>), and now I'm trying Pybind11.
My experience has been that setting up a development environment for this sort of thing is hell.
In the JetBrains line, PyCharm doesn't support C/C++ development, and CLion has limited Python support (I can't use Jupyter Notebooks in CLion for instance), and you can't use both IDEs on the same repo (Plus CLion is not free).
For Visual Studio, I'm actually pretty impressed with the python capabilities. Using the default MSBuild system, I can create a project that outputs a pyd file, and add a project with a Python file that has a reference to the pyd output directory, which works seamlessly. But the second I want to make it cross platform by using CMake, I can't add a reference to the output directory from the C++ project to the Python script. I thought to just append the output directory to the path, but then I can't differentiate between debug/release. And I'm sure mixed language debugging would be limited in CMake mode.
I haven't yet tried VS Code.
Does anyone have any tips or advice or best practices for setting up a cross platform C/C++ Python development environment?
No comments yet.