Skip to content

Commit

Permalink
Added __version__ working for setup.py and PyInstaller.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ri-P committed Jun 11, 2015
1 parent d3ecab8 commit 0f96c2b
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 5 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ var/
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
Expand Down
22 changes: 22 additions & 0 deletions ethunder.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# -*- mode: python -*-
a = Analysis(['ethunder\\app.py'],
hiddenimports=[],
hookspath=None,
runtime_hooks=None)
pyz = PYZ(a.pure)
exe = EXE(pyz,
a.scripts,
exclude_binaries=True,
name='ethunder.exe',
debug=False,
strip=None,
upx=True,
console=True )
coll = COLLECT(exe,
a.binaries,
a.zipfiles,
a.datas + [('README.md', 'README.md', 'DATA'),
('LICENSE.txt', 'LICENSE', 'DATA')],
strip=None,
upx=True,
name='ethunder')
2 changes: 1 addition & 1 deletion ethunder/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
:license: GPLv2, see LICENSE for details.
"""

__version__ = "0.1.0"
from _version import __version__

class EThunderError(Exception):
pass
1 change: 1 addition & 0 deletions ethunder/_version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__version__ = "0.2.0"
1 change: 0 additions & 1 deletion ethunder/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ def load_config():
raise
else:
ethunder.config.update(cfg_from_file)
print("Following config was read: {0}".format(ethunder.config))


def configurate():
Expand Down
15 changes: 13 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
from setuptools import setup
import os.path
import re

import ethunder
versionfile_path = os.path.join("ethunder", "_version.py")
with open(versionfile_path, 'r') as version_file:
version_line = version_file.read()
ver_reexpr = r"^__version__ = ['\"]([^'\"]*)[\"]"
r = re.search(ver_reexpr, version_line, re.M)
if r:
version = r.group(1)
else:
raise RuntimeError("Unable to find version string in {0}".format(
versionfile_path))

config = {
'name': 'EThunder',
Expand All @@ -18,7 +29,7 @@
"Operating System :: POSIX :: Linux",
],

'version': ethunder.__version__,
'version': version,
'install_requires': ['docopt==0.6.1',
'appdirs==1.4.0',
'nose==1.3.4',
Expand Down

0 comments on commit 0f96c2b

Please sign in to comment.