-
Notifications
You must be signed in to change notification settings - Fork 5
/
setup.py
executable file
·128 lines (110 loc) · 4.49 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
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2014, Sergio Callegari
# All rights reserved.
# This file is part of PyDSM.
# PyDSM 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 3 of the License, or
# (at your option) any later version.
# PyDSM 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 PyDSM. If not, see <http://www.gnu.org/licenses/>.
from __future__ import print_function
import sys
import io
from setuptools import setup, Extension, find_packages
from Cython.Distutils import build_ext
import os
import platform
import numpy as np
from setup_helper_version import get_git_version
from setup_helper_docdist import docdist
if sys.version_info[:2] < (2, 6):
raise RuntimeError("Python 2 supported for versions >= 2.6")
if (3,) <= sys.version_info[:2] < (3, 2):
raise RuntimeError("Python 3 supported for versions >= 3.2")
__version__ = get_git_version(store="pydsm/RELEASE-VERSION")
def read_from_here(fname):
with io.open(os.path.join(os.path.dirname(__file__), fname),
encoding='utf-8') as fp:
return fp.read()
# Prepare the extension modules
ext_modules = [
Extension('pydsm.delsig._simulateDSM_cblas',
['pydsm/delsig/_simulateDSM_cblas.pyx'],
include_dirs=[np.get_include()],
libraries=['cblas']),
Extension('pydsm.delsig._simulateDSM_scipy_blas',
['pydsm/delsig/_simulateDSM_scipy_blas.pyx'],
include_dirs=[np.get_include()])]
description = 'Python Based Delta-Sigma modulator design tools'
# Long description can contain restructured text and goes on display
# on Pypi
long_description = (read_from_here('README.rst') +
'\n\n' +
read_from_here('CHANGELOG'))
# Special requirements for the windows platform
if platform.system() != 'Linux':
# The cblas simulator is only built in Linux
ext_modules = [
Extension('pydsm.delsig._simulateDSM_scipy_blas',
['pydsm/delsig/_simulateDSM_scipy_blas.pyx'],
include_dirs=[np.get_include()])]
setup(
name='pydsm',
version=__version__,
description=description,
long_description=long_description,
author='Sergio Callegari',
author_email='[email protected]',
url='https://github.com/sergiocallegari/PyDSM',
license='GNU General Public License v3 or later (GPLv3+)',
platforms=['Linux', 'Windows', 'Mac'],
packages=find_packages(),
package_data={'pydsm': ['RELEASE-VERSION'],
'': ['tests/*.py', 'tests/Data/*',
'benchmarks/*.py', 'benchmarks/Data/*']},
ext_modules=ext_modules,
test_suite="nose.collector",
requires=['scipy (>=0.10.1)',
'numpy (>=1.8.0)',
'matplotlib (>= 1.1.0)',
'cvxopt (>=1.1.4)',
'cython (>=0.16)',
'setuptools (>=3.3)',
'nose (>=1.0)'],
setup_requires=['nose>=1.0'],
cmdclass={'build_ext': build_ext,
'docdist': docdist},
classifiers=[
'Development Status :: 4 - Beta',
'Environment :: Console',
'Intended Audience :: Education',
'Intended Audience :: Science/Research',
'Intended Audience :: Developers',
('License :: OSI Approved :: '
'GNU General Public License v3 or later (GPLv3+)'),
'Natural Language :: English',
'Operating System :: MacOS :: MacOS X',
'Operating System :: Microsoft :: Windows',
'Operating System :: POSIX',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.2',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Cython',
'Topic :: Education',
('Topic :: Scientific/Engineering :: '
'Electronic Design Automation (EDA)')
]
)