Skip to content

Commit 6c7ef7a

Browse files
author
Kazuyoshi Furutaka (work)
committed
setup.py: 'version' from git describe --tags --long instead of SVN revsion#
Previously (when the repository of this sofrware was on GoogleCode and Subversion was used), in setup.py, the version number was taken from its subversion database by using sqlite3. Now that the repository was moved to GitHub, a change was made so that the version number is deduced from Git tags (and therefore we need so-called 'annotated tags'). Minor change: name = "mc_tools" -> "mc-tools" in setup.py.
1 parent bab02c0 commit 6c7ef7a

File tree

1 file changed

+3
-15
lines changed

1 file changed

+3
-15
lines changed

setup.py

+3-15
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env python
22

3-
import sys, os, subprocess, sqlite3
3+
import sys, os, subprocess
44

55
# prepare setuptools environment
66
try:
@@ -18,21 +18,9 @@
1818
print "place it in the same directory as setup.py, and try again... "
1919
sys.exit(1)
2020

21-
# get the revision number of the WC using sqlite3
22-
# prep = '_' if sys.platform == "win32" and os.getenv("SVN_ASP_DOT_NET_HACK") \
23-
# else '.'
24-
# SVNWCDBPATH = prep + "svn/wc.db"
25-
SVNWCDBPATH = ('_' if sys.platform == "win32" and
26-
os.getenv("SVN_ASP_DOT_NET_HACK") else '.') + "svn/wc.db"
27-
curs = sqlite3.connect(SVNWCDBPATH).cursor()
28-
rev = "r%d" % curs.execute("select MAX(revision) from NODES "
29-
"where"
30-
" presence IN ('normal', 'incomplete')"
31-
" AND file_external is NULL"
32-
" AND op_depth=0").fetchone()
3321
setup(
34-
name = "mc_tools",
35-
version = rev,
22+
name = "mc-tools",
23+
version = os.popen("git describe --tags --long").read().strip(),
3624
author = "Konstantin Batkov",
3725
author_email = "batkov@gmail.com",
3826
url = "https://github.com/kbat/mc-tools/",

0 commit comments

Comments
 (0)