Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 31 Aug 2023 05:47:48 GMT
From:      Kai Knoblich <kai@FreeBSD.org>
To:        ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org
Subject:   git: 656e2aeca877 - main - textproc/py-mkdocstrings-python: New port
Message-ID:  <202308310547.37V5lmH9068296@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by kai:

URL: https://cgit.FreeBSD.org/ports/commit/?id=656e2aeca87724087da0235269e9d7ae1e6118e8

commit 656e2aeca87724087da0235269e9d7ae1e6118e8
Author:     Kai Knoblich <kai@FreeBSD.org>
AuthorDate: 2023-08-31 05:22:23 +0000
Commit:     Kai Knoblich <kai@FreeBSD.org>
CommitDate: 2023-08-31 05:43:40 +0000

    textproc/py-mkdocstrings-python: New port
    
    This Python handler for the "mkdocstrings" package uses Griffe
    (= textproc/py-griffe) 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 Griffe.
    
    * Support for type annotations: Griffe collects your type annotations
      and mkdocstrings uses them to display parameter types or return types.
    
    * Recursive documentation of Python objects: just use the module
      dotted-path as an 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. See Griffe's
      documentation on docstrings support.
---
 textproc/Makefile                         |  1 +
 textproc/py-mkdocstrings-python/Makefile  | 33 +++++++++++++++++++++++++++++++
 textproc/py-mkdocstrings-python/distinfo  |  3 +++
 textproc/py-mkdocstrings-python/pkg-descr | 22 +++++++++++++++++++++
 4 files changed, 59 insertions(+)

diff --git a/textproc/Makefile b/textproc/Makefile
index 44d82be858bc..e9ee6ca2a756 100644
--- a/textproc/Makefile
+++ b/textproc/Makefile
@@ -1438,6 +1438,7 @@
     SUBDIR += py-mkdocs-simple-hooks
     SUBDIR += py-mkdocstrings
     SUBDIR += py-mkdocstrings-crystal
+    SUBDIR += py-mkdocstrings-python
     SUBDIR += py-morse3
     SUBDIR += py-mwparserfromhell
     SUBDIR += py-myst-parser
diff --git a/textproc/py-mkdocstrings-python/Makefile b/textproc/py-mkdocstrings-python/Makefile
new file mode 100644
index 000000000000..00b48cd5653b
--- /dev/null
+++ b/textproc/py-mkdocstrings-python/Makefile
@@ -0,0 +1,33 @@
+PORTNAME=	mkdocstrings-python
+DISTVERSION=	1.6.0
+CATEGORIES=	textproc python
+MASTER_SITES=	PYPI
+PKGNAMEPREFIX=	${PYTHON_PKGNAMEPREFIX}
+DISTNAME=	mkdocstrings_python-${DISTVERSION}
+
+MAINTAINER=	kai@FreeBSD.org
+COMMENT=	Python handler for mkdocstrings
+WWW=		https://github.com/mkdocstrings/python
+
+LICENSE=	ISCL
+LICENSE_FILE=	${WRKSRC}/LICENSE
+
+BUILD_DEPENDS=	${PYTHON_PKGNAMEPREFIX}pdm-backend>0:devel/py-pdm-backend@${PY_FLAVOR}
+RUN_DEPENDS=	${PYTHON_PKGNAMEPREFIX}griffe>=0.35:textproc/py-griffe@${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' PYTHON option).  It was therefore
+# moved to TEST_DEPENDS to at least allow the test suite to run.
+
+USES=		python
+USE_PYTHON=	autoplist pep517 pytest
+# These tests relies on files that aren't available in the sdist
+PYTEST_IGNORED_TESTS=	test_render_themes test_render_docstring
+
+TEST_ENV=	PYTHONPATH=${STAGEDIR}${PYTHONPREFIX_SITELIBDIR}
+
+CONFLICTS_INSTALL=	${PYTHON_PKGNAMEPREFIX}mkdocstrings-python-legacy
+
+NO_ARCH=	yes
+
+.include <bsd.port.mk>
diff --git a/textproc/py-mkdocstrings-python/distinfo b/textproc/py-mkdocstrings-python/distinfo
new file mode 100644
index 000000000000..24927e75743e
--- /dev/null
+++ b/textproc/py-mkdocstrings-python/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1693377377
+SHA256 (mkdocstrings_python-1.6.0.tar.gz) = 6164ccaa6e488abc2a8fbccdfd1f21948c2c344d3f347847783a5d1c6fa2bfbf
+SIZE (mkdocstrings_python-1.6.0.tar.gz) = 29909
diff --git a/textproc/py-mkdocstrings-python/pkg-descr b/textproc/py-mkdocstrings-python/pkg-descr
new file mode 100644
index 000000000000..d5f664a96b83
--- /dev/null
+++ b/textproc/py-mkdocstrings-python/pkg-descr
@@ -0,0 +1,22 @@
+This Python handler for the "mkdocstrings" package uses Griffe
+(= textproc/py-griffe) 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 Griffe.
+
+* Support for type annotations: Griffe collects your type annotations and
+  mkdocstrings uses them to display parameter types or return types.
+
+* Recursive documentation of Python objects: just use the module dotted-path as
+  an 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. See Griffe's documentation on
+  docstrings support.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202308310547.37V5lmH9068296>