forked from dj-stripe/dj-stripe
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
96 lines (84 loc) · 2.68 KB
/
setup.py
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
#!/usr/bin/env python
import ast
import os
import sys
class MetadataFinder(ast.NodeVisitor):
def __init__(self):
self.version = None
self.summary = None
self.author = None
self.email = None
self.uri = None
self.licence = None
def visit_Assign(self, node):
if node.targets[0].id == '__version__':
self.version = node.value.s
elif node.targets[0].id == '__summary__':
self.summary = node.value.s
elif node.targets[0].id == '__author__':
self.author = node.value.s
elif node.targets[0].id == '__email__':
self.email = node.value.s
elif node.targets[0].id == '__uri__':
self.uri = node.value.s
elif node.targets[0].id == '__license__':
self.license = node.value.s
with open(os.path.join('djstripe', '__init__.py')) as open_file:
finder = MetadataFinder()
finder.visit(ast.parse(open_file.read()))
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
if sys.argv[-1] == 'publish':
os.system('python setup.py sdist upload')
os.system('python setup.py bdist_wheel upload')
sys.exit()
if sys.argv[-1] == 'tag':
print("Tagging the version on github:")
os.system("git tag -a %s -m 'version %s'" % (finder.version,
finder.version))
os.system("git push --tags")
sys.exit()
readme = open('README.rst').read()
history = open('HISTORY.rst').read().replace('.. :changelog:', '')
INSTALL_REQUIRES = [
'django!=1.9,>=1.8',
'stripe>=1.22.2',
'django-model-utils>=2.2',
'django-braces>=1.8.0',
'jsonfield>=1.0.3',
'pytz>=2015.4'
]
setup(
name='dj-stripe',
version=finder.version,
description=finder.summary,
long_description=readme + '\n\n' + history,
author=finder.author,
author_email=finder.email,
url=finder.uri,
packages=[
'djstripe',
],
package_dir={'djstripe': 'djstripe'},
include_package_data=True,
install_requires=INSTALL_REQUIRES,
license=finder.license,
zip_safe=False,
keywords='stripe django',
classifiers=[
'Development Status :: 4 - Beta',
'Environment :: Web Environment',
'Framework :: Django',
'Framework :: Django :: 1.8',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Natural Language :: English',
"Programming Language :: Python :: 2",
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5'
],
)