Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import version number from a .py file rather than reading a .txt file. #5

Merged
merged 2 commits into from Apr 13, 2012
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions MANIFEST
Expand Up @@ -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
Expand Down
8 changes: 6 additions & 2 deletions setup.py
Expand Up @@ -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,
Expand Down Expand Up @@ -61,7 +66,6 @@ def mkargs(**kwargs):
'doc/*.htm*',
# 'doc/*.txt',
'examples/*.*',
'version.txt',
],

},
Expand Down
2 changes: 1 addition & 1 deletion 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__

# <p>Copyright (c) 2005-2012 Stephen John Machin, Lingfo Pty Ltd</p>
# <p>This module is part of the xlrd package, which is released under a
Expand Down
1 change: 1 addition & 0 deletions xlrd/info.py
@@ -0,0 +1 @@
__VERSION__ = "0.7.6"
1 change: 0 additions & 1 deletion xlrd/version.txt

This file was deleted.