From 945f051c52b1ceed70f7611d50e37da1a209c0a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= Date: Sat, 19 Jul 2025 08:28:00 +0200 Subject: [PATCH] dev-python/numpydoc: Add a quick patch for upstream regression MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add a quick patch for the regression causing `AttributeError` in dev-python/scikit-learn. Bug: https://github.com/numpy/numpydoc/issues/638 Signed-off-by: Michał Górny --- .../numpydoc/files/numpydoc-1.9.0-638.patch | 16 ++++++++++++++++ ...doc-1.9.0.ebuild => numpydoc-1.9.0-r1.ebuild} | 5 +++++ 2 files changed, 21 insertions(+) create mode 100644 dev-python/numpydoc/files/numpydoc-1.9.0-638.patch rename dev-python/numpydoc/{numpydoc-1.9.0.ebuild => numpydoc-1.9.0-r1.ebuild} (92%) diff --git a/dev-python/numpydoc/files/numpydoc-1.9.0-638.patch b/dev-python/numpydoc/files/numpydoc-1.9.0-638.patch new file mode 100644 index 0000000000000..62747199aaf94 --- /dev/null +++ b/dev-python/numpydoc/files/numpydoc-1.9.0-638.patch @@ -0,0 +1,16 @@ +diff --git a/numpydoc/validate.py b/numpydoc/validate.py +index d0debfa..6d7b369 100644 +--- a/numpydoc/validate.py ++++ b/numpydoc/validate.py +@@ -640,9 +640,9 @@ def validate(obj_name, validator_cls=None, **validator_kwargs): + # Check if the object is a class and has a docstring in the constructor + # Also check if code_obj is defined, as undefined for the AstValidator in validate_docstrings.py. + if ( +- doc.name.endswith(".__init__") +- and doc.is_function_or_method ++ doc.is_function_or_method + and hasattr(doc, "code_obj") ++ and doc.name.endswith(".__init__") + ): + cls_name = doc.code_obj.__qualname__.split(".")[0] + cls = Validator._load_obj(f"{doc.code_obj.__module__}.{cls_name}") diff --git a/dev-python/numpydoc/numpydoc-1.9.0.ebuild b/dev-python/numpydoc/numpydoc-1.9.0-r1.ebuild similarity index 92% rename from dev-python/numpydoc/numpydoc-1.9.0.ebuild rename to dev-python/numpydoc/numpydoc-1.9.0-r1.ebuild index 75621e26059af..7614fbee6b535 100644 --- a/dev-python/numpydoc/numpydoc-1.9.0.ebuild +++ b/dev-python/numpydoc/numpydoc-1.9.0-r1.ebuild @@ -34,6 +34,11 @@ BDEPEND=" ) " +PATCHES=( + # https://github.com/numpy/numpydoc/issues/638 + "${FILESDIR}/${P}-638.patch" +) + EPYTEST_PLUGINS=() distutils_enable_tests pytest