forked from zimeon/iiif
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
93 lines (85 loc) · 3.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
"""Setup for IIIF Image Library implementation."""
from setuptools import setup, Command
import os
# setuptools used instead of distutils.core so that
# dependencies can be handled automatically
# Extract version number from iiif/_version.py. Here we are very strict
# about the format of the version string as an extra sanity check.
# (thanks for comments in
# http://stackoverflow.com/questions/458550/standard-way-to-embed-version-into-python-package
# )
import re
VERSIONFILE = "iiif/_version.py"
verfilestr = open(VERSIONFILE, "rt").read()
match = re.search(r"^__version__ = '(\d\.\d.\d+(\.\d+)?)'",
verfilestr, re.MULTILINE)
if match:
version = match.group(1)
else:
raise RuntimeError("Unable to find version string in %s." % (VERSIONFILE))
class Coverage(Command):
"""Class to allow coverage run from setup."""
description = "run coverage"
user_options = []
def initialize_options(self):
"""Empty initialize_options."""
pass
def finalize_options(self):
"""Empty finalize_options."""
pass
def run(self):
"""Run coverage program."""
os.system("coverage run --source=iiif "
"--omit=iiif/manipulator_netpbm.py setup.py test")
os.system("coverage report")
os.system("coverage html")
print("See htmlcov/index.html for details.")
setup(
name='iiif',
version=version,
author='Simeon Warner',
author_email='[email protected]',
packages=['iiif'],
package_data={'iiif': ['templates/*',
'third_party/jquery-1.11.1.min.js',
'third_party/openseadragon121/*.js',
'third_party/openseadragon121/images/*',
'third_party/openseadragon100/*.js',
'third_party/openseadragon100/images/*',
'third_party/openseadragon200/*.js',
'third_party/openseadragon200/images/*']},
scripts=['iiif_static.py', 'iiif_testserver.py'],
classifiers=["Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"License :: OSI Approved :: "
"GNU General Public License v3 (GPLv3)",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 2.6",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3.3",
"Programming Language :: Python :: 3.4",
"Programming Language :: Python :: 3.5",
"Topic :: Internet :: WWW/HTTP",
"Topic :: Multimedia :: Graphics :: Graphics Conversion",
"Topic :: Software Development :: "
"Libraries :: Python Modules",
"Environment :: Web Environment"],
url='https://github.com/zimeon/iiif',
license='LICENSE.txt',
description='IIIF Image API reference implementation',
long_description=open('README').read(),
install_requires=[
"Pillow>=3.2.0,<4.0.0", # Pillow 4.0.0 drops python 2.6 support
"python-magic",
"Flask",
"mock"
],
test_suite="tests",
tests_require=[
"testfixtures",
],
cmdclass={
'coverage': Coverage,
},
)