p@21: #!/usr/bin/env python p@21: from setuptools import setup, find_packages p@21: import os, re p@21: p@21: PKG='oauth2' p@21: VERSIONFILE = os.path.join('oauth2', '_version.py') p@21: verstr = "unknown" p@21: try: p@21: verstrline = open(VERSIONFILE, "rt").read() p@21: except EnvironmentError: p@21: pass # Okay, there is no version file. p@21: else: p@21: MVSRE = r"^manual_verstr *= *['\"]([^'\"]*)['\"]" p@21: mo = re.search(MVSRE, verstrline, re.M) p@21: if mo: p@21: mverstr = mo.group(1) p@21: else: p@21: print "unable to find version in %s" % (VERSIONFILE,) p@21: raise RuntimeError("if %s.py exists, it must be well-formed" % (VERSIONFILE,)) p@21: AVSRE = r"^auto_build_num *= *['\"]([^'\"]*)['\"]" p@21: mo = re.search(AVSRE, verstrline, re.M) p@21: if mo: p@21: averstr = mo.group(1) p@21: else: p@21: averstr = '' p@21: verstr = '.'.join([mverstr, averstr]) p@21: p@21: setup(name=PKG, p@21: version=verstr, p@21: description="library for OAuth version 1.0", p@21: author="Joe Stump", p@21: author_email="joe@simplegeo.com", p@21: url="http://github.com/simplegeo/python-oauth2", p@21: packages = find_packages(), p@21: install_requires = ['httplib2'], p@21: license = "MIT License", p@21: keywords="oauth", p@21: zip_safe = True, p@21: test_suite="tests", p@21: tests_require=['coverage', 'mock'])