Files
numpy/pyproject.toml
2026-10-23 23:59:18 +02:00

455 lines
14 KiB
TOML

[build-system]
build-backend = "mesonpy"
requires = [
"meson-python>=0.20.0",
"Cython>=3.1.0", # keep in sync with version check in meson.build, and the `build` dependency group below
]
[project]
name = "numpy"
version = "2.6.0.dev0"
description = "Fundamental package for array computing in Python"
authors = [{name = "Travis E. Oliphant et al."}]
maintainers = [
{name = "NumPy Developers", email="numpy-discussion@python.org"},
]
requires-python = ">=3.12"
readme = "README.md"
classifiers = [
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Science/Research',
'Intended Audience :: Developers',
'Programming Language :: C',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.12',
'Programming Language :: Python :: 3.13',
'Programming Language :: Python :: 3.14',
'Programming Language :: Python :: 3 :: Only',
'Programming Language :: Python :: Implementation :: CPython',
'Topic :: Software Development',
'Topic :: Scientific/Engineering',
'Typing :: Typed',
'Operating System :: Microsoft :: Windows',
'Operating System :: POSIX',
'Operating System :: Unix',
'Operating System :: MacOS',
]
# License info:
# - The main NumPy project license is BSD-3-Clause.
# - The SPDX license expression below reflects installed numpy packages when
# built from source (e.g., with `python -m build --wheel`), with no vendoring.
# - That SPDX expression is therefore incomplete for:
# (a) sdists - see the comment below `license-files` for other licenses
# included in the sdist
# (b) wheels on PyPI - most wheels include vendored libraries with additional licenses:
# - libopenblas : BSD-3-Clause AND BSD-3-Clause-Attribution (all except arm64 macOS>=14)
# - libgfortran : GPL-3.0-with-GCC-exception (all except arm64 macOS>=14)
# The licenses for these vendored components are dynamically included
# in the build process for PyPI wheels.
license = 'BSD-3-Clause AND 0BSD AND MIT AND CC0-1.0'
license-files = [
'LICENSE.txt', # BSD-3-Clause
'numpy/_core/src/common/pythoncapi-compat/COPYING', # 0BSD
'numpy/_core/src/highway/LICENSE', # Dual-licensed: Apache 2.0 or BSD 3-Clause
'numpy/_core/src/multiarray/dragon4_LICENSE.txt', # MIT
'numpy/_core/src/npysort/x86-simd-sort/LICENSE.md', # BSD-3-Clause
'numpy/_core/src/umath/svml/LICENSE', # BSD-3-Clause
'numpy/fft/pocketfft/LICENSE.md', # BSD-3-Clause
'numpy/ma/LICENSE', # BSD-3-Clause
'numpy/linalg/lapack_lite/LICENSE.txt', # BSD-3-Clause
'numpy/random/LICENSE.md', # BSD-3-Clause
'numpy/random/src/distributions/LICENSE.md', # BSD-3-Clause AND MIT
'numpy/random/src/mt19937/LICENSE.md', # BSD-3-Clause AND MIT
'numpy/random/src/pcg64/LICENSE.md', # MIT
'numpy/random/src/philox/LICENSE.md', # BSD-3-Clause
'numpy/random/src/sfc64/LICENSE.md', # MIT
'numpy/random/src/splitmix64/LICENSE.md', # CC0-1.0
]
# The license files below apply only to files in the repo and sdist, not to
# installed `numpy` packages or wheels (build/doc tools don't affect the
# license of the installed package). We have to make a choice whether to add
# those to the SPDX expression above since PEP 639 is unclear on the
# differences; we choose to make the SPDX expression reflect *a wheel built
# from the sources*.
# '.spin/LICENSE', # BSD-3-Clause
# 'doc/source/_static/scipy-mathjax/LICENSE', # Apache-2.0
# 'numpy/_build_utils/tempita/LICENSE.txt', # BSD-3-Clause
# 'vendored-meson/meson/COPYING', # Apache-2.0
# Note that the commented out license files are still included in the sdist,
# just not in Core Metadata and in the .dist-info directory.
[project.scripts]
f2py = 'numpy.f2py.f2py2e:main'
numpy-config = 'numpy._configtool:main'
[project.entry-points.pkg_config]
numpy = 'numpy._core.lib.pkgconfig'
[project.entry-points.array_api]
numpy = 'numpy'
[project.entry-points.pyinstaller40]
hook-dirs = 'numpy:_pyinstaller_hooks_dir'
[project.urls]
homepage = "https://numpy.org"
documentation = "https://numpy.org/doc/"
source = "https://github.com/numpy/numpy"
download = "https://pypi.org/project/numpy/#files"
tracker = "https://github.com/numpy/numpy/issues"
"release notes" = "https://numpy.org/doc/stable/release"
changelog = "https://github.com/numpy/numpy/tree/main/doc/changelog"
###########################################################
[dependency-groups]
build = [
"meson-python>=0.20.0",
"Cython>=3.1.0",
"ninja",
]
dev-cli = [
{ include-group = "build" },
"spin",
"build"
]
openblas32 = [
"scipy-openblas32==0.3.34.237.2",
'pkgconf==2.5.1.post1; sys_platform == "win32"',
]
openblas64 = [
"scipy-openblas64==0.3.34.237.2",
'pkgconf==2.5.1.post1; sys_platform == "win32"',
]
test-core = [
"pytest==9.1.1",
"pytest-xdist",
"pytest-timeout",
"tzdata",
]
test-extending = [ # includes tests that build extensions / f2py
{ include-group = "test-core" },
"Cython",
"meson",
'ninja; sys_platform != "emscripten"',
"charset-normalizer",
"pytest-cov==7.1.0",
'numpy_quaddtype; python_version < "3.15" and sys_platform == "darwin"',
]
# hypothesis is an *optional* test dependency: it supplements the deterministic
# pytest suite with property-based tests. It is kept separate from
# the other groups because recent releases ship a Rust extension that is
# hard to install on platforms without a prebuilt wheel (riscv64, win-arm64,
# ppc64le, s390x, CPython pre-releases, QEMU-emulated targets). The test suite
# skips the property-based tests when hypothesis is not installed.
hypothesis = ["hypothesis==6.168.3"]
test = [{ include-group = "test-extending" }, { include-group = "hypothesis" }]
typing = [
{ include-group = "test" },
"mypy==2.4.0",
"pyrefly==1.3.2",
]
linter = [
"cython-lint",
"ruff==0.16.10",
"GitPython==3.2.1",
"spin",
]
doc = [
# doxygen required, use apt-get or dnf
"sphinx==8.2.3",
"numpydoc==1.11.0",
"pydata-sphinx-theme",
"sphinx-copybutton",
"sphinx-design",
"scipy",
"matplotlib",
"pandas",
"breathe",
"ipython",
# Needed for ipython>=8.17
# https://github.com/ipython/ipython/issues/14237
"pickleshare",
# needed to build release notes
"towncrier",
"toml",
"scipy-doctest",
# interactive documentation utilities
# see https://github.com/jupyterlite/pyodide-kernel#compatibility
"jupyterlite-sphinx",
# Works with Pyodide 0.27.1
"jupyterlite-pyodide-kernel==0.5.2",
]
bench = [
"asv<0.6.5",
"virtualenv",
"packaging",
]
release = [
# These packages are needed for a release in addition to those needed
# for building, testing, and the creation of documentation.
# changelog.py
"pygithub",
"gitpython==3.2.0",
# uploading release documentation
"packaging",
]
all = [
{ include-group = "test" },
{ include-group = "dev-cli" },
{ include-group = "linter" },
{ include-group = "doc" },
{ include-group = "typing" },
{ include-group = "release" },
]
###########################################################
[tool.towncrier]
single_file = false
filename = "doc/source/release/notes-towncrier.rst"
directory = "doc/release/upcoming_changes/"
issue_format = "`gh-{issue} <https://github.com/numpy/numpy/pull/{issue}>`__"
template = "doc/release/upcoming_changes/template.rst"
underlines = "~="
all_bullets = false
[[tool.towncrier.type]]
directory = "highlight"
name = "Highlights"
showcontent = true
[[tool.towncrier.type]]
directory = "new_function"
name = "New functions"
showcontent = true
[[tool.towncrier.type]]
directory = "python_removal"
name = "NumPy 2.0 Python API removals"
showcontent = true
[[tool.towncrier.type]]
directory = "deprecation"
name = "Deprecations"
showcontent = true
[[tool.towncrier.type]]
directory = "future"
name = "Future Changes"
showcontent = true
[[tool.towncrier.type]]
directory = "expired"
name = "Expired deprecations"
showcontent = true
[[tool.towncrier.type]]
directory = "compatibility"
name = "Compatibility notes"
showcontent = true
[[tool.towncrier.type]]
directory = "c_api"
name = "C API changes"
showcontent = true
[[tool.towncrier.type]]
directory = "c_api_removal"
name = "NumPy 2.0 C API removals"
showcontent = true
[[tool.towncrier.type]]
directory = "new_feature"
name = "New Features"
showcontent = true
[[tool.towncrier.type]]
directory = "improvement"
name = "Improvements"
showcontent = true
[[tool.towncrier.type]]
directory = "performance"
name = "Performance improvements and changes"
showcontent = true
[[tool.towncrier.type]]
directory = "typing"
name = "Typing improvements and changes"
showcontent = true
[[tool.towncrier.type]]
directory = "change"
name = "Changes"
showcontent = true
[tool.cibuildwheel]
# Note: the below skip command doesn't do much currently, the platforms to
# build wheels for in CI are controlled in `.github/workflows/wheels.yml`.
# universal2 wheels are not supported (see gh-21233), use `delocate-fuse` if you need them
skip = ["*_i686", "*_ppc64le", "*_s390x", "*_universal2"]
before-build = "bash {project}/tools/wheels/cibw_before_build.sh {project}"
before-test = "pip install --group test"
test-command = "bash {project}/tools/wheels/cibw_test_command.sh {project}"
enable = ["cpython-prerelease"]
# The build will use openblas64 everywhere, except on arm64 macOS >=14.0 (uses Accelerate)
[tool.cibuildwheel.config-settings]
setup-args = ["-Duse-ilp64=true", "-Dallow-noblas=false"]
build-dir = "build"
[tool.cibuildwheel.android.config-settings]
# ILP64 causes many failures on Android, for unknown reasons.
setup-args = ["-Duse-ilp64=false", "-Dallow-noblas=false"]
build-dir = "build"
[tool.cibuildwheel.android.environment]
PKG_CONFIG_PATH = "$(pwd)/.openblas/chaquopy/lib/pkgconfig"
AUDITWHEEL_LD_LIBRARY_PATH = "$(pwd)/.openblas/chaquopy/lib"
[tool.cibuildwheel.ios]
# The ILP64 version of Accelerate is only available on iOS 16.4 or above.
config-settings = "setup-args=-Duse-ilp64=true setup-args=-Dallow-noblas=false build-dir=build"
# On older iOS versions, use the following configuration
# config-settings = "setup-args=-Dallow-noblas=false build-dir=build"
before-build = []
xbuild-tools = ["ninja"]
[tool.cibuildwheel.linux]
manylinux-x86_64-image = "manylinux_2_28"
manylinux-aarch64-image = "manylinux_2_28"
manylinux-riscv64-image = "manylinux_2_39"
musllinux-x86_64-image = "musllinux_1_2"
musllinux-aarch64-image = "musllinux_1_2"
[tool.cibuildwheel.linux.environment]
# RUNNER_OS is a GitHub Actions specific env var; define it here so it's
# defined when running cibuildwheel locally
RUNNER_OS="Linux"
# /project will be the $PWD equivalent inside the docker used to build the wheel
PKG_CONFIG_PATH="/project/.openblas"
[tool.cibuildwheel.windows]
config-settings = {setup-args = ["--vsenv", "-Dallow-noblas=false"], build-dir="build"}
repair-wheel-command = "bash -el ./tools/wheels/repair_windows.sh {wheel} {dest_dir}"
[[tool.cibuildwheel.overrides]]
select = ["*-win32"]
config-settings = {setup-args = ["--vsenv", "-Dallow-noblas=true"], build-dir="build"}
repair-wheel-command = ""
[[tool.cibuildwheel.overrides]]
select = ["*-android*", "*-ios*", "*-pyodide*"]
# Note: hypothesis is deliberately omitted here, as are Cython and Meson
# - we use them in regular CI only.
before-test = ""
test-requires = [
"pytest==9.1.1",
"tzdata",
"pytest-xdist",
]
# Mobile and WASM platforms can't run the cibw_test_command shell script, so they must
# run Python directly.
test-command = """
python -m pytest --pyargs numpy \
-m 'not slow' \
-W ignore::PendingDeprecationWarning \
-p no:cacheprovider
"""
[tool.cibuildwheel.pyodide]
# Pyodide ensures that the wheels are already repaired by auditwheel-emscripten
repair-wheel-command = ""
[tool.cibuildwheel.pyodide.config-settings]
build-dir = "build"
setup-args = ["--cross-file=$PWD/tools/ci/emscripten/emscripten.meson.cross", "-Dblas=none", "-Dlapack=none"]
[tool.meson-python]
meson = 'vendored-meson/meson/meson.py'
[tool.meson-python.args]
install = ['--tags=runtime,python-runtime,tests,devel']
[tool.spin]
package = 'numpy'
[tool.spin.meson]
cli = 'vendored-meson/meson/meson.py'
[tool.spin.commands]
"Build" = [
".spin/cmds.py:build",
".spin/cmds.py:test",
".spin/cmds.py:mypy",
".spin/cmds.py:pyrefly",
".spin/cmds.py:stubtest",
".spin/cmds.py:config_openblas",
".spin/cmds.py:lint",
]
"Environments" = [
"spin.cmds.meson.run",
".spin/cmds.py:ipython",
".spin/cmds.py:python",
"spin.cmds.meson.gdb",
"spin.cmds.meson.lldb"
]
"Documentation" = [
".spin/cmds.py:docs",
".spin/cmds.py:changelog",
".spin/cmds.py:notes",
".spin/cmds.py:check_docs",
".spin/cmds.py:check_tutorials",
]
"Metrics" = [".spin/cmds.py:bench"]
[tool.pyrefly]
project-includes = ["numpy/**/*.pyi"]
project-excludes = ["numpy/typing/tests/**"]
[tool.pyrefly.errors]
implicit-any = "error"
unannotated-parameter = "error"
unannotated-return = "error"
[[tool.pyrefly.sub-config]]
matches = "numpy/__init__.pyi"
errors = { bad-override = "ignore" }
[[tool.pyrefly.sub-config]]
matches = "numpy/_typing/_nbit_base.pyi"
errors = { invalid-inheritance = "ignore" }
[[tool.pyrefly.sub-config]]
matches = "numpy/ma/core.pyi"
errors = { bad-override = "ignore" }
[[tool.pyrefly.sub-config]]
matches = "numpy/matrixlib/defmatrix.pyi"
errors = { bad-override = "ignore" }