Make version strings PEP440 compliant
This commit is contained in:
parent
8bd940489b
commit
1899fb0473
@ -16,6 +16,8 @@ pyqtgraph-0.10.0 [unreleased]
|
|||||||
the color every time the text is changed.
|
the color every time the text is changed.
|
||||||
- FFT plots skip first sample if x-axis uses log scaling
|
- FFT plots skip first sample if x-axis uses log scaling
|
||||||
- Multiprocessing system adds bytes and unicode to the default list of no-proxy data types
|
- Multiprocessing system adds bytes and unicode to the default list of no-proxy data types
|
||||||
|
- Version number scheme changed to be PEP440-compliant (only affects installations from non-
|
||||||
|
release git commits)
|
||||||
|
|
||||||
Bugfixes:
|
Bugfixes:
|
||||||
- Fix for numpy API change that caused casting errors for inplace operations
|
- Fix for numpy API change that caused casting errors for inplace operations
|
||||||
|
@ -358,18 +358,33 @@ def getGitVersion(tagPrefix):
|
|||||||
if not os.path.isdir(os.path.join(path, '.git')):
|
if not os.path.isdir(os.path.join(path, '.git')):
|
||||||
return None
|
return None
|
||||||
|
|
||||||
gitVersion = check_output(['git', 'describe', '--tags']).strip().decode('utf-8')
|
v = check_output(['git', 'describe', '--tags', '--dirty', '--match=%s*'%tagPrefix]).strip().decode('utf-8')
|
||||||
|
|
||||||
# any uncommitted modifications?
|
# chop off prefix
|
||||||
|
assert v.startswith(tagPrefix)
|
||||||
|
v = v[len(tagPrefix):]
|
||||||
|
|
||||||
|
# split up version parts
|
||||||
|
parts = v.split('-')
|
||||||
|
|
||||||
|
# has working tree been modified?
|
||||||
modified = False
|
modified = False
|
||||||
status = check_output(['git', 'status', '--porcelain'], universal_newlines=True).strip().split('\n')
|
if parts[-1] == 'dirty':
|
||||||
for line in status:
|
modified = True
|
||||||
if line != '' and line[:2] != '??':
|
parts = parts[:-1]
|
||||||
modified = True
|
|
||||||
break
|
# have commits been added on top of last tagged version?
|
||||||
|
# (git describe adds -NNN-gXXXXXXX if this is the case)
|
||||||
|
local = None
|
||||||
|
if len(parts) > 2 and re.match(r'\d+', parts[-2]) and re.match(r'g[0-9a-f]{7}', parts[-1]):
|
||||||
|
local = parts[-1]
|
||||||
|
parts = parts[:-2]
|
||||||
|
|
||||||
|
gitVersion = '-'.join(parts)
|
||||||
|
if local is not None:
|
||||||
|
gitVersion += '+' + local
|
||||||
if modified:
|
if modified:
|
||||||
gitVersion = gitVersion + '+'
|
gitVersion += 'm'
|
||||||
|
|
||||||
return gitVersion
|
return gitVersion
|
||||||
|
|
||||||
@ -393,11 +408,11 @@ def getVersionStrings(pkg):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
## Determine current version string from __init__.py
|
## Determine current version string from __init__.py
|
||||||
initVersion = getInitVersion(pkgroot='pyqtgraph')
|
initVersion = getInitVersion(pkgroot=pkg)
|
||||||
|
|
||||||
## If this is a git checkout, try to generate a more descriptive version string
|
## If this is a git checkout, try to generate a more descriptive version string
|
||||||
try:
|
try:
|
||||||
gitVersion = getGitVersion(tagPrefix='pyqtgraph-')
|
gitVersion = getGitVersion(tagPrefix=pkg+'-')
|
||||||
except:
|
except:
|
||||||
gitVersion = None
|
gitVersion = None
|
||||||
sys.stderr.write("This appears to be a git checkout, but an error occurred "
|
sys.stderr.write("This appears to be a git checkout, but an error occurred "
|
||||||
|
Loading…
Reference in New Issue
Block a user