David Arnold wrote:
i'm in the middle of moving a package from using autoconf to distutils, and i'm having trouble finding a good way to do substitution of configured/discovered options into a template file.
in autoconf, i have a config.py.in file, which contains lines of the form
default_url = "@default_url@"
at configure time, the @foo@ values are replaced with real content, from --with-default-url options to configure, and various other discovered stuff.
the package is pure Python, so i have been able to just run install, which in turn ran build, and i don't really want to add a config step unless i have to.
i have played with sub-classing the build command, and adding a file copy and substitute step into the run command, but ...
has anyone else done something like this? any suggestions?
Python 2.1 uses the approach you describe for setup.cfg: it has a setup.cfg.in which then gets updated by configure to form the final setup.cfg file.
Would this be what you need ?