My C++ library uses external dependencies, most of which are open source, but at least one of them is only available as cross-compiled binaries. In our CI workflow, we typically fetch the artifact that was compiled for a particular architecture, then link it.
I'm now working on Python bindings, and I started writing the setup.py file that compiles the shared library using CMake. Is it possible to achieve the same thing as the Github Action, namely to fetch the proper cross-compiled artifact from the dependency's repo automatically?
I read about the runtime_library_dirs and package_data options, but (all) the artifacts should be available locally. I also tried to give the path to the .tar.gz to install_requires, but that didn't work either (and it wouldn't pick the proper artifact automatically anyway).
Hope there's a way to do it!
setuptoolsdoesn't have anything builtin to work with remote dependencies. Butsetup.pyis just a Python script so you can program anything in it. Just download a version of the library for the current platform. Ask Python about the current platform:sys.platform,os.name,platform.architecture()and all platform functions.