Skip to content

Commit 70a2d12

Browse files
committed
Complain when the version could not be determined instead of building with 0+unknown.
1 parent ff234cf commit 70a2d12

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

setup.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,11 +138,16 @@ def run(self):
138138
define_macros=[('GPUARRAY_SHARED', None)]
139139
)]
140140

141-
cmds=versioneer.get_cmdclass()
141+
cmds = versioneer.get_cmdclass()
142142
cmds["clean"] = cmd_clean
143143

144+
version_data = versioneer.get_versions()
145+
146+
if version_data['error'] is not None:
147+
raise ValueError("Can't determine version for build: %s\n Please make sure that your git checkout includes tags." % (version_data['error'],))
148+
144149
setup(name='pygpu',
145-
version=versioneer.get_version(),
150+
version=version_data['version'],
146151
cmdclass=cmds,
147152
description='numpy-like wrapper on libgpuarray for GPU computations',
148153
packages=['pygpu', 'pygpu/tests'],

0 commit comments

Comments
 (0)