-
Notifications
You must be signed in to change notification settings - Fork 3
/
setup.py
executable file
·148 lines (104 loc) · 3.7 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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2011-2018 Matt Austin
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from __future__ import absolute_import, unicode_literals
import codecs
from os import path
from distutils.core import Command
from setuptools import find_packages, setup
from thummer import __license__, __title__, __url__, __version__
BASE_DIR = path.dirname(path.abspath(__file__))
# Get the long description from the README file
with codecs.open(path.join(BASE_DIR, 'README.rst'), encoding='utf-8') as f:
long_description = f.read()
class DjangoCommand(Command):
django_command_args = []
django_settings = {
'DATABASES': {'default': {'ENGINE': 'django.db.backends.sqlite3'}},
'INSTALLED_APPS': ['thummer'],
'MEDIA_ROOT': '/tmp/django-thummer/media/',
'MIDDLEWARE_CLASSES': [],
'ROOT_URLCONF': 'thummer.urls',
}
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
import django
from django.conf import settings
from django.core.management import call_command
settings.configure(**self.django_settings)
django.setup()
return call_command(*self.django_command_args, verbosity=3)
class CheckCommand(DjangoCommand):
django_command_args = ['check']
class MakeMigrationsCommand(DjangoCommand):
django_command_args = ['makemigrations', 'thummer']
class TestCommand(DjangoCommand):
django_command_args = ['test', 'thummer.tests']
setup(
name=__title__,
version=__version__,
description='A website screenshot and thumbnailing app for Django.',
long_description=long_description,
url=__url__,
author='Matt Austin',
author_email='[email protected]',
license=__license__,
classifiers=[
'Development Status :: 3 - Alpha',
'Environment :: Web Environment',
'Framework :: Django',
'Framework :: Django :: 1.8',
'Framework :: Django :: 1.11',
'Framework :: Django :: 2.0',
'Intended Audience :: Developers',
'License :: OSI Approved :: Apache Software License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
'Topic :: Multimedia :: Graphics :: Capture',
],
keywords='thummer django website snapshot screenshot thumbnail',
packages=find_packages(),
cmdclass={
'djangocheck': CheckCommand,
'makemigrations': MakeMigrationsCommand,
'test': TestCommand
},
install_requires=[
'django>=1.8,!=1.9.*,!=1.10.*,<=2.1',
'pillow~=5.0',
'python-dateutil~=2.6',
'selenium~=3.9',
'sorl-thumbnail~=12.4',
],
python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, <4',
extras_require={
'tests': [
'coverage~=4.5',
'freezegun~=0.3',
'mock~=2.0',
'pytz',
],
},
)