2424# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
2525# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2626
27- import io
27+ import sys
2828import os
29- import re
3029from os .path import join
3130import Cython .Build
3231from setuptools import setup , Extension
3332import 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 ()
4133
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
6436
6537def extensions ():
6638 mkl_root = os .environ .get ('MKLROOT' , None )
@@ -80,8 +52,8 @@ def extensions():
8052 mkl_library_dirs = mkl_info .get ('library_dirs' , [])
8153 mkl_libraries = mkl_info .get ('libraries' , ['mkl_rt' ])
8254
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" )
8557 src_processed = process_c_file (mklfft_templ )
8658
8759 with open (processed_mklfft_fn , 'w' ) as fid :
@@ -90,52 +62,27 @@ def extensions():
9062 return [
9163 Extension (
9264 "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" ),
9668 ],
9769 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" )
10072 ],
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 ,
10274 libraries = mkl_libraries ,
10375 library_dirs = mkl_library_dirs ,
10476 extra_compile_args = [
10577 '-DNDEBUG' ,
10678 # '-ggdb', '-O0', '-Wall', '-Wextra', '-DDEBUG',
10779 ],
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" )],
10981 )
11082 ]
11183
112-
11384setup (
114- name = "mkl_fft" ,
115- maintainer = "Intel Corp." ,
116- maintainer_email = "scripting@intel.com" ,
117- description = "MKL-based FFT transforms for NumPy arrays" ,
118- version = version ,
11985 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 ,
12686 ext_modules = extensions (),
12787 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" ,],
14188)
0 commit comments