-
Notifications
You must be signed in to change notification settings - Fork 6
Migrate from setup.py
to pyproject toml
#63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
09ce2c7
Add pyproject.toml and move meta-data there
ndgrigorian 51ffe83
Update build instructions
ndgrigorian e60c086
Use setuptools.modified instead of distutils
ndgrigorian 2958200
Clean up redundant namespace in setup.py
ndgrigorian cd8ac18
Update build instructions per review
ndgrigorian bdb314d
Remove unused imports from setup.py
ndgrigorian File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
# Copyright (c) 2025, Intel Corporation | ||
# | ||
# Redistribution and use in source and binary forms, with or without | ||
# modification, are permitted provided that the following conditions are met: | ||
# | ||
# * Redistributions of source code must retain the above copyright notice, | ||
# this list of conditions and the following disclaimer. | ||
# * Redistributions in binary form must reproduce the above copyright | ||
# notice, this list of conditions and the following disclaimer in the | ||
# documentation and/or other materials provided with the distribution. | ||
# * Neither the name of Intel Corporation nor the names of its contributors | ||
# may be used to endorse or promote products derived from this software | ||
# without specific prior written permission. | ||
# | ||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE | ||
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | ||
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | ||
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | ||
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
|
||
[build-system] | ||
build-backend = "setuptools.build_meta" | ||
requires = [ | ||
"cmake", | ||
"ninja", | ||
"scikit-build", | ||
"setuptools>=77", | ||
"Cython", | ||
"numpy" | ||
] | ||
|
||
[project] | ||
authors = [ | ||
{name = "Intel Corporation", email = "[email protected]"} | ||
] | ||
classifiers = [ | ||
"Development Status :: 5 - Production/Stable", | ||
"Intended Audience :: Science/Research", | ||
"Intended Audience :: Developers", | ||
"Programming Language :: C", | ||
ndgrigorian marked this conversation as resolved.
Show resolved
Hide resolved
|
||
"Programming Language :: Python", | ||
"Programming Language :: Python :: 3", | ||
"Programming Language :: Python :: 3.9", | ||
"Programming Language :: Python :: 3.10", | ||
"Programming Language :: Python :: 3.11", | ||
"Programming Language :: Python :: 3.12", | ||
"Programming Language :: Python :: Implementation :: CPython", | ||
"Topic :: Software Development", | ||
"Topic :: Scientific/Engineering", | ||
"Operating System :: Microsoft :: Windows", | ||
"Operating System :: POSIX", | ||
"Operating System :: Unix" | ||
] | ||
dependencies = ["numpy >=1.26.4", "mkl-service"] | ||
description = "Intel (R) MKL-based universal functions for NumPy arrays" | ||
dynamic = ["version"] | ||
keywords = ["mkl_umath"] | ||
license = "BSD-3-Clause" | ||
name = "mkl_umath" | ||
readme = {file = "README.md", content-type = "text/markdown"} | ||
requires-python = ">=3.9,<3.13" | ||
|
||
|
||
[project.optional-dependencies] | ||
test = ["pytest"] | ||
|
||
[project.urls] | ||
Download = "http://github.com/IntelPython/mkl_umath" | ||
Homepage = "http://github.com/IntelPython/mkl_umath" | ||
|
||
[tool.setuptools.dynamic] | ||
version = {attr = "mkl_umath._version.__version__"} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
#!/usr/bin/env python | ||
# Copyright (c) 2019-2023, Intel Corporation | ||
# Copyright (c) 2019-2025, Intel Corporation | ||
# | ||
# Redistribution and use in source and binary forms, with or without | ||
# modification, are permitted provided that the following conditions are met: | ||
|
@@ -25,51 +24,19 @@ | |
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
|
||
import importlib.machinery | ||
import io | ||
import os | ||
import re | ||
from distutils.dep_util import newer | ||
from _vendored.conv_template import process_file as process_c_file | ||
from os import (getcwd, environ, makedirs) | ||
from os.path import join, exists, abspath, dirname | ||
from setuptools import Extension | ||
import sys | ||
from setuptools.modified import newer | ||
from os import makedirs | ||
from os.path import join, exists, dirname | ||
|
||
import skbuild | ||
import skbuild.setuptools_wrap | ||
import skbuild.utils | ||
from skbuild.command.build_py import build_py as _skbuild_build_py | ||
from skbuild.command.install import install as _skbuild_install | ||
|
||
# import versioneer | ||
|
||
with io.open('mkl_umath/_version.py', 'rt', encoding='utf8') as f: | ||
version = re.search(r'__version__ = \'(.*?)\'', f.read()).group(1) | ||
|
||
with open("README.md", "r", encoding="utf-8") as file: | ||
long_description = file.read() | ||
|
||
VERSION = version | ||
|
||
CLASSIFIERS = """\ | ||
Development Status :: 5 - Production/Stable | ||
Intended Audience :: Science/Research | ||
Intended Audience :: Developers | ||
License :: OSI Approved | ||
Programming Language :: C | ||
Programming Language :: Python | ||
Programming Language :: Python :: 3.6 | ||
Programming Language :: Python :: 3.7 | ||
Programming Language :: Python :: 3.8 | ||
Programming Language :: Python :: Implementation :: CPython | ||
Topic :: Software Development | ||
Topic :: Scientific/Engineering | ||
Operating System :: Microsoft :: Windows | ||
Operating System :: POSIX | ||
Operating System :: Unix | ||
Operating System :: MacOS | ||
""" | ||
|
||
sys.path.insert(0, dirname(__file__)) # Ensures local imports work | ||
from _vendored.conv_template import process_file as process_c_file | ||
|
||
|
||
# TODO: rewrite generation in CMake, see NumPy meson implementation | ||
# https://github.com/numpy/numpy/blob/c6fb3357541fd8cf6e4faeaeda3b1a9065da0520/numpy/_core/meson.build#L623 | ||
def load_module(name, fn): | ||
""" | ||
Credit: numpy.compat.npy_load_module | ||
|
@@ -127,28 +94,9 @@ def generate_umath_c(build_dir): | |
|
||
|
||
skbuild.setup( | ||
name="mkl_umath", | ||
version=VERSION, | ||
maintainer = "Intel Corp.", | ||
maintainer_email = "[email protected]", | ||
description = "MKL-based universal functions for NumPy arrays", | ||
long_description = long_description, | ||
long_description_content_type="text/markdown", | ||
license = 'BSD', | ||
author="Intel Corporation", | ||
url="http://github.com/IntelPython/mkl_umath", | ||
download_url="http://github.com/IntelPython/mkl_umath", | ||
packages=[ | ||
"mkl_umath", | ||
], | ||
package_data={"mkl_umath": ["tests/*.*"]}, | ||
include_package_data=True, | ||
zip_safe=False, | ||
setup_requires=["Cython"], | ||
install_requires=[ | ||
"numpy", | ||
], | ||
keywords="mkl_umath", | ||
classifiers=[_f for _f in CLASSIFIERS.split("\n") if _f], | ||
platforms=["Linux", "Windows"] | ||
) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.