forked from joestump/python-oauth2
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsetup.py
More file actions
executable file
·39 lines (36 loc) · 1.07 KB
/
setup.py
File metadata and controls
executable file
·39 lines (36 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/usr/bin/env python
import os
import re
from setuptools import find_packages, setup
PKG = 'oauth2'
VERSIONFILE = os.path.join(os.path.dirname(__file__), 'oauth2', '_version.py')
verstrline = open(VERSIONFILE, "rt").read()
MVSRE = r'''^manual_verstr *= *['"]([^'"]*)['"]'''
mo = re.search(MVSRE, verstrline, re.M)
if mo:
mverstr = mo.group(1)
else:
print("unable to find version in %s" % (VERSIONFILE, ))
raise RuntimeError(
"if %s.py exists, it must be well-formed" % (VERSIONFILE, ))
AVSRE = r'''^auto_build_num *= *['"]([^'"]*)['"]'''
mo = re.search(AVSRE, verstrline, re.M)
if mo:
averstr = mo.group(1)
else:
averstr = ''
verstr = '.'.join([mverstr, averstr])
setup(
name=PKG,
version=verstr,
description="library for OAuth version 1.0",
author="Joe Stump",
author_email="joe@simplegeo.com",
url="http://github.com/simplegeo/python-oauth2",
packages=find_packages(),
install_requires=['httplib2'],
license="MIT License",
keywords="oauth",
zip_safe=True,
test_suite="tests",
tests_require=['coverage', 'mock'])