0

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!

2
  • 1
    THere is no simple way because setuptools doesn't have anything builtin to work with remote dependencies. But setup.py is 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. Commented Sep 13 at 15:34
  • I came to the same conclusion. Thanks for your feedback :) Commented Sep 13 at 15:52

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.