diff --git a/1.patch b/1.patch new file mode 100644 index 0000000..335b2aa --- /dev/null +++ b/1.patch @@ -0,0 +1,23 @@ +From 2a7f4837e4731181c13f18641950b39b356c8ed3 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Hrn=C4=8Diar?= +Date: Wed, 28 Jun 2023 13:32:53 +0200 +Subject: [PATCH] Replace ast.NameConstant deprecated in Python 3.12 with + ast.Constant + +--- + numpydoc/validate.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/numpydoc/validate.py b/numpydoc/validate.py +index b975f831..c49f97af 100644 +--- a/numpydoc/validate.py ++++ b/numpydoc/validate.py +@@ -416,7 +416,7 @@ def get_returns_not_on_nested_functions(node): + return_values = [r.value for r in returns] + # Replace NameConstant nodes valued None for None. + for i, v in enumerate(return_values): +- if isinstance(v, ast.NameConstant) and v.value is None: ++ if isinstance(v, ast.Constant) and v.value is None: + return_values[i] = None + return any(return_values) + else: diff --git a/python-numpydoc.spec b/python-numpydoc.spec index 5898056..3e68dad 100644 --- a/python-numpydoc.spec +++ b/python-numpydoc.spec @@ -3,6 +3,9 @@ Version: 1.4.0 Release: 3%{?dist} Summary: Sphinx extension to support docstrings in NumPy format +# Replace ast.NameConstant deprecated in Python 3.12 with ast.Constant +Patch: https://github.com/hrnciar/numpydoc/pull/1.patch + License: BSD URL: https://pypi.python.org/pypi/numpydoc Source0: https://files.pythonhosted.org/packages/source/n/numpydoc/numpydoc-%{version}.tar.gz