diff --git a/MANIFEST b/MANIFEST index d040627..896e5b5 100644 --- a/MANIFEST +++ b/MANIFEST @@ -7,6 +7,7 @@ xlrd/biffh.py xlrd/compdoc.py xlrd/formatting.py xlrd/formula.py +xlrd/info.py xlrd/licences.py xlrd/sheet.py xlrd/timemachine.py diff --git a/setup.py b/setup.py index 262a5ec..13d7a9f 100644 --- a/setup.py +++ b/setup.py @@ -16,12 +16,17 @@ the_url = 'http://www.lexicon.net/sjmachin/xlrd.htm' +# Get version number without importing the whole package. +sys.path.insert(0, path.join(path.dirname(__file__), 'xlrd')) +from info import __VERSION__ +sys.path.pop(0) + def mkargs(**kwargs): return kwargs args = mkargs( name = 'xlrd', - version = open(path.join(path.dirname(__file__), 'xlrd', 'version.txt')).read().strip(), + version = __VERSION__, author = 'John Machin', author_email = 'sjmachin@lexicon.net', url = the_url, @@ -61,7 +66,6 @@ def mkargs(**kwargs): 'doc/*.htm*', # 'doc/*.txt', 'examples/*.*', - 'version.txt', ], }, diff --git a/xlrd/__init__.py b/xlrd/__init__.py index aeb6d29..ed51e45 100644 --- a/xlrd/__init__.py +++ b/xlrd/__init__.py @@ -1,7 +1,7 @@ # -*- coding: ascii -*- from os import path -__VERSION__ = open(path.join(path.dirname(__file__), 'version.txt')).read().strip() +from info import __VERSION__ #

Copyright (c) 2005-2012 Stephen John Machin, Lingfo Pty Ltd

#

This module is part of the xlrd package, which is released under a diff --git a/xlrd/info.py b/xlrd/info.py new file mode 100644 index 0000000..d1fb285 --- /dev/null +++ b/xlrd/info.py @@ -0,0 +1 @@ +__VERSION__ = "0.7.6" diff --git a/xlrd/version.txt b/xlrd/version.txt deleted file mode 100644 index c006218..0000000 --- a/xlrd/version.txt +++ /dev/null @@ -1 +0,0 @@ -0.7.6