We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e4bc102 commit cb3379fCopy full SHA for cb3379f
gittaggers.py
@@ -1,8 +1,15 @@
1
import subprocess
2
import time
3
-
+import pkg_resources
4
from setuptools.command.egg_info import egg_info
5
6
+SETUPTOOLS_VER = pkg_resources.get_distribution(
7
+ "setuptools").version.split('.')
8
+
9
+RECENT_SETUPTOOLS = int(SETUPTOOLS_VER[0]) > 40 or (
10
+ int(SETUPTOOLS_VER[0]) == 40 and int(SETUPTOOLS_VER[1]) > 0) or (
11
+ int(SETUPTOOLS_VER[0]) == 40 and int(SETUPTOOLS_VER[1]) == 0 and
12
+ int(SETUPTOOLS_VER[2]) > 0)
13
14
class EggInfoFromGit(egg_info):
15
"""Tag the build with git commit timestamp.
@@ -24,4 +31,6 @@ def tags(self):
24
31
except subprocess.CalledProcessError:
25
32
pass
26
33
return egg_info.tags(self)
27
- vtags = property(tags)
34
35
+ if RECENT_SETUPTOOLS:
36
+ vtags = property(tags)
0 commit comments