I'm writing a Python package. The package needs to know its version number internally, while also including this version in the setup.py
script for distutils
.
What's the best way of doing this, so that the version number doesn't need to be maintained in two separate places? I don't want to import the setup.py
script from the rest of my library (that seems rather silly) and I don't want to import my library from the setup.py
script (likewise). Ideally, I'd just set a keyword in svn
and have that automatically substituted into the files, but that doesn't seem to be possible in svn
. I could read a common text file containing the version number in both places--is this the best solution?
To clarify: I want to maintain the version number in one place. Yes, I could put a variable in the package, and again in the setup.py
file. But then they'd inevitably get out of sync.