Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0f39fd2

Browse files
committed
BLD: update licensing metadata to use PEP 639
1 parent 622f874 commit 0f39fd2

6 files changed

Lines changed: 78 additions & 49 deletions

File tree

LICENSES_bundled.txt

Lines changed: 0 additions & 36 deletions
This file was deleted.

meson.build

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
project(
22
'NumPy',
33
'c', 'cpp', 'cython',
4-
version: run_command(
5-
# This should become `numpy/_version.py` in NumPy 2.0
6-
['numpy/_build_utils/gitversion.py'],
7-
check: true).stdout().strip(),
8-
license: 'BSD-3',
9-
meson_version: '>=1.5.2', # version in vendored-meson is 1.5.2
4+
version: run_command(['numpy/_build_utils/gitversion.py'], check: true).stdout().strip(),
5+
license: 'BSD-3-Clause AND 0BSD AND MIT AND Zlib AND CC0-1.0',
6+
meson_version: '>=1.8.3', # version in vendored-meson
107
default_options: [
118
'buildtype=debugoptimized',
129
'b_ndebug=if-release',
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
Copyright (c) 2014 Ryan Juckett
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy
4+
of this software and associated documentation files (the "Software"), to
5+
deal in the Software without restriction, including without limitation the
6+
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
7+
sell copies of the Software, and to permit persons to whom the Software is
8+
furnished to do so, subject to the following conditions:
9+
10+
The above copyright notice and this permission notice shall be included in
11+
all copies or substantial portions of the Software.
12+
13+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
18+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
19+
IN THE SOFTWARE.
20+
21+
dragon4.c|h h contains a modified version of Ryan Juckett's Dragon4
22+
implementation, obtained from https://www.ryanjuckett.com,
23+
which has been ported from C++ to C and which has
24+
modifications specific to printing floats in numpy.
25+
26+
Ryan Juckett's original code was under the Zlib license; he gave numpy
27+
permission to include it under the MIT license instead.

pyproject.toml

Lines changed: 47 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,13 @@
11
[build-system]
22
build-backend = "mesonpy"
33
requires = [
4-
"meson-python>=0.15.0",
4+
"meson-python>=0.18.0",
55
"Cython>=3.0.6", # keep in sync with version check in meson.build
66
]
77

88
[project]
99
name = "numpy"
1010
version = "2.4.0.dev0"
11-
# TODO: add `license-files` once PEP 639 is accepted (see meson-python#88)
12-
license = {file = "LICENSE.txt"}
13-
1411
description = "Fundamental package for array computing in Python"
1512
authors = [{name = "Travis E. Oliphant et al."}]
1613
maintainers = [
@@ -22,7 +19,6 @@ classifiers = [
2219
'Development Status :: 5 - Production/Stable',
2320
'Intended Audience :: Science/Research',
2421
'Intended Audience :: Developers',
25-
'License :: OSI Approved :: BSD License',
2622
'Programming Language :: C',
2723
'Programming Language :: Python',
2824
'Programming Language :: Python :: 3',
@@ -40,6 +36,52 @@ classifiers = [
4036
'Operating System :: Unix',
4137
'Operating System :: MacOS',
4238
]
39+
# License info:
40+
# - The main NumPy project license is BSD-3-Clause.
41+
# - The SPDX license expression below reflects installed numpy packages when
42+
# built from source (e.g., with `python -m build --wheel`), with no vendoring.
43+
# - That SPDX expression is therefore incomplete for:
44+
# (a) sdists - see the comment below `license-files` for other licenses
45+
# included in the sdist
46+
# (b) wheels on PyPI - most wheels include vendored libraries with additional licenses:
47+
# - libopenblas : BSD-3-Clause AND BSD-3-Clause-Attribution (all except arm64 macOS>=14)
48+
# - libgfortran : GPL-3.0-with-GCC-exception (all except arm64 macOS>=14)
49+
# - libquadmath : LGPL-2.1-or-later (all except arm64 macOS>=14 and Windows)
50+
# The licenses for these vendored components are dynamically included
51+
# in the build process for PyPI wheels.
52+
license = 'BSD-3-Clause AND 0BSD AND MIT AND Zlib AND CC0-1.0'
53+
license-files = [
54+
'LICENSE.txt', # BSD-3-Clause
55+
'numpy/_core/include/numpy/libdivide/LICENSE.txt', # Zlib
56+
'numpy/_core/src/common/pythoncapi-compat/COPYING', # 0BSD
57+
'numpy/_core/src/highway/LICENSE-BSD3', # BSD-3-Clause
58+
'numpy/_core/src/multiarray/dragon4_LICENSE.txt', # MIT
59+
'numpy/_core/src/npysort/x86-simd-sort/LICENSE.md', # BSD-3-Clause
60+
'numpy/_core/src/umath/svml/LICENSE', # BSD-3-Clause
61+
'numpy/fft/pocketfft/LICENSE.md', # BSD-3-Clause
62+
'numpy/ma/LICENSE', # BSD-3-Clause
63+
'numpy/linalg/lapack_lite/LICENSE.txt', # BSD-3-Clause
64+
'numpy/random/LICENSE.md', # BSD-3-Clause
65+
'numpy/random/src/distributions/LICENSE.md', # BSD-3-Clause AND MIT
66+
'numpy/random/src/mt19937/LICENSE.md', # BSD-3-Clause AND MIT
67+
'numpy/random/src/pcg64/LICENSE.md', # MIT
68+
'numpy/random/src/philox/LICENSE.md', # BSD-3-Clause
69+
'numpy/random/src/sfc64/LICENSE.md', # MIT
70+
'numpy/random/src/splitmix64/LICENSE.md', # CC0-1.0
71+
]
72+
# The license files below apply only to files in the repo and sdist, not to
73+
# installed `numpy` packages or wheels (build/doc tools don't affect the
74+
# license of the installed package). We have to make a choice whether to add
75+
# those to the SPDX expression above since PEP 639 is unclear on the
76+
# differences; we choose to make the SPDX expression reflect *a wheel built
77+
# from the sources*.
78+
# '.spin/LICENSE', # BSD-3-Clause
79+
# 'doc/source/_static/scipy-mathjax/LICENSE', # Apache-2.0
80+
# 'numpy/_build_utils/tempita/LICENSE.txt', # BSD-3-Clause
81+
# 'vendored-meson/meson/COPYING', # Apache-2.0
82+
# Note that the commented out license files are still included in the sdist,
83+
# just not in Core Metadata and in the .dist-info directory.
84+
4385

4486
[project.scripts]
4587
f2py = 'numpy.f2py.f2py2e:main'

tools/wheels/check_license.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def main():
3838
distinfo_path = next(iter(sitepkgs.glob("numpy-*.dist-info")))
3939

4040
# Check license text
41-
license_txt = distinfo_path / "LICENSE.txt"
41+
license_txt = distinfo_path / "licenses" / "LICENSE.txt"
4242
with open(license_txt, encoding="utf-8") as f:
4343
text = f.read()
4444

tools/wheels/cibw_before_build.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ rm -rf build
1010
echo "" >> $PROJECT_DIR/LICENSE.txt
1111
echo "----" >> $PROJECT_DIR/LICENSE.txt
1212
echo "" >> $PROJECT_DIR/LICENSE.txt
13-
cat $PROJECT_DIR/LICENSES_bundled.txt >> $PROJECT_DIR/LICENSE.txt
1413
if [[ $RUNNER_OS == "Linux" ]] ; then
1514
cat $PROJECT_DIR/tools/wheels/LICENSE_linux.txt >> $PROJECT_DIR/LICENSE.txt
1615
elif [[ $RUNNER_OS == "macOS" ]]; then

0 commit comments

Comments
 (0)