From f2121dc67c9ad034fa3d39058264456131e21d6a Mon Sep 17 00:00:00 2001 From: Liang Yan Date: Fri, 21 Jul 2023 10:13:18 +0800 Subject: [PATCH 1/3] DOC: Fix doc build warning for random. (cherry picked from commit 464c03fc2b7d5aee33c0721f7e4ccf83e8a4fbc2) --- doc/source/reference/random/examples/cython/index.rst | 6 +++++- .../examples/cython/{setup.py.rst => meson.build.rst} | 6 +++--- 2 files changed, 8 insertions(+), 4 deletions(-) rename doc/source/reference/random/examples/cython/{setup.py.rst => meson.build.rst} (68%) diff --git a/doc/source/reference/random/examples/cython/index.rst b/doc/source/reference/random/examples/cython/index.rst index 368f5fcd5676..ffe0425ebad7 100644 --- a/doc/source/reference/random/examples/cython/index.rst +++ b/doc/source/reference/random/examples/cython/index.rst @@ -4,8 +4,12 @@ Extending `numpy.random` via Cython ----------------------------------- +.. _note: + +Starting with NumPy 1.26.0, Meson is the default build system for NumPy. +See :ref:`distutils-status-migration`. .. toctree:: - setup.py.rst + meson.build.rst extending.pyx extending_distributions.pyx diff --git a/doc/source/reference/random/examples/cython/setup.py.rst b/doc/source/reference/random/examples/cython/meson.build.rst similarity index 68% rename from doc/source/reference/random/examples/cython/setup.py.rst rename to doc/source/reference/random/examples/cython/meson.build.rst index bc7a74c59382..ed4fd9b6a2d4 100644 --- a/doc/source/reference/random/examples/cython/setup.py.rst +++ b/doc/source/reference/random/examples/cython/meson.build.rst @@ -1,5 +1,5 @@ -setup.py --------- +meson.build +----------- -.. literalinclude:: ../../../../../../numpy/random/_examples/cython/setup.py +.. literalinclude:: ../../../../../../numpy/random/_examples/cython/meson.build :language: python From 44fe37c1e23a6f4a397822cbfa532a110eef2d9a Mon Sep 17 00:00:00 2001 From: Ralf Gommers Date: Fri, 15 Sep 2023 17:38:49 +0200 Subject: [PATCH 2/3] DOC: fix two cross-references to SciPy docs in "building from source" --- doc/source/user/building.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/source/user/building.rst b/doc/source/user/building.rst index c3fa350a74e4..3c728f99cc5c 100644 --- a/doc/source/user/building.rst +++ b/doc/source/user/building.rst @@ -51,7 +51,7 @@ Building NumPy requires the following software installed: can be used, including optimized LAPACK libraries such as OpenBLAS or MKL. The choice and location of these libraries as well as include paths and other such build options can be specified in a ``.pc`` file, as documented in - :ref:`scipy:using-pkg-config-to-detect-libraries-in-a-nonstandard-location`. + :ref:`scipy:building-blas-and-lapack`. 4) Cython @@ -138,7 +138,7 @@ file. Cross compilation ----------------- -For cross compilation instructions, see :doc:`scipy:cross_compilation` and the -`Meson documentation `_. +For cross compilation instructions, see :doc:`scipy:building/cross_compilation` +and the `Meson documentation `_. .. _meson: https://mesonbuild.com/Cross-compilation.html#cross-compilation From 4893b24867f0bba433f9f55feb74f9b657e4a015 Mon Sep 17 00:00:00 2001 From: Ralf Gommers Date: Fri, 15 Sep 2023 17:54:17 +0200 Subject: [PATCH 3/3] DEV: improve `spin docs` command Explain how to build a zipfile of the html docs for release purposes. Remove --install-deps, as that is bad practice and `pip` invocations for dependencies should not be present in this CLI. Closes gh-24713 --- .spin/cmds.py | 16 +++++----------- doc/HOWTO_RELEASE.rst | 9 ++++----- 2 files changed, 9 insertions(+), 16 deletions(-) diff --git a/.spin/cmds.py b/.spin/cmds.py index 656625afe2a9..ea994c38311e 100644 --- a/.spin/cmds.py +++ b/.spin/cmds.py @@ -75,13 +75,8 @@ def build(ctx, meson_args, jobs=None, clean=False, verbose=False): default="auto", help="Number of parallel build jobs" ) -@click.option( - "--install-deps/--no-install-deps", - default=False, - help="Install dependencies before building" -) @click.pass_context -def docs(ctx, sphinx_target, clean, first_build, jobs, install_deps): +def docs(ctx, sphinx_target, clean, first_build, jobs): """📖 Build Sphinx documentation By default, SPHINXOPTS="-W", raising errors on warnings. @@ -97,13 +92,12 @@ def docs(ctx, sphinx_target, clean, first_build, jobs, install_deps): spin docs TARGET - """ - if sphinx_target not in ('targets', 'help'): - if install_deps: - util.run(['pip', 'install', '-q', '-r', 'doc_requirements.txt']) + E.g., to build a zipfile of the html docs for distribution: + + spin docs dist + """ meson.docs.ignore_unknown_options = True - del ctx.params['install_deps'] ctx.forward(meson.docs) diff --git a/doc/HOWTO_RELEASE.rst b/doc/HOWTO_RELEASE.rst index 032d51780e9d..d4dbb504ea5d 100644 --- a/doc/HOWTO_RELEASE.rst +++ b/doc/HOWTO_RELEASE.rst @@ -100,12 +100,11 @@ github actions. Building docs ------------- -We are no longer building ``PDF`` files. All that will be needed is +We are no longer building pdf files, only html docs. The ``numpy-html.zip`` +needed to upload to the doc server can be built with ``spin docs dist``. -- virtualenv (pip). - -The other requirements will be filled automatically during the documentation -build process. +To install the necessary doc build dependencies into your development +environment, run ``pip install -r doc_requirements.txt``. Uploading to PyPI