summaryrefslogtreecommitdiff
path: root/textproc/py-mkdocstrings-python-legacy
diff options
context:
space:
mode:
authorKai Knoblich <kai@FreeBSD.org>2023-08-31 07:25:26 +0200
committerKai Knoblich <kai@FreeBSD.org>2023-08-31 07:44:11 +0200
commite1c6e80783e10e0716b5cab7b1b0448d5f48f7ca (patch)
tree56fde5332dd962866d67b02e3f51107d204e3b9e /textproc/py-mkdocstrings-python-legacy
parenttextproc/py-mkdocstrings-python: New port (diff)
textproc/py-mkdocstrings-python-legacy: New port
This Python handler for the "mkdocstrings" package uses PyTkDocs (= textproc/py-pytkdocs) to collect documentation from Python source code. Features: * Data collection from source code: collection of the object-tree and the docstrings is done thanks to pytkdocs. * Support for type annotations: pytkdocs collects your type annotations and mkdocstrings uses them to display parameters types or return types. * Recursive documentation of Python objects: just use the module dotted-path as identifier, and you get the full module docs. You don't need to inject documentation for each class, function, etc. * Support for documented attributes: attributes (variables) followed by a docstring (triple-quoted string) will be recognized by Griffe in modules, classes and even in __init__ methods. * Multiple docstring-styles support: common support for Google-style, Numpydoc-style, and Sphinx-style docstrings.
Diffstat (limited to 'textproc/py-mkdocstrings-python-legacy')
-rw-r--r--textproc/py-mkdocstrings-python-legacy/Makefile31
-rw-r--r--textproc/py-mkdocstrings-python-legacy/distinfo3
-rw-r--r--textproc/py-mkdocstrings-python-legacy/files/patch-pyproject.toml23
-rw-r--r--textproc/py-mkdocstrings-python-legacy/pkg-descr21
4 files changed, 78 insertions, 0 deletions
diff --git a/textproc/py-mkdocstrings-python-legacy/Makefile b/textproc/py-mkdocstrings-python-legacy/Makefile
new file mode 100644
index 000000000000..c6ceaa599bea
--- /dev/null
+++ b/textproc/py-mkdocstrings-python-legacy/Makefile
@@ -0,0 +1,31 @@
+PORTNAME= mkdocstrings-python-legacy
+DISTVERSION= 0.2.3
+CATEGORIES= textproc python
+MASTER_SITES= PYPI
+PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
+
+MAINTAINER= kai@FreeBSD.org
+COMMENT= Legacy Python handler for mkdocstrings
+WWW= https://github.com/mkdocstrings/python-legacy
+
+LICENSE= ISCL
+LICENSE_FILE= ${WRKSRC}/LICENSE
+
+BUILD_DEPENDS= ${PYTHON_PKGNAMEPREFIX}pdm-pep517>0:devel/py-pdm-pep517@${PY_FLAVOR}
+RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}pytkdocs>=0.14:textproc/py-pytkdocs@${PY_FLAVOR}
+TEST_DEPENDS= ${PYTHON_PKGNAMEPREFIX}mkdocstrings>0:textproc/py-mkdocstrings@${PY_FLAVOR}
+# textproc/py-mkdocstrings belongs to RUN_DEPENDS as well but would cause
+# a circular dependency (via py-mkdocstrings' PYTHONLEGACY option). It was
+# therefore # moved to TEST_DEPENDS to at least allow the test suite to run.
+
+USES= python
+USE_PYTHON= autoplist pep517 pytest
+PYTEST_IGNORED_TESTS= render_themes
+
+TEST_ENV= PYTHONPATH=${STAGEDIR}${PYTHONPREFIX_SITELIBDIR}
+
+CONFLICTS_INSTALL= ${PYTHON_PKGNAMEPREFIX}mkdocstrings-python
+
+NO_ARCH= yes
+
+.include <bsd.port.mk>
diff --git a/textproc/py-mkdocstrings-python-legacy/distinfo b/textproc/py-mkdocstrings-python-legacy/distinfo
new file mode 100644
index 000000000000..4cf7018cef74
--- /dev/null
+++ b/textproc/py-mkdocstrings-python-legacy/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1688218792
+SHA256 (mkdocstrings-python-legacy-0.2.3.tar.gz) = 3fb58fdabe19c6b52b8bb1d3bb1540b1cd527b562865468d6754e8cd1201050c
+SIZE (mkdocstrings-python-legacy-0.2.3.tar.gz) = 18779
diff --git a/textproc/py-mkdocstrings-python-legacy/files/patch-pyproject.toml b/textproc/py-mkdocstrings-python-legacy/files/patch-pyproject.toml
new file mode 100644
index 000000000000..117ead8b89a1
--- /dev/null
+++ b/textproc/py-mkdocstrings-python-legacy/files/patch-pyproject.toml
@@ -0,0 +1,23 @@
+Workaround to prevent following error:
+
+[...]
+ File "/usr/local/lib/python3.9/site-packages/pdm/pep517/metadata.py", line 58, in validate
+ return validate_pep621(self.data, raising)
+ File "/usr/local/lib/python3.9/site-packages/pdm/pep517/validator.py", line 85, in validate_pep621
+ raise PEP621ValidationError(validator.errors)
+pdm.pep517.exceptions.PEP621ValidationError: {'license-expression': ['unknown field']}
+
+ERROR Backend subprocess exited when trying to invoke get_requires_for_build_wheel
+*** Error code 1
+[...]
+
+--- pyproject.toml.orig 2022-05-28 13:34:29 UTC
++++ pyproject.toml
+@@ -10,7 +10,6 @@ authors = [
+ authors = [
+ { name = "Timothée Mazzucotelli", email = "pawamoy@pm.me" },
+ ]
+-license-expression = "ISC"
+ readme = "README.md"
+ requires-python = ">=3.7"
+ keywords = []
diff --git a/textproc/py-mkdocstrings-python-legacy/pkg-descr b/textproc/py-mkdocstrings-python-legacy/pkg-descr
new file mode 100644
index 000000000000..f02e2f73ebd8
--- /dev/null
+++ b/textproc/py-mkdocstrings-python-legacy/pkg-descr
@@ -0,0 +1,21 @@
+This Python handler for the "mkdocstrings" package uses PyTkDocs
+(= textproc/py-pytkdocs) to collect documentation from Python source code.
+
+Features:
+
+* Data collection from source code: collection of the object-tree and the
+ docstrings is done thanks to pytkdocs.
+
+* Support for type annotations: pytkdocs collects your type annotations and
+ mkdocstrings uses them to display parameters types or return types.
+
+* Recursive documentation of Python objects: just use the module dotted-path as
+ identifier, and you get the full module docs. You don't need to inject
+ documentation for each class, function, etc.
+
+* Support for documented attributes: attributes (variables) followed by a
+ docstring (triple-quoted string) will be recognized by Griffe in modules,
+ classes and even in __init__ methods.
+
+* Multiple docstring-styles support: common support for Google-style,
+ Numpydoc-style, and Sphinx-style docstrings.