I have a python script that outputs the program name, version number and the author when called with command line arguments like –help or –version. Currently this information is hardcoded in the python script itself. But I use distutils for building/packaging the application so all this information is already present in the setup.py. Is it possible to let distutils write metadata like version and author name/email to the built python script so I only need to maintain this data in the setup.py file? Or is there another standard mechanism to handle stuff like that?
Share
Do it the other way around. Add the version number, the author name and other metadata you need in the script to the script itself. Then
importorexecfile()the script insetup.py, and use the metadata defined in the script as arguments to thesetup()function.