-
Notifications
You must be signed in to change notification settings - Fork 5
/
setup.py
75 lines (64 loc) · 2.08 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
import os
import re
from distutils.core import Command, setup
REQUIREMENTS = [
'django<1.5.0',
]
TEST_REQUIREMENTS = [
'mock==0.8.0',
'pep8',
'pyflakes',
'django_nose',
'nosexcover',
]
def do_setup():
setup(
name="django-wizard",
version='0.3.0',
author="Matthew J. Morrison",
author_email="[email protected]",
description="A wizard that helps to control page flow.",
long_description=open('README.txt', 'r').read(),
url="https://github.com/imtapps/django-wizard",
packages=("wizard",),
install_requires=REQUIREMENTS,
tests_require=TEST_REQUIREMENTS,
zip_safe=False,
classifiers = [
"Development Status :: 5 - Production/Stable",
"Environment :: Web Environment",
"Framework :: Django",
"Intended Audience :: Developers",
"License :: OSI Approved :: BSD License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Topic :: Software Development",
"Topic :: Software Development :: Libraries :: Application Frameworks",
],
cmdclass={
'install_dev': InstallDependencies,
'uninstall_dev': UninstallDependencies,
},
)
class PipDependencies(Command):
pip_command = ""
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def get_all_dependencies(self):
"""
replace all > or < in the dependencies so the system does not
try to redirect stdin or stdout from/to a file.
"""
command_line_deps = ' '.join(REQUIREMENTS + TEST_REQUIREMENTS)
return re.sub(re.compile(r'([<>])'), r'\\\1', command_line_deps)
def run(self):
os.system("pip %s %s" % (self.pip_command, self.get_all_dependencies()))
class InstallDependencies(PipDependencies):
pip_command = 'install'
class UninstallDependencies(PipDependencies):
pip_command = 'uninstall'
if __name__ == '__main__':
do_setup()