26
26
27
27
import os
28
28
import sys
29
- import io
30
- import re
31
29
from os .path import join
32
30
import Cython .Build
33
31
from setuptools import setup , Extension
34
32
import numpy as np
35
33
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
65
35
66
36
67
37
def extensions ():
@@ -101,23 +71,23 @@ def extensions():
101
71
exts = [
102
72
Extension (
103
73
"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" ),
108
78
],
109
79
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" )
113
83
],
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 ,
115
85
libraries = libs ,
116
86
library_dirs = lib_dirs ,
117
87
extra_compile_args = eca + [
118
88
# "-ggdb", "-O0", "-Wall", "-Wextra",
119
89
],
120
- define_macros = defs + [("NDEBUG" ,None ), ], # [("DEBUG", None),]
90
+ define_macros = defs + [("NDEBUG" , None )], # [("DEBUG", None),]
121
91
language = "c++"
122
92
)
123
93
]
@@ -126,36 +96,7 @@ def extensions():
126
96
127
97
128
98
setup (
129
- name = "mkl_random" ,
130
- maintainer = "Intel Corp." ,
131
- maintainer_email = "[email protected] " ,
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 (),
136
99
cmdclass = {'build_ext' : Cython .Build .build_ext },
100
+ ext_modules = extensions (),
137
101
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" ,],
161
102
)
0 commit comments