Move version number into a shared file read by both setup.py and docs/conf.py

This commit is contained in:
Nick Coghlan 2011-12-16 23:37:53 +10:00
parent 22bbb22d21
commit 1da5ee6412
3 changed files with 6 additions and 4 deletions

1
VERSION.txt Normal file
View file

@ -0,0 +1 @@
0.2

View file

@ -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.

View file

@ -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',