forked from radiac/django-tagulous
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
134 lines (121 loc) · 4.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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
import os
import re
import sys
from setuptools import setup, find_packages
VERSION = "0.11.1"
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
def runtests(args):
"Run tests"
import django
from django.conf import settings
from django.core.management import execute_from_command_line
if not settings.configured:
INSTALLED_APPS = [
'django.contrib.auth',
'django.contrib.admin',
'django.contrib.sessions',
'django.contrib.contenttypes',
'django.contrib.messages',
'tagulous',
'tests',
'tests.tagulous_tests_app',
'tests.tagulous_tests_app2',
'tests.tagulous_tests_migration',
]
SERIALIZATION_MODULES = {
'xml': 'tagulous.serializers.xml_serializer',
'json': 'tagulous.serializers.json',
'python': 'tagulous.serializers.python',
}
try:
import yaml
except ImportError:
pass
else:
SERIALIZATION_MODULES['yaml'] = 'tagulous.serializers.pyyaml'
testenv = re.sub(
r'[^a-zA-Z0-9]', '_',
os.environ.get('TOXENV', '_'.join(str(v) for v in django.VERSION)),
)
MIGRATION_MODULES = {
'tagulous_tests_migration': 'tests.tagulous_tests_migration.migrations_%s' % testenv
}
if django.VERSION < (1, 7):
try:
import south
except ImportError:
import warnings
warnings.warn(
"south not installed, needed for tests for Django %s" % (
'.'.join(str(v) for v in django.VERSION)
),
ImportWarning
)
else:
INSTALLED_APPS += ['south']
settings.configure(
DATABASES={
'default': {
'ENGINE': 'django.db.backends.sqlite3',
}
},
INSTALLED_APPS=INSTALLED_APPS,
MIDDLEWARE_CLASSES=[
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
],
ROOT_URLCONF='tests.tagulous_tests_app.urls',
SERIALIZATION_MODULES=SERIALIZATION_MODULES,
TEMPLATES=[{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'APP_DIRS': True,
}],
MIGRATION_MODULES=MIGRATION_MODULES,
SOUTH_MIGRATION_MODULES=MIGRATION_MODULES,
)
execute_from_command_line(args[:1] + ['test'] + (args[2:] or ['tests']))
if len(sys.argv) > 1 and sys.argv[1] == 'test':
runtests(sys.argv)
sys.exit()
setup(
name = "django-tagulous",
version = VERSION,
author = "Richard Terry",
author_email = "[email protected]",
description = ("Fabulous Tagging for Django"),
license = "BSD",
keywords = "django tagging",
url = "http://radiac.net/projects/django-tagulous/",
long_description=read('README.rst'),
classifiers=[
'Development Status :: 4 - Beta',
#'Development Status :: 5 - Production/Stable',
'Environment :: Web Environment',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Operating System :: OS Independent',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.2',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Framework :: Django',
'Framework :: Django :: 1.4',
'Framework :: Django :: 1.5',
'Framework :: Django :: 1.6',
'Framework :: Django :: 1.7',
'Framework :: Django :: 1.8',
],
extras_require = {
'dev': ['tox', 'jasmine'],
'i18n': ['unidecode'],
},
zip_safe=True,
packages=find_packages(exclude=('docs', 'tests*',)),
include_package_data=True,
)