2626
2727import os
2828import sys
29- import io
30- import re
3129from os .path import join
3230import Cython .Build
3331from setuptools import setup , Extension
3432import numpy as np
3533
36-
37- with io .open ('mkl_random/_version.py' , 'rt' , encoding = 'utf8' ) as f :
38- version = re .search (r'__version__ = \'(.*?)\'' , f .read ()).group (1 )
39-
40- with open ("README.md" , "r" , encoding = "utf-8" ) as file :
41- long_description = file .read ()
42-
43- VERSION = version
44-
45- CLASSIFIERS = CLASSIFIERS = """\
46- Development Status :: 5 - Production/Stable
47- Intended Audience :: Science/Research
48- Intended Audience :: Developers
49- License :: OSI Approved
50- Programming Language :: C
51- Programming Language :: Python
52- Programming Language :: Python :: 3
53- Programming Language :: Python :: 3.9
54- Programming Language :: Python :: 3.10
55- Programming Language :: Python :: 3.11
56- Programming Language :: Python :: 3.12
57- Programming Language :: Python :: Implementation :: CPython
58- Topic :: Software Development
59- Topic :: Scientific/Engineering
60- Operating System :: Microsoft :: Windows
61- Operating System :: POSIX
62- Operating System :: Unix
63- Operating System :: MacOS
64- """
34+ sys .path .insert (0 , os .path .dirname (__file__ )) # Ensures local imports work
6535
6636
6737def extensions ():
@@ -101,23 +71,23 @@ def extensions():
10171 exts = [
10272 Extension (
10373 "mkl_random.mklrand" ,
104- [
105- os . path . join ("mkl_random" , "mklrand.pyx" ),
106- os . path . join ("mkl_random" , "src" , "mkl_distributions.cpp" ),
107- os . path . join ("mkl_random" , "src" , "randomkit.cpp" ),
74+ sources = [
75+ join ("mkl_random" , "mklrand.pyx" ),
76+ join ("mkl_random" , "src" , "mkl_distributions.cpp" ),
77+ join ("mkl_random" , "src" , "randomkit.cpp" ),
10878 ],
10979 depends = [
110- os . path . join ("mkl_random" , "src" , "mkl_distributions.hpp" ),
111- os . path . join ("mkl_random" , "src" , "randomkit.h" ),
112- os . path . join ("mkl_random" , "src" , "numpy_multiiter_workaround.h" )
80+ join ("mkl_random" , "src" , "mkl_distributions.hpp" ),
81+ join ("mkl_random" , "src" , "randomkit.h" ),
82+ join ("mkl_random" , "src" , "numpy_multiiter_workaround.h" )
11383 ],
114- include_dirs = [os . path . join ("mkl_random" , "src" ), np .get_include ()] + mkl_include_dirs ,
84+ include_dirs = [join ("mkl_random" , "src" ), np .get_include ()] + mkl_include_dirs ,
11585 libraries = libs ,
11686 library_dirs = lib_dirs ,
11787 extra_compile_args = eca + [
11888 # "-ggdb", "-O0", "-Wall", "-Wextra",
11989 ],
120- define_macros = defs + [("NDEBUG" ,None ), ], # [("DEBUG", None),]
90+ define_macros = defs + [("NDEBUG" , None )], # [("DEBUG", None),]
12191 language = "c++"
12292 )
12393 ]
@@ -126,36 +96,7 @@ def extensions():
12696
12797
12898setup (
129- name = "mkl_random" ,
130- maintainer = "Intel Corp." ,
131- maintainer_email = "scripting@intel.com" ,
132- description = "NumPy-based Python interface to Intel (R) MKL Random Number Generation functionality" ,
133- version = version ,
134- include_package_data = True ,
135- ext_modules = extensions (),
13699 cmdclass = {'build_ext' : Cython .Build .build_ext },
100+ ext_modules = extensions (),
137101 zip_safe = False ,
138- long_description = long_description ,
139- long_description_content_type = "text/markdown" ,
140- url = "http://github.com/IntelPython/mkl_random" ,
141- author = "Intel Corporation" ,
142- download_url = "http://github.com/IntelPython/mkl_random" ,
143- license = "BSD" ,
144- classifiers = [_f for _f in CLASSIFIERS .split ('\n ' ) if _f ],
145- platforms = ["Windows" , "Linux" , "Mac OS-X" ],
146- test_suite = "pytest" ,
147- python_requires = '>=3.7' ,
148- setup_requires = ["Cython" ,],
149- install_requires = ["numpy >=1.16" ],
150- packages = [
151- "mkl_random" ,
152- ],
153- package_data = {
154- "mkl_random" : [
155- "tests/*.*" ,
156- ]
157- },
158- keywords = ["MKL" , "VSL" , "true randomness" , "pseudorandomness" ,
159- "Philox" , "MT-19937" , "SFMT-19937" , "MT-2203" , "ARS-5" ,
160- "R-250" , "MCG-31" ,],
161102)
0 commit comments