|
1 | | -#!/usr/bin/env python |
2 | | -# Copyright (c) 2019-2023, Intel Corporation |
| 1 | +# Copyright (c) 2019-2025, Intel Corporation |
3 | 2 | # |
4 | 3 | # Redistribution and use in source and binary forms, with or without |
5 | 4 | # modification, are permitted provided that the following conditions are met: |
|
25 | 24 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | 25 |
|
27 | 26 | import importlib.machinery |
28 | | -import io |
29 | 27 | import os |
30 | | -import re |
| 28 | +import sys |
31 | 29 | from distutils.dep_util import newer |
32 | | -from _vendored.conv_template import process_file as process_c_file |
33 | | -from os import (getcwd, environ, makedirs) |
34 | | -from os.path import join, exists, abspath, dirname |
35 | | -from setuptools import Extension |
| 30 | +from os import makedirs |
| 31 | +from os.path import join, exists, dirname |
36 | 32 |
|
37 | 33 | import skbuild |
38 | 34 | import skbuild.setuptools_wrap |
39 | 35 | import skbuild.utils |
40 | | -from skbuild.command.build_py import build_py as _skbuild_build_py |
41 | | -from skbuild.command.install import install as _skbuild_install |
42 | | - |
43 | | -# import versioneer |
44 | | - |
45 | | -with io.open('mkl_umath/_version.py', 'rt', encoding='utf8') as f: |
46 | | - version = re.search(r'__version__ = \'(.*?)\'', f.read()).group(1) |
47 | | - |
48 | | -with open("README.md", "r", encoding="utf-8") as file: |
49 | | - long_description = file.read() |
50 | | - |
51 | | -VERSION = version |
52 | | - |
53 | | -CLASSIFIERS = """\ |
54 | | -Development Status :: 5 - Production/Stable |
55 | | -Intended Audience :: Science/Research |
56 | | -Intended Audience :: Developers |
57 | | -License :: OSI Approved |
58 | | -Programming Language :: C |
59 | | -Programming Language :: Python |
60 | | -Programming Language :: Python :: 3.6 |
61 | | -Programming Language :: Python :: 3.7 |
62 | | -Programming Language :: Python :: 3.8 |
63 | | -Programming Language :: Python :: Implementation :: CPython |
64 | | -Topic :: Software Development |
65 | | -Topic :: Scientific/Engineering |
66 | | -Operating System :: Microsoft :: Windows |
67 | | -Operating System :: POSIX |
68 | | -Operating System :: Unix |
69 | | -Operating System :: MacOS |
70 | | -""" |
| 36 | + |
| 37 | +sys.path.insert(0, os.path.dirname(__file__)) # Ensures local imports work |
| 38 | +from _vendored.conv_template import process_file as process_c_file |
71 | 39 |
|
72 | 40 |
|
| 41 | +# TODO: rewrite generation in CMake, see NumPy meson implementation |
| 42 | +# https://github.com/numpy/numpy/blob/c6fb3357541fd8cf6e4faeaeda3b1a9065da0520/numpy/_core/meson.build#L623 |
73 | 43 | def load_module(name, fn): |
74 | 44 | """ |
75 | 45 | Credit: numpy.compat.npy_load_module |
@@ -127,28 +97,9 @@ def generate_umath_c(build_dir): |
127 | 97 |
|
128 | 98 |
|
129 | 99 | skbuild.setup( |
130 | | - name="mkl_umath", |
131 | | - version=VERSION, |
132 | | - maintainer = "Intel Corp.", |
133 | | - maintainer_email = "[email protected]", |
134 | | - description = "MKL-based universal functions for NumPy arrays", |
135 | | - long_description = long_description, |
136 | | - long_description_content_type="text/markdown", |
137 | | - license = 'BSD', |
138 | | - author="Intel Corporation", |
139 | | - url="http://github.com/IntelPython/mkl_umath", |
140 | | - download_url="http://github.com/IntelPython/mkl_umath", |
141 | 100 | packages=[ |
142 | 101 | "mkl_umath", |
143 | 102 | ], |
144 | 103 | package_data={"mkl_umath": ["tests/*.*"]}, |
145 | 104 | include_package_data=True, |
146 | | - zip_safe=False, |
147 | | - setup_requires=["Cython"], |
148 | | - install_requires=[ |
149 | | - "numpy", |
150 | | - ], |
151 | | - keywords="mkl_umath", |
152 | | - classifiers=[_f for _f in CLASSIFIERS.split("\n") if _f], |
153 | | - platforms=["Linux", "Windows"] |
154 | 105 | ) |
0 commit comments