git: f15afaec9821 - main - textproc/py-pytkdocs: New port

From: Kai Knoblich <kai_at_FreeBSD.org>
Date: Mon, 28 Feb 2022 12:03:27 UTC
The branch main has been updated by kai:

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

commit f15afaec9821f2c76259d3c959d3d67c9463fa7e
Author:     Kai Knoblich <kai@FreeBSD.org>
AuthorDate: 2022-02-28 11:47:02 +0000
Commit:     Kai Knoblich <kai@FreeBSD.org>
CommitDate: 2022-02-28 11:47:02 +0000

    textproc/py-pytkdocs: New port
    
    This Python package is used to load Python objects documentation.
    
    It accepts JSON on standard input and writes JSON on standard output.
    
    WWW: https://github.com/mkdocstrings/pytkdocs
---
 textproc/Makefile                         |  1 +
 textproc/py-pytkdocs/Makefile             | 48 +++++++++++++++++++++++++++++++
 textproc/py-pytkdocs/distinfo             |  3 ++
 textproc/py-pytkdocs/files/patch-setup.py | 44 ++++++++++++++++++++++++++++
 textproc/py-pytkdocs/pkg-descr            |  4 +++
 5 files changed, 100 insertions(+)

diff --git a/textproc/Makefile b/textproc/Makefile
index b502ac5c204f..b24af10abded 100644
--- a/textproc/Makefile
+++ b/textproc/Makefile
@@ -1438,6 +1438,7 @@
     SUBDIR += py-python-slugify
     SUBDIR += py-python-xmp-toolkit
     SUBDIR += py-pytidylib
+    SUBDIR += py-pytkdocs
     SUBDIR += py-pytoml
     SUBDIR += py-pyx12
     SUBDIR += py-qrcode
diff --git a/textproc/py-pytkdocs/Makefile b/textproc/py-pytkdocs/Makefile
new file mode 100644
index 000000000000..6f854fdcafc0
--- /dev/null
+++ b/textproc/py-pytkdocs/Makefile
@@ -0,0 +1,48 @@
+PORTNAME=	pytkdocs
+DISTVERSION=	0.16.0
+CATEGORIES=	textproc python
+MASTER_SITES=	CHEESESHOP
+PKGNAMEPREFIX=	${PYTHON_PKGNAMEPREFIX}
+
+MAINTAINER=	kai@FreeBSD.org
+COMMENT=	Load Python objects documentation
+
+LICENSE=	ISCL
+LICENSE_FILE=	${WRKSRC}/LICENSE
+
+TEST_DEPENDS=	${PYTHON_PKGNAMEPREFIX}pytest>0:devel/py-pytest@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}django32>0:www/py-django32@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}marshmallow>0:devel/py-marshmallow@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}pydantic>0:devel/py-pydantic@${PY_FLAVOR}
+
+USES=		python:3.7+
+USE_PYTHON=	autoplist concurrent distutils
+
+TEST_ENV=	PYTHONPATH=${STAGEDIR}${PYTHONPREFIX_SITELIBDIR}
+
+NO_ARCH=	yes
+
+OPTIONS_DEFINE=		NUMPYSTYLE
+OPTIONS_DEFAULT=	NUMPYSTYLE
+
+NUMPYSTYLE_DESC=	Enable support for Numpy docstrings
+NUMPYSTYLE_RUN_DEPENDS=	${PYTHON_PKGNAMEPREFIX}docstring-parser>=0.7:textproc/py-docstring-parser@${PY_FLAVOR}
+
+.include <bsd.port.pre.mk>
+
+.if ${PYTHON_REL} < 30900
+RUN_DEPENDS+=	${PYTHON_PKGNAMEPREFIX}astunparse>=1.6:devel/py-astunparse@${PY_FLAVOR}
+.endif
+
+.if ${PYTHON_REL} < 30800
+RUN_DEPENDS+=	${PYTHON_PKGNAMEPREFIX}cached-property>=1.5:devel/py-cached-property@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}typing-extensions>=3.7:devel/py-typing-extensions@${PY_FLAVOR}
+.endif
+
+post-patch:
+	@${REINPLACE_CMD} -e 's|%%DISTVERSION%%|${DISTVERSION}|' ${WRKSRC}/setup.py
+
+do-test:
+	@cd ${WRKSRC} && ${SETENV} ${TEST_ENV} ${PYTHON_CMD} -m pytest -v -rs
+
+.include <bsd.port.post.mk>
diff --git a/textproc/py-pytkdocs/distinfo b/textproc/py-pytkdocs/distinfo
new file mode 100644
index 000000000000..90ff9cb23946
--- /dev/null
+++ b/textproc/py-pytkdocs/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1645878263
+SHA256 (pytkdocs-0.16.0.tar.gz) = 274407bcefec58d7e411adb03b84da49120107912b1697d17d4a3aea0583f388
+SIZE (pytkdocs-0.16.0.tar.gz) = 56085
diff --git a/textproc/py-pytkdocs/files/patch-setup.py b/textproc/py-pytkdocs/files/patch-setup.py
new file mode 100644
index 000000000000..5da3bac57aaa
--- /dev/null
+++ b/textproc/py-pytkdocs/files/patch-setup.py
@@ -0,0 +1,44 @@
+--- setup.py.orig	2022-02-28 05:25:48 UTC
++++ setup.py
+@@ -0,0 +1,41 @@
++# Generated via "pdm export -f setuppy" (run "pdm lock" beforehand)
++#
++# -*- coding: utf-8 -*-
++from setuptools import setup
++
++INSTALL_REQUIRES = [
++    "astunparse>=1.6; python_version < '3.9'",
++    "cached-property>=1.5; python_version < '3.8'",
++    "typing-extensions>=3.7; python_version < '3.8'",
++]
++EXTRAS_REQUIRE = {
++    'numpy-style': [
++        'docstring_parser>=0.7',
++    ],
++}
++ENTRY_POINTS = {
++    'console_scripts': [
++        'pytkdocs = pytkdocs.cli:main',
++    ],
++}
++
++setup_kwargs = {
++    'name': 'pytkdocs',
++    'version': '%%DISTVERSION%%',
++    'description': 'Load Python objects documentation.',
++    'author': '',
++    'author_email': 'Timothée Mazzucotelli <pawamoy@pm.me>',
++    'packages': [
++        'pytkdocs',
++        'pytkdocs.parsers',
++        'pytkdocs.parsers.docstrings',
++    ],
++    'package_dir': {'': 'src'},
++    'package_data': {'': ['*']},
++    'install_requires': INSTALL_REQUIRES,
++    'extras_require': EXTRAS_REQUIRE,
++    'python_requires': '>=3.7',
++    'entry_points': ENTRY_POINTS,
++}
++
++setup(**setup_kwargs)
diff --git a/textproc/py-pytkdocs/pkg-descr b/textproc/py-pytkdocs/pkg-descr
new file mode 100644
index 000000000000..6450f1ee4a3f
--- /dev/null
+++ b/textproc/py-pytkdocs/pkg-descr
@@ -0,0 +1,4 @@
+This Python package is used to load Python objects documentation.  It accepts
+JSON on standard input and writes JSON on standard output.
+
+WWW: https://github.com/mkdocstrings/pytkdocs