Skip to content

Commit cb3379f

Browse files
committed
support older setuptools
1 parent e4bc102 commit cb3379f

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

gittaggers.py

+11-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,15 @@
11
import subprocess
22
import time
3-
3+
import pkg_resources
44
from setuptools.command.egg_info import egg_info
55

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)
613

714
class EggInfoFromGit(egg_info):
815
"""Tag the build with git commit timestamp.
@@ -24,4 +31,6 @@ def tags(self):
2431
except subprocess.CalledProcessError:
2532
pass
2633
return egg_info.tags(self)
27-
vtags = property(tags)
34+
35+
if RECENT_SETUPTOOLS:
36+
vtags = property(tags)

0 commit comments

Comments
 (0)