diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 25b53f36..aea73365 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: ec91a2be3c44d88e1a3960a4937ad6ed3b63464e # frozen: 23.12.1 + rev: e026c93888f91a47a9c9f4e029f3eb07d96375e6 # frozen: 24.1.1 hooks: - id: black diff --git a/numpydoc/__init__.py b/numpydoc/__init__.py index 97f53053..5458b67f 100644 --- a/numpydoc/__init__.py +++ b/numpydoc/__init__.py @@ -2,6 +2,7 @@ This package provides the numpydoc Sphinx extension for handling docstrings formatted according to the NumPy documentation format. """ + from ._version import __version__ diff --git a/numpydoc/__main__.py b/numpydoc/__main__.py index 4a50da9b..53d5c504 100644 --- a/numpydoc/__main__.py +++ b/numpydoc/__main__.py @@ -1,6 +1,7 @@ """ Implementing `python -m numpydoc` functionality. """ + import sys import argparse import ast diff --git a/numpydoc/docscrape.py b/numpydoc/docscrape.py index 315be6c3..4fbbe63c 100644 --- a/numpydoc/docscrape.py +++ b/numpydoc/docscrape.py @@ -1,6 +1,7 @@ """Extract reference documentation from the NumPy source tree. """ + import inspect import textwrap import re diff --git a/numpydoc/docscrape_sphinx.py b/numpydoc/docscrape_sphinx.py index 26a8e6b3..771c1ea4 100644 --- a/numpydoc/docscrape_sphinx.py +++ b/numpydoc/docscrape_sphinx.py @@ -373,9 +373,11 @@ def __str__(self, indent=0, func_role="obj"): "notes": self._str_section("Notes"), "references": self._str_references(), "examples": self._str_examples(), - "attributes": self._str_param_list("Attributes", fake_autosummary=True) - if self.attributes_as_param_list - else self._str_member_list("Attributes"), + "attributes": ( + self._str_param_list("Attributes", fake_autosummary=True) + if self.attributes_as_param_list + else self._str_member_list("Attributes") + ), "methods": self._str_member_list("Methods"), } ns = {k: "\n".join(v) for k, v in ns.items()} diff --git a/numpydoc/numpydoc.py b/numpydoc/numpydoc.py index 335de5a8..3513f95c 100644 --- a/numpydoc/numpydoc.py +++ b/numpydoc/numpydoc.py @@ -16,6 +16,7 @@ .. [1] https://github.com/numpy/numpydoc """ + from copy import deepcopy import re import pydoc