Permalink
Browse files

Added version command to setup.py

  • Loading branch information...
1 parent 9c34c6a commit e82cb43406f5c696a5be34461e6f568286b7d6a2 Michael Kleehammer committed Mar 18, 2009
Showing with 17 additions and 2 deletions.
  1. +17 −2 setup.py
View
19 setup.py
@@ -1,13 +1,27 @@
#!/usr/bin/python
import sys, os, re
-from distutils.core import setup
+from distutils.core import setup, Command
from distutils.extension import Extension
from distutils.errors import *
from os.path import exists, abspath, dirname, join, isdir
OFFICIAL_BUILD = 9999
+class VersionCommand(Command):
+ user_options = []
+
+ def initialize_options(self):
+ self.verbose = 0
+
+ def finalize_options(self):
+ pass
+
+ def run(self):
+ version_str, version = get_version()
+ print version_str
+
+
def main():
version_str, version = get_version()
@@ -93,7 +107,8 @@ def main():
],
url = 'http://code.google.com/p/pyodbc',
- download_url = 'http://code.google.com/p/pyodbc/downloads/list')
+ download_url = 'http://code.google.com/p/pyodbc/downloads/list',
+ cmdclass = { 'version' : VersionCommand })

0 comments on commit e82cb43

Please sign in to comment.