Skip to content

Commit b50bbd0

Browse files
author
David Marteau
committed
Fix version import in setup.py
1 parent 515787b commit b50bbd0

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

pylr/__init__.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@
88
99
'''
1010

11-
__version_info__=(0,1,2)
12-
__version__ = "{0}.{1}.{2}".format(*__version_info__)
13-
11+
from .version import __version_info__, __version_info__
1412

1513
from .parser import (BinaryParseError,
1614
BinaryVersionError,

pylr/version.py

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
2+
3+
__version_info__=(0,1,2)
4+
__version__ = "{0}.{1}.{2}".format(*__version_info__)

setup.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,13 @@
1919
install_requires = ['bitstring']
2020
kwargs['install_requires'] = install_requires
2121

22-
version=__import__('pylr').__version__
22+
23+
def get_version():
24+
local_vars = {}
25+
exec(open('pylr/version.py'),{},local_vars)
26+
return local_vars["__version__"]
27+
28+
version = get_version()
2329

2430
setup(
2531
name="pylr",

0 commit comments

Comments
 (0)