summaryrefslogtreecommitdiff
path: root/setup.py
diff options
context:
space:
mode:
authorDavid Cournapeau <cournape@gmail.com>2009-03-27 16:39:01 +0000
committerDavid Cournapeau <cournape@gmail.com>2009-03-27 16:39:01 +0000
commit5bb1aa51bac49c81fd7cd2c2d963d6de41683902 (patch)
treee482387b9629d11bab8ce5f6d1be095d2f1aeb51 /setup.py
parent6b942481c52f6d2e88774fe4c18c3aed64cd7ee5 (diff)
downloadnumpy-5bb1aa51bac49c81fd7cd2c2d963d6de41683902.tar.gz
Fix svn version detection.
Diffstat (limited to 'setup.py')
-rwxr-xr-xsetup.py30
1 files changed, 15 insertions, 15 deletions
diff --git a/setup.py b/setup.py
index ae095c212..0ec7db66c 100755
--- a/setup.py
+++ b/setup.py
@@ -52,11 +52,25 @@ MICRO = 0
ISRELEASED = False
VERSION = '%d.%d.%d' % (MAJOR, MINOR, MICRO)
+# Return the svn version as a string, raise a ValueError otherwise
+def svn_version():
+ out = subprocess.Popen(['svn', 'info'], stdout = subprocess.PIPE).communicate()[0]
+ r = re.compile('Revision: ([0-9]+)')
+ svnver = None
+ for line in out.split('\n'):
+ m = r.match(line)
+ if m:
+ svnver = m.group(1)
+
+ if not svnver:
+ raise ValueError("Error while parsing svn version ?")
+ return svnver
+
FULLVERSION = VERSION
if not ISRELEASED:
FULLVERSION += '.dev'
# If in git or something, bypass the svn rev
- if os.path.exists('.svn.'):
+ if os.path.exists('.svn'):
FULLVERSION += svn_version()
# BEFORE importing distutils, remove MANIFEST. distutils doesn't properly
@@ -69,20 +83,6 @@ if os.path.exists('MANIFEST'): os.remove('MANIFEST')
# a lot more robust than what was previously being used.
__builtin__.__NUMPY_SETUP__ = True
-# Return the svn version as a string, raise a ValueError otherwise
-def svn_version():
- out = subprocess.Popen(['svn', 'info'], stdout = subprocess.PIPE).communicate()[0]
- r = re.compile('Revision: ([0-9]+)')
- svnver = None
- for line in out.split('\n'):
- m = r.match(line)
- if m:
- svnver = m.group(1)
-
- if not svnver:
- raise ValueError("Error while parsing svn version ?")
- return svnver
-
def write_version_py(filename='numpy/version.py'):
cnt = """
# THIS FILE IS GENERATED FROM NUMPY SETUP.PY