From 5a1f724b5236b9964e0e7b7f7e7871c9d9effc9b Mon Sep 17 00:00:00 2001 From: hannah Date: Wed, 22 May 2024 22:05:31 -0400 Subject: [PATCH 1/3] clarified that mypy ignores new functions --- doc/devel/coding_guide.rst | 7 +++++-- doc/devel/development_setup.rst | 6 ++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/doc/devel/coding_guide.rst b/doc/devel/coding_guide.rst index 77247ba9a3b2..59c5b69ba8d6 100644 --- a/doc/devel/coding_guide.rst +++ b/doc/devel/coding_guide.rst @@ -89,8 +89,11 @@ We generally use `stub files the type information for ``colors.py``. A notable exception is ``pyplot.py``, which is type hinted inline. -Type hints are checked by the mypy :ref:`pre-commit hook `, -can often be verified by running ``tox -e stubtest``. +Type hints can be validated by the ``stubtest`` tool, which can be run +locally using ``tox -e stubtest`` and is a part of the :ref:`automated-tests` +suite. Type hints for existing functions are also checked by the mypy +:ref:`pre-commit hook `. + New modules and files: installation =================================== diff --git a/doc/devel/development_setup.rst b/doc/devel/development_setup.rst index be99bed2fe5f..5ac78cea8c90 100644 --- a/doc/devel/development_setup.rst +++ b/doc/devel/development_setup.rst @@ -254,3 +254,9 @@ listed in ``.pre-commit-config.yaml``, against the full codebase with :: To run a particular hook manually, run ``pre-commit run`` with the hook id :: pre-commit run --all-files + + +Please note that the ``mypy`` pre-commit hook cannot check the :ref:`type-hints` +for new functions; instead the stubs for new functions are checked using the +``stubtest`` :ref:`CI check ` and can be checked locally using +``tox -e stubtest``. From 81a22be9678305c25d7557b04a88b1186dcb50ff Mon Sep 17 00:00:00 2001 From: hannah Date: Wed, 22 May 2024 22:06:48 -0400 Subject: [PATCH 2/3] clarified no-build-isolation --- doc/conf.py | 3 ++- doc/install/dependencies.rst | 15 +++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/doc/conf.py b/doc/conf.py index 92d78f896ca2..8ad643f59c5e 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -236,7 +236,8 @@ def _check_dependencies(): 'scipy': ('https://docs.scipy.org/doc/scipy/', None), 'tornado': ('https://www.tornadoweb.org/en/stable/', None), 'xarray': ('https://docs.xarray.dev/en/stable/', None), - 'meson-python': ('https://meson-python.readthedocs.io/en/stable/', None) + 'meson-python': ('https://meson-python.readthedocs.io/en/stable/', None), + 'pip': ('https://pip.pypa.io/en/stable/', None), } diff --git a/doc/install/dependencies.rst b/doc/install/dependencies.rst index 93c1990b9472..8da22a16753b 100644 --- a/doc/install/dependencies.rst +++ b/doc/install/dependencies.rst @@ -222,14 +222,13 @@ Build dependencies Python ------ -By default, ``pip`` will build packages using build isolation, meaning that these -build dependencies are temporally installed by pip for the duration of the -Matplotlib build process. However, build isolation is disabled when :ref:`installing Matplotlib for development `; -therefore we recommend using one of our :ref:`virtual environment configurations ` to -create a development environment in which these packages are automatically installed. - -If you are developing Matplotlib and unable to use our environment configurations, -then you must manually install the following packages into your development environment: +``pip`` normally builds packages using :external+pip:doc:`build isolation `, +which means that ``pip`` installs the dependencies listed here for the +duration of the build process. However, build isolation is disabled via the the +:external+pip:ref:`--no-build-isolation ` flag +when :ref:`installing Matplotlib for development `, which +means that the dependencies must be explicitly installed, either by :ref:`creating a virtual environment ` +(recommended) or by manually installing the following packages: - `meson-python `_ (>= 0.13.1). - `ninja `_ (>= 1.8.2). This may be available in your package From 38d1462cc7eadeba92ca1d65dc7f8d77bb2bd3f8 Mon Sep 17 00:00:00 2001 From: hannah Date: Mon, 24 Jun 2024 10:06:47 -0400 Subject: [PATCH 3/3] Update doc/devel/coding_guide.rst Co-authored-by: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com> --- doc/devel/coding_guide.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/devel/coding_guide.rst b/doc/devel/coding_guide.rst index 59c5b69ba8d6..36802de49bd0 100644 --- a/doc/devel/coding_guide.rst +++ b/doc/devel/coding_guide.rst @@ -89,7 +89,8 @@ We generally use `stub files the type information for ``colors.py``. A notable exception is ``pyplot.py``, which is type hinted inline. -Type hints can be validated by the ``stubtest`` tool, which can be run +Type hints can be validated by the `stubtest +`_ tool, which can be run locally using ``tox -e stubtest`` and is a part of the :ref:`automated-tests` suite. Type hints for existing functions are also checked by the mypy :ref:`pre-commit hook `.