-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsetup.py
83 lines (71 loc) · 2.34 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
import os
import re
from distutils.core import Command, setup
from setuptools import find_packages
REQUIREMENTS = [
'django<1.5.0',
'django-fields',
'django-autoload',
'django-dynamic-rules>=0.2.0',
]
TEST_REQUIREMENTS = [
'mock',
'pep8',
'pyflakes',
'coverage',
'django_nose',
'nosexcover',
]
def do_setup():
setup(
name="django-dynamic-validation",
version='1.2.4',
author="IMT Computer Services",
author_email="[email protected]",
description="Define user generated validation requirements for django models.",
long_description=open('README.txt', 'r').read(),
url="https://github.com/imtapps/django-dynamic-validation",
packages=find_packages(exclude=['example']),
install_requires=REQUIREMENTS,
tests_require=TEST_REQUIREMENTS,
zip_safe=False,
classifiers = [
"Development Status :: 3 - Alpha",
"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",
],
dependency_links = (
'https://bitbucket.org/twanschik/django-autoload/get/tip.tar.gz#egg=django-autoload',
),
cmdclass={
'install_dev':InstallDependencies,
}
)
class InstallDependencies(Command):
"""
Command to install both develop dependencies and test dependencies.
Not sure why we can't find a built in command to do that already
in an accessible way.
"""
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def get_test_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 install %s" % self.get_test_dependencies())
if __name__ == '__main__':
do_setup()