diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2021-10-23 12:54:12 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-23 12:54:12 -0600 |
commit | 7cc966bb0542b378cac095fbfbd3916240e0f293 (patch) | |
tree | 764597576d37b7ece9660ae3d49ee6a6170be866 | |
parent | bede698337b0b55115c2e06444828de1da59484e (diff) | |
parent | 9db73b58df62f54521bbbb8addafc7b0d5e61d1f (diff) | |
download | numpy-7cc966bb0542b378cac095fbfbd3916240e0f293.tar.gz |
Merge pull request #20170 from matthew-brett/better-error-version-fail
More informative error for unparsable version
-rwxr-xr-x | setup.py | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -55,7 +55,10 @@ FULLVERSION = versioneer.get_version() # 1.22.0 ... -> ISRELEASED == True, VERSION == 1.22.0 # 1.22.0rc1 ... -> ISRELEASED == True, VERSION == 1.22.0 ISRELEASED = re.search(r'(dev|\+)', FULLVERSION) is None -MAJOR, MINOR, MICRO = re.match(r'(\d+)\.(\d+)\.(\d+)', FULLVERSION).groups() +_V_MATCH = re.match(r'(\d+)\.(\d+)\.(\d+)', FULLVERSION) +if _V_MATCH is None: + raise RuntimeError(f'Cannot parse version {FULLVERSION}') +MAJOR, MINOR, MICRO = _V_MATCH.groups() VERSION = '{}.{}.{}'.format(MAJOR, MINOR, MICRO) # The first version not in the `Programming Language :: Python :: ...` classifiers above |