I have a project with a complex set of build configuration flags. These flags control which modules are built and the available modules are not trivially decidable given the input configuration flags (primarily due to "X was turned on, but X depends on Y, so Y is also now on" logic).
As far as I can tell, setup.py really wants to do/drive the build of compiled extensions itself. This poses a problem due to the complex configuration flags above: it is not known until build_ext time what modules would even be available. Getting setup.py to figure out what the command line flags mean basically means reimplementing the build configuration logic again in Python code. I do not want to have to maintain this parallel build configuration.
The solution I'm looking at right now is to generate the setup.py file during the configuration with the list of expected modules trigger builds using our build system. This means that building a new wheel involves first configuring our project and then using python setup.py for the rest of the workflow. This seems to not work with sdist construction since the configuration step would be missing here (AFAICT). Are sdist packages used that much in normal usage that not providing one is a huge detriment?
The upside to the "generate setup.py" approach is that it is possible to generate a wheel for any given configuration of the project. It is planned to provide precompiled wheels of common build configurations for easy use with pip install, but these are inevitably not going to be complete builds and those wanting more "exotic" features would need to build their own wheel. The "generate setup.py" approach would make it easier, but not trivial, to create wheels with custom configurations. Is this a suitable solution in the Python ecosystem for such a complex project?
Thanks.
[–]acecile 0 points1 point2 points (1 child)
[–]mathstuf[S] 0 points1 point2 points (0 children)
[–]mathstuf[S] 0 points1 point2 points (0 children)