My mostly C++ project uses GitHub Actions for CI and to build release binaries. We target Windows, Ubuntu, and MacOS.
We use CMake as a meta-build system and SWIG to wrap our C++ to generate a Python API.
We use setup-python to control the version of Python in each Actions instance. Unfortunately, it seems that setup-python is focused on the ‘running Python’ use case instead of the ‘building with Python as a library’ use case.
In CMake, we use FIND_PACKAGE( PythonLibs ) to search for Python. According to the CMake documentation, we should set PYTHON_LIBRARY and PYTHON_INCLUDE_DIR as needed to specify a specific Python to find instead of searching for the main system one.
What is the best way to set these variables in Actions using setup-python?
We found the undocumented pythonLocation, but that seems to be only part of the answer.
Does anyone have an example of an Actions/CMake/SWIG/Python/C++ system that they can point to?
Thanks in advance.