forked from luispedro/mahotas
-
Notifications
You must be signed in to change notification settings - Fork 1
/
setup.py
97 lines (84 loc) · 3.31 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
# -*- coding: utf-8 -*-
# Copyright (C) 2009-2011, Luis Pedro Coelho <[email protected]>
# vim: set ts=4 sts=4 sw=4 expandtab smartindent:
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published
# by the Free Software Foundation; either version 2 of the License,
# or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301, USA.
from __future__ import division
try:
import setuptools
except:
print '''
setuptools not found.
On linux, the package is often called python-setuptools'''
from sys import exit
exit(1)
import os
import numpy.distutils.core as numpyutils
execfile('mahotas/mahotas_version.py')
long_description = file('docs/source/readme.rst').read()
undef_macros=[]
if os.environ.get('DEBUG'):
undef_macros=['NDEBUG']
extensions = {
'mahotas._bbox': ['mahotas/_bbox.cpp'],
'mahotas._center_of_mass': ['mahotas/_center_of_mass.cpp'],
'mahotas._convex': ['mahotas/_convex.cpp'],
'mahotas._convolve': ['mahotas/_convolve.cpp', 'mahotas/_filters.cpp'],
'mahotas._distance': ['mahotas/_distance.cpp'],
'mahotas._histogram': ['mahotas/_histogram.cpp'],
'mahotas._interpolate': ['mahotas/_interpolate.cpp', 'mahotas/_filters.cpp'],
'mahotas._labeled': ['mahotas/_labeled.cpp', 'mahotas/_filters.cpp'],
'mahotas._morph': ['mahotas/_morph.cpp', 'mahotas/_filters.cpp'],
'mahotas._thin': ['mahotas/_thin.cpp'],
'mahotas.features._lbp': ['mahotas/features/_lbp.cpp'],
'mahotas.features._surf': ['mahotas/features/_surf.cpp'],
'mahotas.features._texture': ['mahotas/features/_texture.cpp', 'mahotas/_filters.cpp'],
'mahotas.features._zernike': ['mahotas/features/_zernike.cpp'],
}
ext_modules = [numpyutils.Extension(key, sources=sources, undef_macros=undef_macros) for key,sources in extensions.iteritems()]
packages = setuptools.find_packages()
package_dir = {
'mahotas.tests': 'mahotas/tests',
}
package_data = {
'mahotas.tests': ['data/*'],
}
classifiers = [
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'Intended Audience :: Science/Research',
'Topic :: Scientific/Engineering :: Image Recognition',
'Topic :: Software Development :: Libraries',
'Programming Language :: Python',
'Programming Language :: C++',
'License :: OSI Approved :: GNU General Public License (GPL)',
]
numpyutils.setup(name = 'mahotas',
version = __version__,
description = 'Mahotas: Computer Vision Library',
long_description = long_description,
author = 'Luis Pedro Coelho',
author_email = '[email protected]',
license = 'GPL',
platforms = ['Any'],
classifiers = classifiers,
url = 'http://luispedro.org/software/mahotas',
packages = packages,
ext_modules = ext_modules,
package_dir = package_dir,
package_data = package_data,
test_suite = 'nose.collector',
)