I have a fairly involved setup.py cython compilation process where I consider multiple things such as openMP support and the presence or absence of C headers. Specifically, FFTW is a library that computes the FFT, and is faster than numpy's FFT, so if fftw3.h is available, I compile my module against that, otherwise I fallback onto numpy.
I would like to be able to remember how the package was compiled i.e. did the compiler support openMP and which FFT library was used. All this information is available when running setup.py but not later on and can be useful e.g. if the user would like to run a function using multiple cores, but openMP was not used during compilation, everything will run on one core. Remembering this information would allow me to show a nice error.
I am unsure what the best way to do this would be. There are plenty of options such as writing a file with the data and then reading it when necessary, but is there any standard way to do this? Basically, I'm trying to emulate numpy's show_config, but am unsure what the best way to do this would be.
I have not attempted this, but my suggestion would to mimic the config.h-behavior one sees with autotools-based building: your setup.py generates a set of definitions that you either invoke via commandline or use via a generated header file - and then you can use this to feed e.g. a compiled extension function to return an approriate data-structure. But whatever you do: I have not come across a standardized way for this.
Saving Python package setup configuration for later use