summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMathieu Othacehe <othacehe@gnu.org>2022-01-04 12:45:29 +0100
committerMathieu Othacehe <othacehe@gnu.org>2022-01-04 12:45:29 +0100
commit84207eea2c564052c05757fb0397d35088a43657 (patch)
treeb107fc5bb9bb899ff5066faf07b60f5737f7b673
parente62c35f506bb6291c4e3ff67ac35e5646c9470aa (diff)
gnu: Add python-pdoc3.
* gnu/packages/patches/python-pdoc3-tests.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. * gnu/local.mk (python-pdoc3): New variable.
-rw-r--r--gnu/local.mk1
-rw-r--r--gnu/packages/patches/python-pdoc3-tests.patch42
-rw-r--r--gnu/packages/python-xyz.scm25
3 files changed, 67 insertions, 1 deletions
diff --git a/gnu/local.mk b/gnu/local.mk
index d63978f705..c8ec622aa1 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1676,6 +1676,7 @@ dist_patch_DATA = \
%D%/packages/patches/python-fixtures-remove-monkeypatch-test.patch \
%D%/packages/patches/python-flask-restful-werkzeug-compat.patch \
%D%/packages/patches/python-keras-integration-test.patch \
+ %D%/packages/patches/python-pdoc3-tests.patch \
%D%/packages/patches/python-peachpy-determinism.patch \
%D%/packages/patches/python-pep8-stdlib-tokenize-compat.patch \
%D%/packages/patches/python-pyfakefs-remove-bad-test.patch \
diff --git a/gnu/packages/patches/python-pdoc3-tests.patch b/gnu/packages/patches/python-pdoc3-tests.patch
new file mode 100644
index 0000000000..a411b300ee
--- /dev/null
+++ b/gnu/packages/patches/python-pdoc3-tests.patch
@@ -0,0 +1,42 @@
+Taken from upstream: https://github.com/pdoc3/pdoc/commit/4aa70de2221a34a3003a7e5f52a9b91965f0e359.patch.
+
+From 4aa70de2221a34a3003a7e5f52a9b91965f0e359 Mon Sep 17 00:00:00 2001
+From: Spencer Baugh <sbaugh@catern.com>
+Date: Thu, 23 Sep 2021 09:00:25 -0400
+Subject: [PATCH] TST: use explicit ClassWithNew instead of typing.Generic
+
+typing.Generic doesn't have a __new__ method in 3.9.
+
+Fixes https://github.com/pdoc3/pdoc/issues/355
+---
+ pdoc/test/__init__.py | 10 +++++++---
+ 1 file changed, 7 insertions(+), 3 deletions(-)
+
+diff --git a/pdoc/test/__init__.py b/pdoc/test/__init__.py
+index e8c3d94..8b67ab7 100644
+--- a/pdoc/test/__init__.py
++++ b/pdoc/test/__init__.py
+@@ -1043,16 +1043,20 @@ class C2:
+
+ self.assertEqual(pdoc.Class('C2', mod, C2).params(), ['a', 'b', 'c=None', '*', 'd=1', 'e'])
+
+- class G(typing.Generic[T]):
++ class ClassWithNew:
++ def __new__(self, arg):
++ pass
++
++ class G(ClassWithNew):
+ def __init__(self, a, b, c=100):
+ pass
+
+ self.assertEqual(pdoc.Class('G', mod, G).params(), ['a', 'b', 'c=100'])
+
+- class G2(typing.Generic[T]):
++ class G2(ClassWithNew):
+ pass
+
+- self.assertEqual(pdoc.Class('G2', mod, G2).params(), ['*args', '**kwds'])
++ self.assertEqual(pdoc.Class('G2', mod, G2).params(), ['arg'])
+
+ def test_url(self):
+ mod = pdoc.Module(EXAMPLE_MODULE)
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 01992dc729..e04b4f973f 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -37,7 +37,7 @@
;;; Copyright © 2017 Frederick M. Muriithi <fredmanglis@gmail.com>
;;; Copyright © 2017, 2018 Adriano Peluso <catonano@gmail.com>
;;; Copyright © 2017 Ben Sturmfels <ben@sturm.com.au>
-;;; Copyright © 2017, 2018, 2019, 2021 Mathieu Othacehe <m.othacehe@gmail.com>
+;;; Copyright © 2017, 2018, 2019, 2021, 2022 Mathieu Othacehe <m.othacehe@gmail.com>
;;; Copyright © 2017 José Miguel Sánchez García <jmi2k@openmailbox.org>
;;; Copyright © 2017, 2020, 2021 Roel Janssen <roel@gnu.org>
;;; Copyright © 2017, 2018, 2019 Kei Kebreau <kkebreau@posteo.net>
@@ -27916,3 +27916,26 @@ keyboard-friendly package.")
(description
"This package provides a Python interface to iw wireless tools.")
(license license:gpl2)))
+
+(define-public python-pdoc3
+ (package
+ (name "python-pdoc3")
+ (version "0.10.0")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (pypi-uri "pdoc3" version))
+ (sha256
+ (base32 "1dz4hw10ngidzg9cjvflc8nlrwrjbb3ijhmaw4w6f039p6yff8jz"))
+ (patches
+ (search-patches "python-pdoc3-tests.patch"))))
+ (build-system python-build-system)
+ (native-inputs
+ (list python-setuptools-git python-setuptools-scm))
+ (propagated-inputs (list python-mako python-markdown))
+ (home-page "https://pdoc3.github.io/pdoc/")
+ (synopsis "Auto-generate API documentation for Python projects")
+ (description
+ "This package auto-generates API documentation from Python projects
+already existing modules and objects docstrings.")
+ (license license:agpl3+)))