24
24
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
25
25
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26
26
27
- import io
27
+ import sys
28
28
import os
29
- import re
30
29
from os .path import join
31
30
import Cython .Build
32
31
from setuptools import setup , Extension
33
32
import numpy as np
34
- from _vendored .conv_template import process_file as process_c_file
35
-
36
- with io .open ('mkl_fft/_version.py' , 'rt' , encoding = 'utf8' ) as f :
37
- version = re .search (r'__version__ = \'(.*?)\'' , f .read ()).group (1 )
38
-
39
- with open ("README.md" , "r" , encoding = "utf-8" ) as file :
40
- long_description = file .read ()
41
33
42
- VERSION = version
43
-
44
- CLASSIFIERS = """\
45
- Development Status :: 5 - Production/Stable
46
- Intended Audience :: Science/Research
47
- Intended Audience :: Developers
48
- License :: OSI Approved
49
- Programming Language :: C
50
- Programming Language :: Python
51
- Programming Language :: Python :: 3
52
- Programming Language :: Python :: 3.9
53
- Programming Language :: Python :: 3.10
54
- Programming Language :: Python :: 3.11
55
- Programming Language :: Python :: 3.12
56
- Programming Language :: Python :: Implementation :: CPython
57
- Topic :: Software Development
58
- Topic :: Scientific/Engineering
59
- Operating System :: Microsoft :: Windows
60
- Operating System :: POSIX
61
- Operating System :: Unix
62
- Operating System :: MacOS
63
- """
34
+ sys .path .insert (0 , os .path .dirname (__file__ )) # Ensures local imports work
35
+ from _vendored .conv_template import process_file as process_c_file
64
36
65
37
def extensions ():
66
38
mkl_root = os .environ .get ('MKLROOT' , None )
@@ -80,8 +52,8 @@ def extensions():
80
52
mkl_library_dirs = mkl_info .get ('library_dirs' , [])
81
53
mkl_libraries = mkl_info .get ('libraries' , ['mkl_rt' ])
82
54
83
- mklfft_templ = os . path . join ("mkl_fft" , "src" , "mklfft.c.src" )
84
- processed_mklfft_fn = os . path . join ("mkl_fft" , "src" , "mklfft.c" )
55
+ mklfft_templ = join ("mkl_fft" , "src" , "mklfft.c.src" )
56
+ processed_mklfft_fn = join ("mkl_fft" , "src" , "mklfft.c" )
85
57
src_processed = process_c_file (mklfft_templ )
86
58
87
59
with open (processed_mklfft_fn , 'w' ) as fid :
@@ -90,52 +62,27 @@ def extensions():
90
62
return [
91
63
Extension (
92
64
"mkl_fft._pydfti" ,
93
- [
94
- os . path . join ("mkl_fft" , "_pydfti.pyx" ),
95
- os . path . join ("mkl_fft" , "src" , "mklfft.c" ),
65
+ sources = [
66
+ join ("mkl_fft" , "_pydfti.pyx" ),
67
+ join ("mkl_fft" , "src" , "mklfft.c" ),
96
68
],
97
69
depends = [
98
- os . path . join ("mkl_fft" , "src" , 'mklfft.h' ),
99
- os . path . join ("mkl_fft" , "src" , "multi_iter.h" )
70
+ join ("mkl_fft" , "src" , 'mklfft.h' ),
71
+ join ("mkl_fft" , "src" , "multi_iter.h" )
100
72
],
101
- include_dirs = [os . path . join ("mkl_fft" , "src" ), np .get_include ()] + mkl_include_dirs ,
73
+ include_dirs = [join ("mkl_fft" , "src" ), np .get_include ()] + mkl_include_dirs ,
102
74
libraries = mkl_libraries ,
103
75
library_dirs = mkl_library_dirs ,
104
76
extra_compile_args = [
105
77
'-DNDEBUG' ,
106
78
# '-ggdb', '-O0', '-Wall', '-Wextra', '-DDEBUG',
107
79
],
108
- define_macros = [("NPY_NO_DEPRECATED_API" , None ), ("PY_ARRAY_UNIQUE_SYMBOL" , "mkl_fft_ext" )]
80
+ define_macros = [("NPY_NO_DEPRECATED_API" , None ), ("PY_ARRAY_UNIQUE_SYMBOL" , "mkl_fft_ext" )],
109
81
)
110
82
]
111
83
112
-
113
84
setup (
114
- name = "mkl_fft" ,
115
- maintainer = "Intel Corp." ,
116
- maintainer_email = "[email protected] " ,
117
- description = "MKL-based FFT transforms for NumPy arrays" ,
118
- version = version ,
119
85
cmdclass = {'build_ext' : Cython .Build .build_ext },
120
- packages = [
121
- "mkl_fft" ,
122
- "mkl_fft.interfaces" ,
123
- ],
124
- package_data = {"mkl_fft" : ["tests/*.py" ]},
125
- include_package_data = True ,
126
86
ext_modules = extensions (),
127
87
zip_safe = False ,
128
- long_description = long_description ,
129
- long_description_content_type = "text/markdown" ,
130
- url = "http://github.com/IntelPython/mkl_fft" ,
131
- author = "Intel Corporation" ,
132
- download_url = "http://github.com/IntelPython/mkl_fft" ,
133
- license = "BSD" ,
134
- classifiers = [_f for _f in CLASSIFIERS .split ('\n ' ) if _f ],
135
- platforms = ["Windows" , "Linux" , "Mac OS-X" ],
136
- test_suite = "pytest" ,
137
- python_requires = '>=3.7' ,
138
- setup_requires = ["Cython" ,],
139
- install_requires = ["numpy >=1.16" , "mkl" ],
140
- keywords = ["DFTI" , "FFT" , "Fourier" , "MKL" ,],
141
88
)
0 commit comments