From 1da5ee6412b1477d5e16d70cd55aedd3624c87f9 Mon Sep 17 00:00:00 2001 From: Nick Coghlan <@ncoghlan> Date: Fri, 16 Dec 2011 23:37:53 +1000 Subject: [PATCH] Move version number into a shared file read by both setup.py and docs/conf.py --- VERSION.txt | 1 + docs/conf.py | 7 ++++--- setup.py | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) create mode 100644 VERSION.txt diff --git a/VERSION.txt b/VERSION.txt new file mode 100644 index 0000000..2f45361 --- /dev/null +++ b/VERSION.txt @@ -0,0 +1 @@ +0.2 \ No newline at end of file diff --git a/docs/conf.py b/docs/conf.py index 8791d73..a660283 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -16,7 +16,7 @@ import sys, os # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. -#sys.path.insert(0, os.path.abspath('.')) +# sys.path.insert(0, os.path.abspath('..')) # -- General configuration ----------------------------------------------------- @@ -48,9 +48,10 @@ copyright = u'2011, Nick Coghlan' # built documents. # # The short X.Y version. -version = '0.1' +with open('../VERSION.txt') as f: + version = f.read().strip() # The full version, including alpha/beta/rc tags. -release = '0.1' +release = version # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/setup.py b/setup.py index a30c65c..1544eef 100755 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ from distutils.core import setup setup( name='contextlib2', - version='0.2', + version=open('VERSION.txt').read().strip(), py_modules=['contextlib2'], license='PSF License', description='Backports and enhancements for the contextlib module',