File tree Expand file tree Collapse file tree 2 files changed +31
-1
lines changed
Expand file tree Collapse file tree 2 files changed +31
-1
lines changed Original file line number Diff line number Diff line change 1+ import io
2+ import os
13from setuptools import setup, find_packages
24import sys
35
911if sys.version_info < (3, 4):
1012 install_requires.append('enum34')
1113
14+
15+ def local_file(*name):
16+ return os.path.join(
17+ os.path.dirname(__file__),
18+ *name)
19+
20+
21+ def read(name, **kwargs):
22+ with io.open(
23+ name,
24+ encoding=kwargs.get("encoding", "utf8")
25+ ) as handle:
26+ return handle.read()
27+
28+
29+ # This is unfortunately duplicated from scripts/cosmic_ray_tooling.py. I
30+ # couldn't find a way to use the original version and still have tox
31+ # work...hmmm...
32+ def read_version(version_file):
33+ "Read the `(version-string, version-info)` from `version.py`."
34+ local_vars = {}
35+ with open(version_file) as handle:
36+ exec(handle.read(), {}, local_vars) # pylint: disable=exec-used
37+ return (local_vars['__version__'], local_vars['__version_info__'])
38+
39+
1240setup(
1341 name='traad',
14- version='3.0.1' ,
42+ version=read_version(local_file('traad', 'version.py'))[0] ,
1543 packages=find_packages(),
1644
1745 # metadata for upload to PyPI
Original file line number Diff line number Diff line change 1+ __version_info__ = (3, 1, 0)
2+ __version__ = '.'.join(map(str, __version_info__))
You can’t perform that action at this time.
0 commit comments