Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package python-numpydoc for openSUSE:Factory
checked in at 2022-10-17 14:57:33
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-numpydoc (Old)
and /work/SRC/openSUSE:Factory/.python-numpydoc.new.2275 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-numpydoc"
Mon Oct 17 14:57:33 2022 rev:13 rq:1009266 version:1.5.0
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-numpydoc/python-numpydoc.changes
2022-08-16 17:07:06.107762925 +0200
+++
/work/SRC/openSUSE:Factory/.python-numpydoc.new.2275/python-numpydoc.changes
2022-10-17 14:57:36.670082505 +0200
@@ -1,0 +2,40 @@
+Sun Oct 9 19:18:50 UTC 2022 - Arun Persaud <[email protected]>
+
+- specfile:
+ * require sphinx >= 4.2
+ * require python >= 3.7
+
+- update to version 1.5.0:
+ * Fixed bugs
+ + Parsing "returns" section with several types and no name
+ + BUG: Fix returns parsing no name
+ * Closed issues
+ + readthedocs build failing
+ + Exclude class properties from being listed under METHODS section
+ + BUG: Numpydoc doesn???t render attributes decorated with
+ "cached\_property" in the Attributes section
+ + Is numpydoc_use_blockquotes deprecated or not yet?
+ + No light theme available in docs
+ + 1.4.0 release plan
+ * Merged pull requests
+ + Update doc requirements
+ + Update pydata-sphinx-theme
+ + Support Python 3.11
+ + Update precommit hooks
+ + Use Python 3.10 to build docs
+ + Use requirements/*.txt files for CI
+ + Fix front page
+ + Add cached property support
+ + ENH: Update validate.py to allow parameters with trailing
+ underscores.
+ + DOC: Use ":ref:" when referring to section headers
+ + Remove numpydoc_use_blockquotes
+ + Require sphinx>=4.2 (cleanup)
+ + docs: fix validation include line numbers
+ + Update precommit linters
+ + Update GH actions
+ + ENH: Add support for dict show_inherited_class_members
+ + DOC: Add theme switcher and default to lightmode.
+ + Require sphinx>=4.2
+
+-------------------------------------------------------------------
Old:
----
numpydoc-1.4.0.tar.gz
New:
----
numpydoc-1.5.0.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-numpydoc.spec ++++++
--- /var/tmp/diff_new_pack.yGBy7R/_old 2022-10-17 14:57:37.154083434 +0200
+++ /var/tmp/diff_new_pack.yGBy7R/_new 2022-10-17 14:57:37.158083442 +0200
@@ -17,9 +17,8 @@
%{?!python_module:%define python_module() python3-%{**}}
-%define skip_python2 1
Name: python-numpydoc
-Version: 1.4.0
+Version: 1.5.0
Release: 0
Summary: Sphinx extension to support docstrings in Numpy format
License: BSD-3-Clause
@@ -29,12 +28,13 @@
# https://docs.python.org/3/objects.inv (changes from time to time, accessed
2021-02-23)
Source1: python-objects.inv
BuildRequires: %{python_module Jinja2 >= 2.10}
-BuildRequires: %{python_module Sphinx >= 3.0}
+BuildRequires: %{python_module Sphinx >= 4.2}
+BuildRequires: %{python_module base >= 3.7}
BuildRequires: %{python_module setuptools}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
Requires: python-Jinja2 >= 2.10
-Requires: python-Sphinx >= 3.0
+Requires: python-Sphinx >= 4.2
BuildArch: noarch
# SECTION test requirements
BuildRequires: %{python_module pytest}
++++++ numpydoc-1.4.0.tar.gz -> numpydoc-1.5.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/numpydoc-1.4.0/PKG-INFO new/numpydoc-1.5.0/PKG-INFO
--- old/numpydoc-1.4.0/PKG-INFO 2022-06-09 23:26:41.252139000 +0200
+++ new/numpydoc-1.5.0/PKG-INFO 2022-10-08 16:10:11.625159000 +0200
@@ -1,6 +1,6 @@
Metadata-Version: 2.1
Name: numpydoc
-Version: 1.4.0
+Version: 1.5.0
Summary: Sphinx extension to support docstrings in Numpy format
Home-page: https://numpydoc.readthedocs.io
Author: Pauli Virtanen and others
@@ -17,6 +17,7 @@
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
+Classifier: Programming Language :: Python :: 3.11
Requires-Python: >=3.7
Provides-Extra: testing
License-File: LICENSE.txt
@@ -41,7 +42,7 @@
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
<https://numpydoc.readthedocs.io/>`_.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/numpydoc-1.4.0/README.rst
new/numpydoc-1.5.0/README.rst
--- old/numpydoc-1.4.0/README.rst 2022-06-09 23:13:49.000000000 +0200
+++ new/numpydoc-1.5.0/README.rst 2022-08-09 19:09:18.000000000 +0200
@@ -18,7 +18,7 @@
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
<https://numpydoc.readthedocs.io/>`_.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/numpydoc-1.4.0/doc/conf.py
new/numpydoc-1.5.0/doc/conf.py
--- old/numpydoc-1.4.0/doc/conf.py 2022-05-27 22:38:55.000000000 +0200
+++ new/numpydoc-1.5.0/doc/conf.py 2022-09-28 01:40:39.000000000 +0200
@@ -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"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/numpydoc-1.4.0/doc/format.rst
new/numpydoc-1.5.0/doc/format.rst
--- old/numpydoc-1.4.0/doc/format.rst 2022-01-08 03:57:34.000000000 +0100
+++ new/numpydoc-1.5.0/doc/format.rst 2022-09-28 00:28:20.000000000 +0200
@@ -31,7 +31,7 @@
* 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 @@
Support for the :ref:`Yields <yields>` section was added in `numpydoc
<https://github.com/numpy/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 <params>`, above. Since, like for
+:ref:`Yields <yields>` and :ref:`Returns <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 <receives>` it must also include
+:ref:`Yields <yields>`.
8. Other Parameters
```````````````````
@@ -303,6 +307,8 @@
It should only be used if a function has a large number of keyword
parameters, to prevent cluttering the :ref:`Parameters <params>` section.
+.. _raises:
+
9. Raises
`````````
@@ -321,7 +327,7 @@
`````````
An optional section detailing which warnings get raised and
-under what conditions, formatted similarly to Raises.
+under what conditions, formatted similarly to :ref:`Raises <raises>`.
11. Warnings
````````````
@@ -545,8 +551,8 @@
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 <returns>`
+are applicable). The constructor (``__init__``) should also be documented
here, the :ref:`Parameters <params>` section of the docstring details the
constructor's parameters.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/numpydoc-1.4.0/doc/index.rst
new/numpydoc-1.5.0/doc/index.rst
--- old/numpydoc-1.4.0/doc/index.rst 2022-01-08 03:57:34.000000000 +0100
+++ new/numpydoc-1.5.0/doc/index.rst 2022-10-04 23:34:41.000000000 +0200
@@ -1,3 +1,5 @@
+:html_theme.sidebar_secondary.remove: true
+
=====================================
numpydoc -- Numpy's Sphinx extensions
=====================================
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/numpydoc-1.4.0/doc/install.rst
new/numpydoc-1.5.0/doc/install.rst
--- old/numpydoc-1.4.0/doc/install.rst 2022-06-09 23:13:49.000000000 +0200
+++ new/numpydoc-1.5.0/doc/install.rst 2022-09-28 00:28:20.000000000 +0200
@@ -5,7 +5,7 @@
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 <http://pypi.python.org/pypi/numpydoc>`_
* `numpydoc on GitHub <https://github.com/numpy/numpydoc/>`_
@@ -26,10 +26,18 @@
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
@@ -40,10 +48,6 @@
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 -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/numpydoc-1.4.0/doc/release_notes.rst
new/numpydoc-1.5.0/doc/release_notes.rst
--- old/numpydoc-1.4.0/doc/release_notes.rst 2022-06-09 23:22:35.000000000
+0200
+++ new/numpydoc-1.5.0/doc/release_notes.rst 2022-10-08 16:06:19.000000000
+0200
@@ -17,6 +17,56 @@
For release notes (sparsely) kept prior to 1.0.0, look at the `releases page
on GitHub <https://github.com/numpy/numpydoc/releases>`__.
+
+1.5.0
+-----
+
+Release date: 8 October 2022
+
+Requires Python 3.7+ and Sphinx 4.2+.
+
+`Full Changelog <https://github.com/numpy/numpydoc/compare/v1.4.0...v1.5.0>`__
+
+Fixed bugs
+~~~~~~~~~~
+
+- Parsing ``returns`` section with several types and no name `#428
<https://github.com/numpy/numpydoc/issues/428>`__
+- BUG: Fix returns parsing no name `#429
<https://github.com/numpy/numpydoc/pull/429>`__ (`rossbar
<https://github.com/rossbar>`__)
+
+Closed issues
+~~~~~~~~~~~~~
+
+- readthedocs build failing `#439
<https://github.com/numpy/numpydoc/issues/439>`__
+- Exclude class properties from being listed under METHODS section `#339
<https://github.com/numpy/numpydoc/issues/339>`__
+- BUG: Numpydoc doesn???t render attributes decorated with
``cached\_property`` in the Attributes section `#432
<https://github.com/numpy/numpydoc/issues/432>`__
+- Is numpydoc_use_blockquotes deprecated or not yet? `#420
<https://github.com/numpy/numpydoc/issues/420>`__
+- No light theme available in docs `#413
<https://github.com/numpy/numpydoc/issues/413>`__
+- 1.4.0 release plan `#408 <https://github.com/numpy/numpydoc/issues/408>`__
+
+Merged pull requests
+~~~~~~~~~~~~~~~~~~~~
+
+- Update doc requirements `#441
<https://github.com/numpy/numpydoc/pull/441>`__ (`jarrodmillman
<https://github.com/jarrodmillman>`__)
+- Update pydata-sphinx-theme `#440
<https://github.com/numpy/numpydoc/pull/440>`__ (`jarrodmillman
<https://github.com/jarrodmillman>`__)
+- Support Python 3.11 `#438 <https://github.com/numpy/numpydoc/pull/438>`__
(`jarrodmillman <https://github.com/jarrodmillman>`__)
+- Update precommit hooks `#437
<https://github.com/numpy/numpydoc/pull/437>`__ (`jarrodmillman
<https://github.com/jarrodmillman>`__)
+- Use Python 3.10 to build docs `#436
<https://github.com/numpy/numpydoc/pull/436>`__ (`jarrodmillman
<https://github.com/jarrodmillman>`__)
+- Use requirements/*.txt files for CI `#435
<https://github.com/numpy/numpydoc/pull/435>`__ (`jarrodmillman
<https://github.com/jarrodmillman>`__)
+- Fix front page `#434 <https://github.com/numpy/numpydoc/pull/434>`__
(`jarrodmillman <https://github.com/jarrodmillman>`__)
+- Add cached property support `#433
<https://github.com/numpy/numpydoc/pull/433>`__ (`rossbar
<https://github.com/rossbar>`__)
+- ENH: Update validate.py to allow parameters with trailing underscores.
`#425 <https://github.com/numpy/numpydoc/pull/425>`__ (`stefmolin
<https://github.com/stefmolin>`__)
+- DOC: Use ``:ref:`` when referring to section headers `#424
<https://github.com/numpy/numpydoc/pull/424>`__ (`namurphy
<https://github.com/namurphy>`__)
+- Remove numpydoc_use_blockquotes `#422
<https://github.com/numpy/numpydoc/pull/422>`__ (`jarrodmillman
<https://github.com/jarrodmillman>`__)
+- Require sphinx>=4.2 (cleanup) `#421
<https://github.com/numpy/numpydoc/pull/421>`__ (`jarrodmillman
<https://github.com/jarrodmillman>`__)
+- docs: fix validation include line numbers `#418
<https://github.com/numpy/numpydoc/pull/418>`__ (`thatlittleboy
<https://github.com/thatlittleboy>`__)
+- Update precommit linters `#417
<https://github.com/numpy/numpydoc/pull/417>`__ (`jarrodmillman
<https://github.com/jarrodmillman>`__)
+- Update GH actions `#416 <https://github.com/numpy/numpydoc/pull/416>`__
(`jarrodmillman <https://github.com/jarrodmillman>`__)
+- ENH: Add support for dict show_inherited_class_members `#415
<https://github.com/numpy/numpydoc/pull/415>`__ (`larsoner
<https://github.com/larsoner>`__)
+- DOC: Add theme switcher and default to lightmode. `#414
<https://github.com/numpy/numpydoc/pull/414>`__ (`rossbar
<https://github.com/rossbar>`__)
+- Require sphinx>=4.2 `#411 <https://github.com/numpy/numpydoc/pull/411>`__
(`jarrodmillman <https://github.com/jarrodmillman>`__)
+
+\* *This Changelog was automatically generated by*\
`github_changelog_generator
<https://github.com/github-changelog-generator/github-changelog-generator>`__
+
1.4.0
-----
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/numpydoc-1.4.0/doc/requirements.txt
new/numpydoc-1.5.0/doc/requirements.txt
--- old/numpydoc-1.4.0/doc/requirements.txt 2022-05-27 22:51:48.000000000
+0200
+++ new/numpydoc-1.5.0/doc/requirements.txt 1970-01-01 01:00:00.000000000
+0100
@@ -1,4 +0,0 @@
-numpy
-matplotlib
-pydata-sphinx-theme
-sphinx
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/numpydoc-1.4.0/doc/validation.rst
new/numpydoc-1.5.0/doc/validation.rst
--- old/numpydoc-1.4.0/doc/validation.rst 2022-04-30 21:35:11.000000000
+0200
+++ new/numpydoc-1.5.0/doc/validation.rst 2022-07-27 00:15:00.000000000
+0200
@@ -64,4 +64,5 @@
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 -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/numpydoc-1.4.0/numpydoc/__init__.py
new/numpydoc-1.5.0/numpydoc/__init__.py
--- old/numpydoc-1.4.0/numpydoc/__init__.py 2022-06-09 23:13:49.000000000
+0200
+++ new/numpydoc-1.5.0/numpydoc/__init__.py 2022-08-09 19:09:18.000000000
+0200
@@ -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 -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/numpydoc-1.4.0/numpydoc/_version.py
new/numpydoc-1.5.0/numpydoc/_version.py
--- old/numpydoc-1.4.0/numpydoc/_version.py 2022-06-09 23:23:38.000000000
+0200
+++ new/numpydoc-1.5.0/numpydoc/_version.py 2022-10-08 15:48:22.000000000
+0200
@@ -1 +1 @@
-__version__ = "1.4.0"
+__version__ = "1.5.0"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/numpydoc-1.4.0/numpydoc/docscrape.py
new/numpydoc-1.5.0/numpydoc/docscrape.py
--- old/numpydoc-1.4.0/numpydoc/docscrape.py 2022-05-27 22:38:55.000000000
+0200
+++ new/numpydoc-1.5.0/numpydoc/docscrape.py 2022-10-04 18:45:48.000000000
+0200
@@ -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():
@@ -226,10 +233,14 @@
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:
@@ -702,7 +713,7 @@
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 -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/numpydoc-1.4.0/numpydoc/docscrape_sphinx.py
new/numpydoc-1.5.0/numpydoc/docscrape_sphinx.py
--- old/numpydoc-1.4.0/numpydoc/docscrape_sphinx.py 2022-05-27
22:38:55.000000000 +0200
+++ new/numpydoc-1.5.0/numpydoc/docscrape_sphinx.py 2022-09-28
00:28:20.000000000 +0200
@@ -26,7 +26,6 @@
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 @@
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 @@
"""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 @@
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 -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/numpydoc-1.4.0/numpydoc/numpydoc.py
new/numpydoc-1.5.0/numpydoc/numpydoc.py
--- old/numpydoc-1.4.0/numpydoc/numpydoc.py 2022-06-02 18:04:46.000000000
+0200
+++ new/numpydoc-1.5.0/numpydoc/numpydoc.py 2022-09-28 00:28:20.000000000
+0200
@@ -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
@@ -162,12 +162,17 @@
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,
@@ -268,9 +273,10 @@
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)
+ 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 -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/numpydoc-1.4.0/numpydoc/tests/test_docscrape.py
new/numpydoc-1.5.0/numpydoc/tests/test_docscrape.py
--- old/numpydoc-1.4.0/numpydoc/tests/test_docscrape.py 2022-05-27
22:38:55.000000000 +0200
+++ new/numpydoc-1.5.0/numpydoc/tests/test_docscrape.py 2022-10-04
18:45:48.000000000 +0200
@@ -1,6 +1,7 @@
from collections import namedtuple
from copy import deepcopy
import re
+import sys
import textwrap
import warnings
@@ -980,6 +981,21 @@
)
+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"
@@ -1059,52 +1075,6 @@
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:
"""
@@ -1655,6 +1625,26 @@
nds._error_location(msg=msg)
[email protected](
+ 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
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/numpydoc-1.4.0/numpydoc/tests/test_numpydoc.py
new/numpydoc-1.5.0/numpydoc/tests/test_numpydoc.py
--- old/numpydoc-1.4.0/numpydoc/tests/test_numpydoc.py 2022-05-27
22:38:55.000000000 +0200
+++ new/numpydoc-1.5.0/numpydoc/tests/test_numpydoc.py 2022-09-28
00:28:20.000000000 +0200
@@ -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
@@ -9,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
@@ -41,7 +42,7 @@
self.warningiserror = False
-def test_mangle_docstrings():
+def test_mangle_docstrings_basic():
s = """
A top section before
@@ -69,6 +70,35 @@
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()"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/numpydoc-1.4.0/numpydoc/tests/test_validate.py
new/numpydoc-1.5.0/numpydoc/tests/test_validate.py
--- old/numpydoc-1.4.0/numpydoc/tests/test_validate.py 2022-05-27
22:38:55.000000000 +0200
+++ new/numpydoc-1.5.0/numpydoc/tests/test_validate.py 2022-09-28
00:28:20.000000000 +0200
@@ -482,6 +482,30 @@
>>> 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 @@
"other_parameters",
"warnings",
"valid_options_in_parameter_description_sets",
+ "parameters_with_trailing_underscores",
],
)
def test_good_functions(self, capsys, func):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/numpydoc-1.4.0/numpydoc/validate.py
new/numpydoc-1.5.0/numpydoc/validate.py
--- old/numpydoc-1.4.0/numpydoc/validate.py 2022-05-27 22:38:55.000000000
+0200
+++ new/numpydoc-1.5.0/numpydoc/validate.py 2022-09-28 00:28:20.000000000
+0200
@@ -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 = (" ", "* ", "- ")
@@ -324,7 +330,7 @@
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)))
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/numpydoc-1.4.0/numpydoc.egg-info/PKG-INFO
new/numpydoc-1.5.0/numpydoc.egg-info/PKG-INFO
--- old/numpydoc-1.4.0/numpydoc.egg-info/PKG-INFO 2022-06-09
23:26:40.000000000 +0200
+++ new/numpydoc-1.5.0/numpydoc.egg-info/PKG-INFO 2022-10-08
16:10:11.000000000 +0200
@@ -1,6 +1,6 @@
Metadata-Version: 2.1
Name: numpydoc
-Version: 1.4.0
+Version: 1.5.0
Summary: Sphinx extension to support docstrings in Numpy format
Home-page: https://numpydoc.readthedocs.io
Author: Pauli Virtanen and others
@@ -17,6 +17,7 @@
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
+Classifier: Programming Language :: Python :: 3.11
Requires-Python: >=3.7
Provides-Extra: testing
License-File: LICENSE.txt
@@ -41,7 +42,7 @@
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
<https://numpydoc.readthedocs.io/>`_.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/numpydoc-1.4.0/numpydoc.egg-info/SOURCES.txt
new/numpydoc-1.5.0/numpydoc.egg-info/SOURCES.txt
--- old/numpydoc-1.4.0/numpydoc.egg-info/SOURCES.txt 2022-06-09
23:26:41.000000000 +0200
+++ new/numpydoc-1.5.0/numpydoc.egg-info/SOURCES.txt 2022-10-08
16:10:11.000000000 +0200
@@ -13,7 +13,6 @@
doc/install.rst
doc/make.bat
doc/release_notes.rst
-doc/requirements.txt
doc/validation.rst
numpydoc/__init__.py
numpydoc/__main__.py
@@ -40,4 +39,5 @@
numpydoc/tests/tinybuild/index.rst
numpydoc/tests/tinybuild/numpydoc_test_module.py
requirements/developer.txt
+requirements/doc.txt
requirements/test.txt
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/numpydoc-1.4.0/numpydoc.egg-info/requires.txt
new/numpydoc-1.5.0/numpydoc.egg-info/requires.txt
--- old/numpydoc-1.4.0/numpydoc.egg-info/requires.txt 2022-06-09
23:26:41.000000000 +0200
+++ new/numpydoc-1.5.0/numpydoc.egg-info/requires.txt 2022-10-08
16:10:11.000000000 +0200
@@ -1,4 +1,4 @@
-sphinx>=3.0
+sphinx>=4.2
Jinja2>=2.10
[testing]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/numpydoc-1.4.0/requirements/developer.txt
new/numpydoc-1.5.0/requirements/developer.txt
--- old/numpydoc-1.4.0/requirements/developer.txt 2022-05-27
22:38:55.000000000 +0200
+++ new/numpydoc-1.5.0/requirements/developer.txt 2022-07-27
00:15:00.000000000 +0200
@@ -1 +1 @@
-pre-commit>=2.19
+pre-commit>=2.20
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/numpydoc-1.4.0/requirements/doc.txt
new/numpydoc-1.5.0/requirements/doc.txt
--- old/numpydoc-1.4.0/requirements/doc.txt 1970-01-01 01:00:00.000000000
+0100
+++ new/numpydoc-1.5.0/requirements/doc.txt 2022-10-08 15:35:13.000000000
+0200
@@ -0,0 +1,4 @@
+numpy>=1.21
+matplotlib>=3.5
+pydata-sphinx-theme>=0.11
+sphinx>=5.2
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/numpydoc-1.4.0/setup.py new/numpydoc-1.5.0/setup.py
--- old/numpydoc-1.4.0/setup.py 2022-06-09 23:13:49.000000000 +0200
+++ new/numpydoc-1.5.0/setup.py 2022-10-04 23:41:44.000000000 +0200
@@ -46,13 +46,14 @@
"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",
author_email="[email protected]",
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": [