From a48ffc857c885501421e69a30b686d40a3b67a78 Mon Sep 17 00:00:00 2001 From: Jarrod Millman Date: Thu, 9 Jun 2022 14:27:55 -0700 Subject: [PATCH 01/23] Bump version --- numpydoc/_version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/numpydoc/_version.py b/numpydoc/_version.py index 3e8d9f94..350c9059 100644 --- a/numpydoc/_version.py +++ b/numpydoc/_version.py @@ -1 +1 @@ -__version__ = "1.4.0" +__version__ = "1.5.dev0" From 342a7f06ce153811cdb73c0a22be65893805e6d5 Mon Sep 17 00:00:00 2001 From: Ross Barnowski Date: Thu, 7 Jul 2022 15:43:19 +0300 Subject: [PATCH 02/23] DOC: Add theme switcher and default to lightmode. (#414) * DOC: Add theme switcher and default to lightmode. * Make linter happy. * Add workaround for theme versions that don't support mode switcher. * Add comment about theme version checking in conf. --- doc/conf.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/doc/conf.py b/doc/conf.py index 4b36f7e8..560334d9 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -85,9 +85,26 @@ "show_prev_next": False, "navbar_end": ["search-field.html", "navbar-icon-links.html"], } +# NOTE: The following is required for supporting of older sphinx toolchains. +# The "theme-switcher" templated should be added directly to navbar_end +# above and the following lines removed when the minimum supported +# version of pydata_sphinx_theme is 0.9.0 +# Add version switcher for versions of pydata_sphinx_theme that support it +import packaging +import pydata_sphinx_theme + +if packaging.version.parse(pydata_sphinx_theme.__version__) >= packaging.version.parse( + "0.9.0" +): + html_theme_options["navbar_end"].insert(0, "theme-switcher") + + html_sidebars = { "**": [], } +html_context = { + "default_mode": "light", +} html_title = f"{project} v{version} Manual" html_last_updated_fmt = "%b %d, %Y" From c796da669a9d3714126a3fde7221f9c47aef93c7 Mon Sep 17 00:00:00 2001 From: Jarrod Millman Date: Tue, 12 Jul 2022 14:58:50 -0700 Subject: [PATCH 03/23] Update GH actions (#416) --- .github/workflows/lint.yml | 4 ++-- .github/workflows/test.yml | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 4449bf64..78d425f3 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -8,5 +8,5 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - uses: actions/setup-python@v3 - - uses: pre-commit/action@v2.0.3 + - uses: actions/setup-python@v4 + - uses: pre-commit/action@v3.0.0 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 999278ba..e144eabe 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -26,7 +26,7 @@ jobs: - uses: actions/checkout@v3 - name: Python setup - uses: actions/setup-python@v3 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} @@ -84,7 +84,7 @@ jobs: - uses: actions/checkout@v3 - name: Python setup - uses: actions/setup-python@v3 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} @@ -136,7 +136,7 @@ jobs: - uses: actions/checkout@v3 - name: Python setup - uses: actions/setup-python@v3 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} @@ -176,7 +176,7 @@ jobs: - uses: actions/checkout@v3 - name: Python setup - uses: actions/setup-python@v3 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} From d9c8d6766a20500015f53ffc12fb6b552014912b Mon Sep 17 00:00:00 2001 From: Eric Larson Date: Wed, 13 Jul 2022 08:55:05 -0400 Subject: [PATCH 04/23] ENH: Add support for dict show_inherited_class_members (#415) * ENH: Add support for dict show_inherited_class_members * STY: Black * TST: Add test --- doc/install.rst | 12 ++++++++++-- numpydoc/numpydoc.py | 12 ++++++++++-- numpydoc/tests/test_numpydoc.py | 33 ++++++++++++++++++++++++++++++++- 3 files changed, 52 insertions(+), 5 deletions(-) diff --git a/doc/install.rst b/doc/install.rst index fb3c26bf..28b75a00 100644 --- a/doc/install.rst +++ b/doc/install.rst @@ -26,10 +26,18 @@ numpydoc_show_class_members : bool Whether to show all members of a class in the Methods and Attributes sections automatically. ``True`` by default. -numpydoc_show_inherited_class_members : bool +numpydoc_show_inherited_class_members : bool | dict Whether to show all inherited members of a class in the Methods and Attributes sections automatically. If it's false, inherited members won't shown. - ``True`` by default. + ``True`` by default. It can also be a dict mapping names of classes to + boolean values (missing keys are treated as ``True``). + For example, ``defaultdict(lambda: False, {'mymod.MyClass': True})`` + would only show inherited class members for ``MyClass``, whereas + ``{'mymod.MyClass': False}`` would show inherited class members for all + classes except ``MyClass``. Note that disabling this for a limited set of + classes might simultaneously require the use of a separate, custom + autosummary class template with ``:no-inherited-members:`` in the + ``autoclass`` directive options. numpydoc_class_members_toctree : bool Whether to create a Sphinx table of contents for the lists of class methods and attributes. If a table of contents is made, Sphinx expects diff --git a/numpydoc/numpydoc.py b/numpydoc/numpydoc.py index e656fb5c..57016f92 100644 --- a/numpydoc/numpydoc.py +++ b/numpydoc/numpydoc.py @@ -162,12 +162,18 @@ def clean_backrefs(app, doc, docname): def mangle_docstrings(app, what, name, obj, options, lines): if DEDUPLICATION_TAG in lines: return + show_inherited_class_members = app.config.numpydoc_show_inherited_class_members + if isinstance(show_inherited_class_members, dict): + try: + show_inherited_class_members = show_inherited_class_members[name] + except KeyError: + show_inherited_class_members = True cfg = { "use_plots": app.config.numpydoc_use_plots, "use_blockquotes": app.config.numpydoc_use_blockquotes, "show_class_members": app.config.numpydoc_show_class_members, - "show_inherited_class_members": app.config.numpydoc_show_inherited_class_members, + "show_inherited_class_members": show_inherited_class_members, "class_members_toctree": app.config.numpydoc_class_members_toctree, "attributes_as_param_list": app.config.numpydoc_attributes_as_param_list, "xref_param_type": app.config.numpydoc_xref_param_type, @@ -270,7 +276,9 @@ def setup(app, get_doc_object_=get_doc_object): app.add_config_value("numpydoc_use_plots", None, False) app.add_config_value("numpydoc_use_blockquotes", None, False) app.add_config_value("numpydoc_show_class_members", True, True) - app.add_config_value("numpydoc_show_inherited_class_members", True, True) + app.add_config_value( + "numpydoc_show_inherited_class_members", True, True, types=(bool, dict) + ) app.add_config_value("numpydoc_class_members_toctree", True, True) app.add_config_value("numpydoc_citation_re", "[a-z0-9_.-]+", True) app.add_config_value("numpydoc_attributes_as_param_list", True, True) diff --git a/numpydoc/tests/test_numpydoc.py b/numpydoc/tests/test_numpydoc.py index 0c8b6d61..d414b1c6 100644 --- a/numpydoc/tests/test_numpydoc.py +++ b/numpydoc/tests/test_numpydoc.py @@ -1,5 +1,7 @@ import pytest +from collections import defaultdict from io import StringIO +from pathlib import PosixPath from copy import deepcopy from numpydoc.numpydoc import mangle_docstrings, _clean_text_signature, update_config from numpydoc.xref import DEFAULT_LINKS @@ -41,7 +43,7 @@ def __init__(self): self.warningiserror = False -def test_mangle_docstrings(): +def test_mangle_docstrings_basic(): s = """ A top section before @@ -69,6 +71,35 @@ def test_mangle_docstrings(): assert "upper" not in [x.strip() for x in lines] +def test_mangle_docstrings_inherited_class_members(): + # if subclass docs are rendered, this PosixPath should have Path.samefile + p = """ +A top section before + +.. autoclass:: pathlib.PosixPath +""" + lines = p.split("\n") + app = MockApp() + mangle_docstrings(app, "class", "pathlib.PosixPath", PosixPath, {}, lines) + lines = [x.strip() for x in lines] + assert "samefile" in lines + app.config.numpydoc_show_inherited_class_members = False + lines = p.split("\n") + mangle_docstrings(app, "class", "pathlib.PosixPath", PosixPath, {}, lines) + lines = [x.strip() for x in lines] + assert "samefile" not in lines + app.config.numpydoc_show_inherited_class_members = dict() + lines = p.split("\n") + mangle_docstrings(app, "class", "pathlib.PosixPath", PosixPath, {}, lines) + lines = [x.strip() for x in lines] + assert "samefile" in lines + app.config.numpydoc_show_inherited_class_members = defaultdict(lambda: False) + lines = p.split("\n") + mangle_docstrings(app, "class", "pathlib.PosixPath", PosixPath, {}, lines) + lines = [x.strip() for x in lines] + assert "samefile" not in lines + + def test_clean_text_signature(): assert _clean_text_signature(None) is None assert _clean_text_signature("func($self)") == "func()" From 5339b68da8bb5ae700400ee60d5004f270876b5a Mon Sep 17 00:00:00 2001 From: Jarrod Millman Date: Thu, 14 Jul 2022 09:54:35 -0700 Subject: [PATCH 05/23] Update precommit linters (#417) --- .pre-commit-config.yaml | 8 ++++---- requirements/developer.txt | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 62735e94..5bc6fa2b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -3,7 +3,7 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.2.0 + rev: v4.3.0 hooks: - id: trailing-whitespace - id: end-of-file-fixer @@ -17,12 +17,12 @@ repos: - id: check-added-large-files - repo: https://github.com/psf/black - rev: 22.3.0 + rev: 22.6.0 hooks: - id: black - repo: https://github.com/pre-commit/mirrors-prettier - rev: v2.6.2 + rev: v2.7.1 hooks: - id: prettier files: \.(html|md|yml|yaml) @@ -34,7 +34,7 @@ repos: - id: blacken-docs - repo: https://github.com/asottile/pyupgrade - rev: v2.32.1 + rev: v2.37.1 hooks: - id: pyupgrade args: [--py37-plus] diff --git a/requirements/developer.txt b/requirements/developer.txt index e350275b..db79816f 100644 --- a/requirements/developer.txt +++ b/requirements/developer.txt @@ -1 +1 @@ -pre-commit>=2.19 +pre-commit>=2.20 From 00854d5a438905fae46a6bed3db12cd505bb92e5 Mon Sep 17 00:00:00 2001 From: Jeremy Goh <30731072+thatlittleboy@users.noreply.github.com> Date: Mon, 18 Jul 2022 21:26:44 +0800 Subject: [PATCH 06/23] docs: fix validation include line numbers (#418) * docs: fix validation include line numbers * use start/end markers instead of hardcoding lineno * Add missing sentinel + explanatory comment. Co-authored-by: Ross Barnowski --- doc/validation.rst | 3 ++- numpydoc/validate.py | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/doc/validation.rst b/doc/validation.rst index 8235559e..ee6e08d2 100644 --- a/doc/validation.rst +++ b/doc/validation.rst @@ -64,4 +64,5 @@ a more detailed message. For example:: The full mapping of validation checks is given below. .. literalinclude:: ../numpydoc/validate.py - :lines: 36-90 + :start-after: start-err-msg + :end-before: end-err-msg diff --git a/numpydoc/validate.py b/numpydoc/validate.py index 780d8952..4a323b92 100644 --- a/numpydoc/validate.py +++ b/numpydoc/validate.py @@ -34,6 +34,9 @@ "References", "Examples", ] +# NOTE: The following comment is a sentinel for embedding in the docs - do not +# modify/remove +# start-err-msg ERROR_MSGS = { "GL01": "Docstring text (summary) should start in the line immediately " "after the opening quotes (not in the same line, or leaving a " @@ -91,6 +94,9 @@ "SA04": 'Missing description for See Also "{reference_name}" reference', "EX01": "No examples section found", } +# end-err-msg +# NOTE: The above comment is a sentinel for embedding in the docs - do not +# modify/remove # Ignore these when evaluating end-of-line-"." checks IGNORE_STARTS = (" ", "* ", "- ") From 3513a715d0bcfd31a5e488fb1c357395849bb06a Mon Sep 17 00:00:00 2001 From: Jarrod Millman Date: Fri, 29 Jul 2022 15:36:28 -0700 Subject: [PATCH 07/23] Require sphinx>=4.2 (#411) --- .github/workflows/test.yml | 75 ++------------------------------------ README.rst | 2 +- doc/install.rst | 2 +- numpydoc/__init__.py | 26 ------------- setup.py | 2 +- 5 files changed, 7 insertions(+), 100 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e144eabe..437afca7 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -12,72 +12,7 @@ jobs: strategy: matrix: os: [Ubuntu] - python-version: ["3.7", "3.8", "3.9"] - sphinx-version: - [ - "sphinx==3.0", - "sphinx==3.5", - "sphinx==4.0", - "sphinx==4.5", - "sphinx==5.0", - "sphinx>=5.0", - ] - steps: - - uses: actions/checkout@v3 - - - name: Python setup - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - - - name: Setup environment - run: | - python -m pip install --upgrade pip wheel setuptools - python -m pip install -r requirements/test.txt -r doc/requirements.txt - python -m pip install codecov - python -m pip install ${{ matrix.sphinx-version }} - python -m pip list - - - name: Downgrade Jinja2 for sphinx<4 - if: ${{ matrix.sphinx-version }} == 'sphinx<4.0.2' - run: python -m pip install jinja2==3.0.3 markupsafe==2.0.1 pydata-sphinx-theme==0.8.0 docutils==0.17.1 - - - name: Install - run: | - python -m pip install . - pip list - - - name: Run test suite - run: | - pytest -v --pyargs . - - - name: Test coverage - run: | - codecov - - - name: Make sure CLI works - run: | - python -m numpydoc numpydoc.tests.test_main._capture_stdout - echo '! python -m numpydoc numpydoc.tests.test_main._invalid_docstring' | bash - python -m numpydoc --validate numpydoc.tests.test_main._capture_stdout - echo '! python -m numpydoc --validate numpydoc.tests.test_main._docstring_with_errors' | bash - - - name: Setup for doc build - run: | - sudo apt-get update - sudo apt install texlive texlive-latex-extra latexmk dvipng - - - name: Build documentation - run: | - make -C doc html SPHINXOPTS="-nT" - make -C doc latexpdf SPHINXOPTS="-nT" - - test-new: - runs-on: ${{ matrix.os }}-latest - strategy: - matrix: - os: [Ubuntu] - python-version: ["3.10"] + python-version: ["3.7", "3.8", "3.9", "3.10"] sphinx-version: ["sphinx==4.2", "sphinx==4.5", "sphinx==5.0", "sphinx>=5.0"] steps: @@ -125,13 +60,15 @@ jobs: run: | make -C doc html SPHINXOPTS="-nT" make -C doc latexpdf SPHINXOPTS="-nT" + base: runs-on: ${{ matrix.os }}-latest strategy: matrix: os: [ubuntu, macos, windows] python-version: ["3.11-dev"] - sphinx-version: ["sphinx==4.0", "sphinx==4.5"] + sphinx-version: + ["sphinx==4.2", "sphinx==4.5", "sphinx==5.0", "sphinx>=5.0"] steps: - uses: actions/checkout@v3 @@ -147,10 +84,6 @@ jobs: python -m pip install ${{ matrix.sphinx-version }} python -m pip list - - name: Downgrade Jinja2 for sphinx<4 - if: ${{ matrix.sphinx-version }} == 'sphinx<4.0.2' - run: python -m pip install jinja2==3.0.3 markupsafe==2.0.1 pydata-sphinx-theme==0.8.0 - - name: Install run: | python -m pip install . diff --git a/README.rst b/README.rst index 7d6c34e5..e9bdabb4 100644 --- a/README.rst +++ b/README.rst @@ -18,7 +18,7 @@ docstrings formatted according to the NumPy documentation format. The extension also adds the code description directives ``np:function``, ``np-c:function``, etc. -numpydoc requires Python 3.7+ and sphinx 3.0+. +numpydoc requires Python 3.7+ and sphinx 4.2+. For usage information, please refer to the `documentation `_. diff --git a/doc/install.rst b/doc/install.rst index 28b75a00..a0bc0760 100644 --- a/doc/install.rst +++ b/doc/install.rst @@ -5,7 +5,7 @@ Getting started Installation ============ -This extension requires Python 3.7+, sphinx 3.0+ and is available from: +This extension requires Python 3.7+, sphinx 4.2+ and is available from: * `numpydoc on PyPI `_ * `numpydoc on GitHub `_ diff --git a/numpydoc/__init__.py b/numpydoc/__init__.py index 31cc4249..97f53053 100644 --- a/numpydoc/__init__.py +++ b/numpydoc/__init__.py @@ -5,32 +5,6 @@ from ._version import __version__ -def _verify_sphinx_jinja(): - """Ensure sphinx and jinja versions are compatible. - - Jinja2>=3.1 requires Sphinx>=4.0.2. Raises exception if this condition is - not met. - - TODO: This check can be removed when the minimum supported sphinx version - for numpydoc sphinx>=4.0.2 - """ - import sphinx, jinja2 - from packaging import version - - if version.parse(sphinx.__version__) <= version.parse("4.0.2"): - if version.parse(jinja2.__version__) >= version.parse("3.1"): - from sphinx.errors import VersionRequirementError - - raise VersionRequirementError( - "\n\nSphinx<4.0.2 is incompatible with Jinja2>=3.1.\n" - "If you wish to continue using sphinx<4.0.2 you need to pin " - "Jinja2<3.1." - ) - - -_verify_sphinx_jinja() - - def setup(app, *args, **kwargs): from .numpydoc import setup diff --git a/setup.py b/setup.py index 1b292c38..e5c13d0c 100644 --- a/setup.py +++ b/setup.py @@ -52,7 +52,7 @@ def read(fname): author_email="pav@iki.fi", url="https://numpydoc.readthedocs.io", license="BSD", - install_requires=["sphinx>=3.0", "Jinja2>=2.10"], + install_requires=["sphinx>=4.2", "Jinja2>=2.10"], python_requires=">=3.7", extras_require={ "testing": [ From dcbfbc44ba01feddef62f294abf66581497f5828 Mon Sep 17 00:00:00 2001 From: Jarrod Millman Date: Tue, 9 Aug 2022 10:26:04 -0700 Subject: [PATCH 08/23] Require sphinx>=4.2 (cleanup) (#421) --- numpydoc/numpydoc.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/numpydoc/numpydoc.py b/numpydoc/numpydoc.py index 57016f92..8fa4f0ab 100644 --- a/numpydoc/numpydoc.py +++ b/numpydoc/numpydoc.py @@ -30,8 +30,8 @@ from sphinx.util import logging from sphinx.errors import ExtensionError -if sphinx.__version__ < "3.0": - raise RuntimeError("Sphinx 3.0 or newer is required") +if sphinx.__version__ < "4.2": + raise RuntimeError("Sphinx 4.2 or newer is required") from .docscrape_sphinx import get_doc_object from .validate import validate, ERROR_MSGS From d50e1f81063648c8c4d09820c6d013db1e3757cf Mon Sep 17 00:00:00 2001 From: Jarrod Millman Date: Mon, 15 Aug 2022 08:27:00 -0700 Subject: [PATCH 09/23] Remove numpydoc_use_blockquotes (#422) * Remove numpydoc_use_blockquotes See https://github.com/numpy/numpydoc/pull/107 * Update docstring --- doc/install.rst | 4 --- numpydoc/docscrape_sphinx.py | 10 ++----- numpydoc/numpydoc.py | 2 -- numpydoc/tests/test_docscrape.py | 46 -------------------------------- numpydoc/tests/test_numpydoc.py | 1 - 5 files changed, 2 insertions(+), 61 deletions(-) diff --git a/doc/install.rst b/doc/install.rst index a0bc0760..976ddd52 100644 --- a/doc/install.rst +++ b/doc/install.rst @@ -48,10 +48,6 @@ numpydoc_citation_re : str should be mangled to avoid conflicts due to duplication across the documentation. Defaults to ``[\w-]+``. -numpydoc_use_blockquotes : bool - Until version 0.8, parameter definitions were shown as blockquotes, rather - than in a definition list. If your styling requires blockquotes, switch - this config option to True. This option will be removed in version 0.10. numpydoc_attributes_as_param_list : bool Whether to format the Attributes section of a class page in the same way as the Parameter section. If it's False, the Attributes section will be diff --git a/numpydoc/docscrape_sphinx.py b/numpydoc/docscrape_sphinx.py index ee8e093c..9a62cff9 100644 --- a/numpydoc/docscrape_sphinx.py +++ b/numpydoc/docscrape_sphinx.py @@ -26,7 +26,6 @@ def __init__(self, docstring, config=None): def load_config(self, config): self.use_plots = config.get("use_plots", False) - self.use_blockquotes = config.get("use_blockquotes", False) self.class_members_toctree = config.get("class_members_toctree", True) self.attributes_as_param_list = config.get("attributes_as_param_list", True) self.xref_param_type = config.get("xref_param_type", False) @@ -84,8 +83,6 @@ def _str_returns(self, name="Returns"): if not param.desc: out += self._str_indent([".."], 8) else: - if self.use_blockquotes: - out += [""] out += self._str_indent(param.desc, 8) out += [""] return out @@ -180,8 +177,7 @@ def _str_param_list(self, name, fake_autosummary=False): """Generate RST for a listing of parameters or similar Parameter names are displayed as bold text, and descriptions - are in blockquotes. Descriptions may therefore contain block - markup as well. + are in definition lists. Parameters ---------- @@ -217,9 +213,7 @@ def _str_param_list(self, name, fake_autosummary=False): parts.append(param_type) out += self._str_indent([" : ".join(parts)]) - if desc and self.use_blockquotes: - out += [""] - elif not desc: + if not desc: # empty definition desc = [".."] out += self._str_indent(desc, 8) diff --git a/numpydoc/numpydoc.py b/numpydoc/numpydoc.py index 8fa4f0ab..509f0533 100644 --- a/numpydoc/numpydoc.py +++ b/numpydoc/numpydoc.py @@ -171,7 +171,6 @@ def mangle_docstrings(app, what, name, obj, options, lines): cfg = { "use_plots": app.config.numpydoc_use_plots, - "use_blockquotes": app.config.numpydoc_use_blockquotes, "show_class_members": app.config.numpydoc_show_class_members, "show_inherited_class_members": show_inherited_class_members, "class_members_toctree": app.config.numpydoc_class_members_toctree, @@ -274,7 +273,6 @@ def setup(app, get_doc_object_=get_doc_object): app.connect("doctree-read", relabel_references) app.connect("doctree-resolved", clean_backrefs) app.add_config_value("numpydoc_use_plots", None, False) - app.add_config_value("numpydoc_use_blockquotes", None, False) app.add_config_value("numpydoc_show_class_members", True, True) app.add_config_value( "numpydoc_show_inherited_class_members", True, True, types=(bool, dict) diff --git a/numpydoc/tests/test_docscrape.py b/numpydoc/tests/test_docscrape.py index 01447a05..55ccf92e 100644 --- a/numpydoc/tests/test_docscrape.py +++ b/numpydoc/tests/test_docscrape.py @@ -1059,52 +1059,6 @@ def test_plot_examples(): assert str(doc).count("plot::") == 1, str(doc) -def test_use_blockquotes(): - cfg = dict(use_blockquotes=True) - doc = SphinxDocString( - """ - Parameters - ---------- - abc : def - ghi - jkl - mno - - Returns - ------- - ABC : DEF - GHI - JKL - MNO - """, - config=cfg, - ) - line_by_line_compare( - str(doc), - """ - :Parameters: - - **abc** : def - - ghi - - **jkl** - - mno - - :Returns: - - **ABC** : DEF - - GHI - - JKL - - MNO - """, - ) - - def test_class_members(): class Dummy: """ diff --git a/numpydoc/tests/test_numpydoc.py b/numpydoc/tests/test_numpydoc.py index d414b1c6..16290786 100644 --- a/numpydoc/tests/test_numpydoc.py +++ b/numpydoc/tests/test_numpydoc.py @@ -11,7 +11,6 @@ class MockConfig: numpydoc_use_plots = False - numpydoc_use_blockquotes = True numpydoc_show_class_members = True numpydoc_show_inherited_class_members = True numpydoc_class_members_toctree = True From 5720f08d105f3ad9ce52537a06232eb5d5b22247 Mon Sep 17 00:00:00 2001 From: Nick Murphy Date: Wed, 17 Aug 2022 06:41:31 -0400 Subject: [PATCH 10/23] DOC: Use `:ref:` when referring to section headers (#424) Improve links to section headers in style guide --- doc/format.rst | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/doc/format.rst b/doc/format.rst index 56e4a4f3..6e44a566 100644 --- a/doc/format.rst +++ b/doc/format.rst @@ -31,7 +31,7 @@ Use a code checker: * pyflakes_: a tool to check Python code for errors by parsing the source file instead of importing it. * pycodestyle_: (formerly ``pep8``) a tool to check Python code against - some of the style conventions in PEP 8. + some of the style conventions in :pep:`8`. * flake8_: a tool that glues together ``pycodestyle``, ``pyflakes``, ``mccabe`` to check the style and quality of Python code. * vim-flake8_: a ``flake8`` plugin for Vim. @@ -287,14 +287,18 @@ takes the same form as the :ref:`Returns ` section:: Support for the :ref:`Yields ` section was added in `numpydoc `_ version 0.6. +.. _receives: + 7. Receives ``````````` Explanation of parameters passed to a generator's ``.send()`` method, -formatted as for Parameters, above. Since, like for Yields and Returns, a -single object is always passed to the method, this may describe either the -single parameter, or positional arguments passed as a tuple. If a docstring -includes Receives it must also include Yields. +formatted as for :ref:`Parameters `, above. Since, like for +:ref:`Yields ` and :ref:`Returns `, a single object is +always passed to the method, this may describe either the single parameter, +or positional arguments passed as a tuple. If a docstring +includes :ref:`Receives ` it must also include +:ref:`Yields `. 8. Other Parameters ``````````````````` @@ -303,6 +307,8 @@ An optional section used to describe infrequently used parameters. It should only be used if a function has a large number of keyword parameters, to prevent cluttering the :ref:`Parameters ` section. +.. _raises: + 9. Raises ````````` @@ -321,7 +327,7 @@ that are non-obvious or have a large chance of getting raised. ````````` An optional section detailing which warnings get raised and -under what conditions, formatted similarly to Raises. +under what conditions, formatted similarly to :ref:`Raises `. 11. Warnings ```````````` @@ -545,8 +551,8 @@ Documenting classes Class docstring ``````````````` -Use the same sections as outlined above (all except ``Returns`` are -applicable). The constructor (``__init__``) should also be documented +Use the same sections as outlined above (all except :ref:`Returns ` +are applicable). The constructor (``__init__``) should also be documented here, the :ref:`Parameters ` section of the docstring details the constructor's parameters. From 4ef89d4da0d494a5b7f6ecf1bd613599e50336bf Mon Sep 17 00:00:00 2001 From: Stefanie Molin <24376333+stefmolin@users.noreply.github.com> Date: Thu, 25 Aug 2022 04:51:27 -0400 Subject: [PATCH 11/23] ENH: Update validate.py to allow parameters with trailing underscores. (#425) * Update validate.py to allow parameters with trailing underscores. * Add test to ensure that escaping trailing underscores in parameters is accounted for. * Update test_validate.py * Fix spacing in test case. * Add parameters_with_trailing_underscores to test_good_functions() --- numpydoc/tests/test_validate.py | 25 +++++++++++++++++++++++++ numpydoc/validate.py | 2 +- 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/numpydoc/tests/test_validate.py b/numpydoc/tests/test_validate.py index 97c621e5..080affab 100644 --- a/numpydoc/tests/test_validate.py +++ b/numpydoc/tests/test_validate.py @@ -482,6 +482,30 @@ def valid_options_in_parameter_description_sets(self, bar): >>> result = 1 + 1 """ + def parameters_with_trailing_underscores(self, str_): + r""" + Ensure PR01 and PR02 errors are not raised with trailing underscores. + + Parameters with trailing underscores need to be escaped to render + properly in the documentation since trailing underscores are used to + create links. Doing so without also handling the change in the validation + logic makes it impossible to both pass validation and render correctly. + + Parameters + ---------- + str\_ : str + Some text. + + See Also + -------- + related : Something related. + + Examples + -------- + >>> result = 1 + 1 + """ + pass + class BadGenericDocStrings: """Everything here has a bad docstring""" @@ -1120,6 +1144,7 @@ def test_good_class(self, capsys): "other_parameters", "warnings", "valid_options_in_parameter_description_sets", + "parameters_with_trailing_underscores", ], ) def test_good_functions(self, capsys, func): diff --git a/numpydoc/validate.py b/numpydoc/validate.py index 4a323b92..cc058f0d 100644 --- a/numpydoc/validate.py +++ b/numpydoc/validate.py @@ -330,7 +330,7 @@ def add_stars(param_name, info): def parameter_mismatches(self): errs = [] signature_params = self.signature_parameters - all_params = tuple(self.doc_all_parameters) + all_params = tuple(param.replace("\\", "") for param in self.doc_all_parameters) missing = set(signature_params) - set(all_params) if missing: errs.append(error("PR01", missing_params=str(missing))) From b138ea7758532a8b6950c4404570ab367c3919f4 Mon Sep 17 00:00:00 2001 From: Ross Barnowski Date: Fri, 16 Sep 2022 18:43:28 -0700 Subject: [PATCH 12/23] BUG: Fix returns parsing no name (#429) * TST: Add test case. * MAINT: Adjust logic for parameter lines with : char. Adjust logic in parameter line splitting to avoid bug where Returns objects containing sphinx roles are improperly parsed. --- numpydoc/docscrape.py | 10 +++++++--- numpydoc/tests/test_docscrape.py | 15 +++++++++++++++ 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/numpydoc/docscrape.py b/numpydoc/docscrape.py index 6bdaa844..9496f9de 100644 --- a/numpydoc/docscrape.py +++ b/numpydoc/docscrape.py @@ -226,10 +226,14 @@ def _parse_param_list(self, content, single_element_is_type=False): params = [] while not r.eof(): header = r.read().strip() - if " :" in header: - arg_name, arg_type = header.split(" :", maxsplit=1) - arg_name, arg_type = arg_name.strip(), arg_type.strip() + if " : " in header: + arg_name, arg_type = header.split(" : ", maxsplit=1) else: + # NOTE: param line with single element should never have a + # a " :" before the description line, so this should probably + # warn. + if header.endswith(" :"): + header = header[:-2] if single_element_is_type: arg_name, arg_type = "", header else: diff --git a/numpydoc/tests/test_docscrape.py b/numpydoc/tests/test_docscrape.py index 55ccf92e..049d2a28 100644 --- a/numpydoc/tests/test_docscrape.py +++ b/numpydoc/tests/test_docscrape.py @@ -980,6 +980,21 @@ def test_empty_first_line(): ) +def test_returns_with_roles_no_names(): + """Make sure colons that are part of sphinx roles are not misinterpreted + as type separator in returns section. See gh-428.""" + docstring = NumpyDocString( + """ + Returns + ------- + str or :class:`NumpyDocString` + """ + ) + expected = "str or :class:`NumpyDocString`" # not "str or : class:... + assert docstring["Returns"][0].type == expected + assert expected in str(docstring) + + def test_trailing_colon(): assert doc8["Parameters"][0].name == "data" From c44abd2fed2db91b3573dd95141524f2e57d66e3 Mon Sep 17 00:00:00 2001 From: Jarrod Millman Date: Tue, 27 Sep 2022 17:35:18 -0700 Subject: [PATCH 13/23] Use requirements/*.txt files for CI (#435) --- .circleci/config.yml | 7 ++++--- .github/workflows/test.yml | 4 ++-- doc/requirements.txt => requirements/doc.txt | 0 3 files changed, 6 insertions(+), 5 deletions(-) rename doc/requirements.txt => requirements/doc.txt (100%) diff --git a/.circleci/config.yml b/.circleci/config.yml index cc83b2a1..4f66c7f3 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -18,9 +18,10 @@ jobs: - run: name: Get dependencies and install command: | - pip install --user -q --upgrade pip setuptools - pip install --user -q --upgrade numpy matplotlib sphinx pydata-sphinx-theme - pip install --user -e . + python -m pip install --upgrade pip wheel setuptools + python -m pip install --upgrade -r requirements/doc.txt + python -m pip install . + python -m pip list - save_cache: key: pip-cache paths: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 437afca7..24fe29cf 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -26,7 +26,7 @@ jobs: - name: Setup environment run: | python -m pip install --upgrade pip wheel setuptools - python -m pip install -r requirements/test.txt -r doc/requirements.txt + python -m pip install -r requirements/test.txt -r requirements/doc.txt python -m pip install codecov python -m pip install ${{ matrix.sphinx-version }} python -m pip list @@ -116,7 +116,7 @@ jobs: - name: Setup environment run: | python -m pip install --upgrade pip wheel setuptools - python -m pip install --pre -r requirements/test.txt -r doc/requirements.txt + python -m pip install --pre -r requirements/test.txt -r requirements/doc.txt python -m pip install codecov python -m pip list diff --git a/doc/requirements.txt b/requirements/doc.txt similarity index 100% rename from doc/requirements.txt rename to requirements/doc.txt From db404754f0cd7bb0927280e769bc8c9d95a2e42d Mon Sep 17 00:00:00 2001 From: Jarrod Millman Date: Tue, 27 Sep 2022 18:41:00 -0700 Subject: [PATCH 14/23] Use Python 3.10 to build docs (#436) --- .circleci/config.yml | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 4f66c7f3..b2269f47 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -2,33 +2,39 @@ version: 2 jobs: build_docs: docker: - - image: circleci/python:3.7-stretch + - image: "cimg/python:3.10" steps: - checkout - run: - name: Set BASH_ENV - command: | - echo "set -e" >> $BASH_ENV; - echo "export PATH=~/.local/bin:$PATH" >> $BASH_ENV; - sudo apt update - sudo apt install dvipng texlive-fonts-recommended texlive-latex-recommended texlive-latex-extra texlive-generic-extra latexmk texlive-xetex + name: Update apt-get + command: sudo apt-get update + - run: + name: Install TeX + command: sudo apt install dvipng texlive-fonts-recommended texlive-latex-recommended texlive-latex-extra latexmk texlive-xetex - restore_cache: keys: - pip-cache - run: name: Get dependencies and install command: | + python3 -m venv venv + source venv/bin/activate python -m pip install --upgrade pip wheel setuptools python -m pip install --upgrade -r requirements/doc.txt - python -m pip install . python -m pip list - save_cache: key: pip-cache paths: - ~/.cache/pip - run: - name: make html + name: Install + command: | + source venv/bin/activate + pip install -e . + - run: + name: Build docs command: | + source venv/bin/activate make -C doc html - store_artifacts: path: doc/_build/html/ @@ -36,6 +42,7 @@ jobs: - run: name: make tinybuild command: | + source venv/bin/activate make -C numpydoc/tests/tinybuild html - store_artifacts: path: numpydoc/tests/tinybuild/_build/html/ From 94b7a844a8ed956a2fc2f17cf0630ae54af323ea Mon Sep 17 00:00:00 2001 From: Jarrod Millman Date: Tue, 27 Sep 2022 21:15:46 -0700 Subject: [PATCH 15/23] Update precommit hooks (#437) --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 5bc6fa2b..611379ed 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -17,7 +17,7 @@ repos: - id: check-added-large-files - repo: https://github.com/psf/black - rev: 22.6.0 + rev: 22.8.0 hooks: - id: black @@ -34,7 +34,7 @@ repos: - id: blacken-docs - repo: https://github.com/asottile/pyupgrade - rev: v2.37.1 + rev: v2.38.2 hooks: - id: pyupgrade args: [--py37-plus] From ddcf0fea7a68d9f826ed863588ecc494b11d83a4 Mon Sep 17 00:00:00 2001 From: Ross Barnowski Date: Wed, 28 Sep 2022 11:21:38 -0700 Subject: [PATCH 16/23] Add cached property support (#433) * TST: Add test case for cached_property. * BUG: Fix detection of cached_property attrs. Co-authored-by: Tirth Patel * Wrap cached_property import in try/except for Python 3.7. Co-authored-by: Tirth Patel --- numpydoc/docscrape.py | 9 ++++++++- numpydoc/tests/test_docscrape.py | 21 +++++++++++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/numpydoc/docscrape.py b/numpydoc/docscrape.py index 9496f9de..e5c07f59 100644 --- a/numpydoc/docscrape.py +++ b/numpydoc/docscrape.py @@ -12,6 +12,13 @@ import sys +# TODO: Remove try-except when support for Python 3.7 is dropped +try: + from functools import cached_property +except ImportError: # cached_property added in Python 3.8 + cached_property = property + + def strip_blank_lines(l): "Remove leading and trailing blank lines from a list of lines" while l and not l[0].strip(): @@ -706,7 +713,7 @@ def properties(self): not name.startswith("_") and ( func is None - or isinstance(func, property) + or isinstance(func, (property, cached_property)) or inspect.isdatadescriptor(func) ) and self._is_show_member(name) diff --git a/numpydoc/tests/test_docscrape.py b/numpydoc/tests/test_docscrape.py index 049d2a28..227f8724 100644 --- a/numpydoc/tests/test_docscrape.py +++ b/numpydoc/tests/test_docscrape.py @@ -1,6 +1,7 @@ from collections import namedtuple from copy import deepcopy import re +import sys import textwrap import warnings @@ -1624,6 +1625,26 @@ def __call__(self): nds._error_location(msg=msg) +@pytest.mark.skipif( + sys.version_info < (3, 8), reason="cached_property was added in 3.8" +) +def test_class_docstring_cached_property(): + """Ensure that properties marked with the `cached_property` decorator + are listed in the Methods section. See gh-432.""" + from functools import cached_property + + class Foo: + _x = [1, 2, 3] + + @cached_property + def val(self): + return self._x + + class_docstring = get_doc_object(Foo) + assert len(class_docstring["Attributes"]) == 1 + assert class_docstring["Attributes"][0].name == "val" + + if __name__ == "__main__": import pytest From 4c74647afc82a1b352701a52f0f1a33891dbd3ff Mon Sep 17 00:00:00 2001 From: Jarrod Millman Date: Tue, 4 Oct 2022 14:04:09 -0700 Subject: [PATCH 17/23] Fix front page (#434) * Fix front page * Test * Test pydata-sphinx-theme==0.11.0rc2 * Specify package to test * Test pydata-sphinx-theme==0.11.0rc3 --- .github/workflows/test.yml | 2 +- doc/index.rst | 2 ++ requirements/doc.txt | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 24fe29cf..6d2befc0 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -38,7 +38,7 @@ jobs: - name: Run test suite run: | - pytest -v --pyargs . + pytest -v --pyargs numpydoc - name: Test coverage run: | diff --git a/doc/index.rst b/doc/index.rst index 05f0546e..389e3cb1 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -1,3 +1,5 @@ +:html_theme.sidebar_secondary.remove: true + ===================================== numpydoc -- Numpy's Sphinx extensions ===================================== diff --git a/requirements/doc.txt b/requirements/doc.txt index bff4625d..7d830455 100644 --- a/requirements/doc.txt +++ b/requirements/doc.txt @@ -1,4 +1,4 @@ numpy matplotlib -pydata-sphinx-theme +pydata-sphinx-theme==0.11.0rc3 sphinx From 664e7144ece8f0779b18f6282ed7a42e35f130ab Mon Sep 17 00:00:00 2001 From: Jarrod Millman Date: Tue, 4 Oct 2022 14:41:16 -0700 Subject: [PATCH 18/23] Suport Python 3.11 (#438) --- .github/workflows/test.yml | 40 +------------------------------------- setup.py | 1 + 2 files changed, 2 insertions(+), 39 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6d2befc0..eb7fa3ee 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -12,7 +12,7 @@ jobs: strategy: matrix: os: [Ubuntu] - python-version: ["3.7", "3.8", "3.9", "3.10"] + python-version: ["3.7", "3.8", "3.9", "3.10", "3.11-dev"] sphinx-version: ["sphinx==4.2", "sphinx==4.5", "sphinx==5.0", "sphinx>=5.0"] steps: @@ -61,44 +61,6 @@ jobs: make -C doc html SPHINXOPTS="-nT" make -C doc latexpdf SPHINXOPTS="-nT" - base: - runs-on: ${{ matrix.os }}-latest - strategy: - matrix: - os: [ubuntu, macos, windows] - python-version: ["3.11-dev"] - sphinx-version: - ["sphinx==4.2", "sphinx==4.5", "sphinx==5.0", "sphinx>=5.0"] - steps: - - uses: actions/checkout@v3 - - - name: Python setup - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - - - name: Setup environment - run: | - python -m pip install --upgrade pip wheel setuptools - python -m pip install pytest pytest-cov - python -m pip install ${{ matrix.sphinx-version }} - python -m pip list - - - name: Install - run: | - python -m pip install . - pip list - - - name: Run test suite - run: pytest -v --pyargs numpydoc - - - name: Make sure CLI works - run: | - python -m numpydoc numpydoc.tests.test_main._capture_stdout - echo '! python -m numpydoc numpydoc.tests.test_main._invalid_docstring' | bash - python -m numpydoc --validate numpydoc.tests.test_main._capture_stdout - echo '! python -m numpydoc --validate numpydoc.tests.test_main._docstring_with_errors' | bash - prerelease: runs-on: ${{ matrix.os }}-latest strategy: diff --git a/setup.py b/setup.py index e5c13d0c..09cb946e 100644 --- a/setup.py +++ b/setup.py @@ -46,6 +46,7 @@ def read(fname): "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", ], keywords="sphinx numpy", author="Pauli Virtanen and others", From 26cfa5847df5cdd6c0fa49c9be410fdfac2c7afe Mon Sep 17 00:00:00 2001 From: Jarrod Millman Date: Tue, 4 Oct 2022 14:48:30 -0700 Subject: [PATCH 19/23] Designate 1.5.0rc1 release --- doc/release_notes.rst | 10 ++++++++++ numpydoc/_version.py | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/doc/release_notes.rst b/doc/release_notes.rst index 261b14bd..54cb05b9 100644 --- a/doc/release_notes.rst +++ b/doc/release_notes.rst @@ -17,6 +17,16 @@ Release notes For release notes (sparsely) kept prior to 1.0.0, look at the `releases page on GitHub `__. + +1.5.0 +----- + +Release date: TBD + +Requires Python 3.7+ and Sphinx 4.2+. + +`Full Changelog `__ + 1.4.0 ----- diff --git a/numpydoc/_version.py b/numpydoc/_version.py index 350c9059..24487e4b 100644 --- a/numpydoc/_version.py +++ b/numpydoc/_version.py @@ -1 +1 @@ -__version__ = "1.5.dev0" +__version__ = "1.5.0rc1" From 8b983feb66ffcbebebe58aa5d10fea6c2a66207f Mon Sep 17 00:00:00 2001 From: Jarrod Millman Date: Tue, 4 Oct 2022 14:51:02 -0700 Subject: [PATCH 20/23] Bump version --- numpydoc/_version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/numpydoc/_version.py b/numpydoc/_version.py index 24487e4b..4e1da2b1 100644 --- a/numpydoc/_version.py +++ b/numpydoc/_version.py @@ -1 +1 @@ -__version__ = "1.5.0rc1" +__version__ = "1.5.0rc2.dev0" From 72e9cd4dae1d451ca24f06e0fa7a82285b381139 Mon Sep 17 00:00:00 2001 From: Jarrod Millman Date: Thu, 6 Oct 2022 05:29:11 -0700 Subject: [PATCH 21/23] Update pydata-sphinx-theme (#440) --- requirements/doc.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/doc.txt b/requirements/doc.txt index 7d830455..64f4d287 100644 --- a/requirements/doc.txt +++ b/requirements/doc.txt @@ -1,4 +1,4 @@ numpy matplotlib -pydata-sphinx-theme==0.11.0rc3 +pydata-sphinx-theme>=0.11 sphinx From c6338c7607355f38c382017e5f492f50e1b44da9 Mon Sep 17 00:00:00 2001 From: Jarrod Millman Date: Sat, 8 Oct 2022 06:33:10 -0700 Subject: [PATCH 22/23] Update doc requirements (#441) --- requirements/doc.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/requirements/doc.txt b/requirements/doc.txt index 64f4d287..643fc9a9 100644 --- a/requirements/doc.txt +++ b/requirements/doc.txt @@ -1,4 +1,4 @@ -numpy -matplotlib +numpy>=1.21 +matplotlib>=3.5 pydata-sphinx-theme>=0.11 -sphinx +sphinx>=5.2 From 3a8a96cda5e04ef77caa076be1fcd115e3987b62 Mon Sep 17 00:00:00 2001 From: Jarrod Millman Date: Sat, 8 Oct 2022 07:06:41 -0700 Subject: [PATCH 23/23] Designate 1.5.0 release --- doc/release_notes.rst | 44 +++++++++++++++++++++++++++++++++++++++++-- numpydoc/_version.py | 2 +- 2 files changed, 43 insertions(+), 3 deletions(-) diff --git a/doc/release_notes.rst b/doc/release_notes.rst index 54cb05b9..1c9762df 100644 --- a/doc/release_notes.rst +++ b/doc/release_notes.rst @@ -21,11 +21,51 @@ Release notes 1.5.0 ----- -Release date: TBD +Release date: 8 October 2022 Requires Python 3.7+ and Sphinx 4.2+. -`Full Changelog `__ +`Full Changelog `__ + +Fixed bugs +~~~~~~~~~~ + +- Parsing ``returns`` section with several types and no name `#428 `__ +- BUG: Fix returns parsing no name `#429 `__ (`rossbar `__) + +Closed issues +~~~~~~~~~~~~~ + +- readthedocs build failing `#439 `__ +- Exclude class properties from being listed under METHODS section `#339 `__ +- BUG: Numpydoc doesn’t render attributes decorated with ``cached\_property`` in the Attributes section `#432 `__ +- Is numpydoc_use_blockquotes deprecated or not yet? `#420 `__ +- No light theme available in docs `#413 `__ +- 1.4.0 release plan `#408 `__ + +Merged pull requests +~~~~~~~~~~~~~~~~~~~~ + +- Update doc requirements `#441 `__ (`jarrodmillman `__) +- Update pydata-sphinx-theme `#440 `__ (`jarrodmillman `__) +- Support Python 3.11 `#438 `__ (`jarrodmillman `__) +- Update precommit hooks `#437 `__ (`jarrodmillman `__) +- Use Python 3.10 to build docs `#436 `__ (`jarrodmillman `__) +- Use requirements/*.txt files for CI `#435 `__ (`jarrodmillman `__) +- Fix front page `#434 `__ (`jarrodmillman `__) +- Add cached property support `#433 `__ (`rossbar `__) +- ENH: Update validate.py to allow parameters with trailing underscores. `#425 `__ (`stefmolin `__) +- DOC: Use ``:ref:`` when referring to section headers `#424 `__ (`namurphy `__) +- Remove numpydoc_use_blockquotes `#422 `__ (`jarrodmillman `__) +- Require sphinx>=4.2 (cleanup) `#421 `__ (`jarrodmillman `__) +- docs: fix validation include line numbers `#418 `__ (`thatlittleboy `__) +- Update precommit linters `#417 `__ (`jarrodmillman `__) +- Update GH actions `#416 `__ (`jarrodmillman `__) +- ENH: Add support for dict show_inherited_class_members `#415 `__ (`larsoner `__) +- DOC: Add theme switcher and default to lightmode. `#414 `__ (`rossbar `__) +- Require sphinx>=4.2 `#411 `__ (`jarrodmillman `__) + +\* *This Changelog was automatically generated by*\ `github_changelog_generator `__ 1.4.0 ----- diff --git a/numpydoc/_version.py b/numpydoc/_version.py index 4e1da2b1..5b601886 100644 --- a/numpydoc/_version.py +++ b/numpydoc/_version.py @@ -1 +1 @@ -__version__ = "1.5.0rc2.dev0" +__version__ = "1.5.0"