Commit 09e0bf73 authored by Luke Campagnola's avatar Luke Campagnola
Browse files now modifies on build to include a more descriptive... now modifies on build to include a more descriptive version string if .git is present.
parent 6ae0892e
......@@ -17,11 +17,12 @@ if os.path.isdir(buildPath):
## Determine current version string
init = open(os.path.join(path, 'pyqtgraph/')).read()
init = open(os.path.join(path, 'pyqtgraph', '')).read()
m ='__version__ = (\S+)\n', init)
if m is None:
raise Exception("Cannot determine version number!")
version ='\'\"')
initVersion = version
# If this is a git checkout, append the current commit
if os.path.isdir(os.path.join(path, '.git')):
......@@ -59,8 +60,27 @@ if os.path.isdir(os.path.join(path, '.git')):
print("PyQtGraph version: " + version)
class Build(
def run(self):
ret =
# If the version in __init__ is different from the automatically-generated
# version string, then we will update __init__ in the build directory
global path, version, initVersion
if initVersion == version:
return ret
initfile = os.path.join(path, self.build_lib, 'pyqtgraph', '')
data = open(initfile, 'r').read()
open(initfile, 'w').write(re.sub(r"__version__ = .*", "__version__ = '%s'" % version, data))
return ret
cmdclass={'build': Build},
description='Scientific Graphics and GUI Library for Python',
PyQtGraph is a pure-python graphics and GUI library built on PyQt4/PySide and
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment