conan-io / conan

Conan - The open-source C and C++ package manager
https://conan.io
MIT License
8.3k stars 986 forks source link

[question] Using Conan in cPython package builds, Conan enabled build-backend #17246

Open SoShiny opened 4 weeks ago

SoShiny commented 4 weeks ago

What is your question?

Question

Is there a (or plan to create a) Conan-enabled Python build-backend compliant with PEP 517, or any other initiative to bring Conan's power to Python's packaging universe?

Context

For our product, we need to build several cPython extension modules from source with consistent C/C++ library dependencies. For example, we want to make sure that we use the same BLAS libraries for numpy, and other numerical packages.

We use Conan to model the dependencies and to generate the correct environment in which we can build the packages using their native build commands. The steps needed vary drastically from package to package and can be as simple as setting an environment variable to the location of some library in the Conan cache, and as complex as patching the package's setup.py and various bundled CMake find-package modules.

Python's dependency modelling with pip and friends just stops at the level of the C/C++ dependencies of extension modules and it has all sorts of issues in projects with many complicated extensions loaded into the same interpreter.

Have you read the CONTRIBUTING guide?

memsharded commented 4 weeks ago

Hi @SoShiny

Thanks for your question.

At the moment there is nothing, and it is not planned. It sounds something that can be interesting, and we have known about users that are doing their own Python wrappers around C and C++ libraries managed with Conan, but didn't request so far something like this.

I don't think this can be prioritized from our side, at least in the short term (there are some other pending important priorities like the workspace feature), but to be honest I have no idea about the necessary effort or the complexity of the task either. But if there is enough interest from users that want to contribute, then we will try to support that.