-
Notifications
You must be signed in to change notification settings - Fork 74
/
setup.py
84 lines (71 loc) · 2.65 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
from setuptools import setup, find_packages
import os
import re
import admin_tools_stats
def runtests():
import os
import sys
import django
from django.core.management import call_command
os.environ['DJANGO_SETTINGS_MODULE'] = 'demoproject.test_settings'
django.setup()
call_command('test', 'admin_tools_stats')
sys.exit()
def read(*parts):
return open(os.path.join(os.path.dirname(__file__), *parts)).read()
def parse_requirements(file_name):
requirements = []
for line in open(file_name, 'r').read().split('\n'):
if re.match(r'(\s*#)|(\s*$)', line):
continue
if re.match(r'\s*-e\s+', line):
requirements.append(re.sub(r'\s*-e\s+.*#egg=(.*)$', r'\1', line))
elif re.match(r'(\s*git)|(\s*hg)', line):
pass
else:
requirements.append(line)
return requirements
def parse_dependency_links(file_name):
dependency_links = []
for line in open(file_name, 'r').read().split('\n'):
if re.match(r'\s*-[ef]\s+', line):
dependency_links.append(re.sub(r'\s*-[ef]\s+', '', line))
return dependency_links
setup(
name='django-admin-tools-stats',
version=admin_tools_stats.__version__,
description='django-admin-tools-stats - Django-admin module to create charts and stats in your dashboard',
long_description=read('README.rst'),
author='Belaid Arezqui',
author_email='areski@gmail.com',
url='https://github.com/areski/django-admin-tools-stats',
include_package_data=True,
zip_safe=False,
package_dir={'admin_tools_stats': 'admin_tools_stats'},
packages=find_packages(),
package_data={},
install_requires=parse_requirements('requirements.txt'),
dependency_links=parse_dependency_links('requirements.txt'),
license='MIT License',
classifiers=[
'Development Status :: 5 - Production/Stable',
'Environment :: Web Environment',
'Framework :: Django',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Topic :: Software Development :: Libraries :: Python Modules'
],
extras_require={
':python_version < "3.0"': ['Django>=1.8,<2.0'],
':python_version >= "3.0"': ['Django>=1.8'],
},
test_suite='setup.runtests',
)