command: Fix except declaration for get_comedi_cmd_pointer
[pycomedi.git] / setup.py
1 # Copyright (C) 2008-2012 W. Trevor King <wking@tremily.us>
2 #
3 # This file is part of pycomedi.
4 #
5 # pycomedi is free software: you can redistribute it and/or modify it under the
6 # terms of the GNU General Public License as published by the Free Software
7 # Foundation, either version 2 of the License, or (at your option) any later
8 # version.
9 #
10 # pycomedi is distributed in the hope that it will be useful, but WITHOUT ANY
11 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
12 # A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
13 #
14 # You should have received a copy of the GNU General Public License along with
15 # pycomedi.  If not, see <http://www.gnu.org/licenses/>.
16
17 "An object-oriented interface for the Comedi drivers."
18
19 from distutils.core import setup
20 from distutils.extension import Extension
21 import os
22 import os.path
23
24 from Cython.Distutils import build_ext
25 import numpy
26
27 from pycomedi import __version__
28
29
30 package_name = 'pycomedi'
31
32 _this_dir = os.path.dirname(__file__)
33
34 ext_modules = []
35 for filename in sorted(os.listdir(package_name)):
36     basename,extension = os.path.splitext(filename)
37     if extension == '.pyx':
38         ext_modules.append(
39             Extension(
40                 '{}.{}'.format(package_name, basename),
41                 [os.path.join(package_name, filename)],
42                 libraries=['comedi'],
43                 include_dirs=[numpy.get_include()],
44                 ))
45
46 setup(name=package_name,
47       version=__version__,
48       maintainer='W. Trevor King',
49       maintainer_email='wking@tremily.us',
50       url='http://blog.tremily.us/posts/{}/'.format(package_name),
51       download_url='http://git.tremily.us/?p={}.git;a=snapshot;h={};sf=tgz'.format(
52         package_name, __version__),
53       license='GNU General Public License (GPL)',
54       platforms=['all'],
55       description=__doc__,
56       long_description=open(os.path.join(_this_dir, 'README'), 'r').read(),
57       classifiers=[
58           'Development Status :: 2 - Pre-Alpha',
59           'Intended Audience :: Developers',
60           'Intended Audience :: Science/Research',
61           'Operating System :: POSIX',
62           'Operating System :: Unix',
63           'License :: OSI Approved :: GNU General Public License (GPL)',
64           'License :: OSI Approved :: GNU General Public License v2 or later (GPLv2+)',
65           'Programming Language :: Python',
66           'Programming Language :: Python :: 2',
67           'Programming Language :: Python :: 2.7',
68           'Programming Language :: Python :: 3',
69           'Programming Language :: Python :: 3.2',
70           'Topic :: Scientific/Engineering',
71           'Topic :: Software Development :: Libraries :: Python Modules',
72           ],
73       packages=[package_name],
74       provides=[package_name],
75       cmdclass = {'build_ext': build_ext},
76       ext_modules = ext_modules,
77       )