summaryrefslogtreecommitdiff
path: root/textproc/py-pytkdocs
diff options
context:
space:
mode:
authorKai Knoblich <kai@FreeBSD.org>2022-02-28 12:47:02 +0100
committerKai Knoblich <kai@FreeBSD.org>2022-02-28 12:47:02 +0100
commitf15afaec9821f2c76259d3c959d3d67c9463fa7e (patch)
tree1a26e75fc8d82bc5a7eb96076a778f17997d1881 /textproc/py-pytkdocs
parenttextproc/py-docstring-parser: New port (diff)
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
Diffstat (limited to 'textproc/py-pytkdocs')
-rw-r--r--textproc/py-pytkdocs/Makefile48
-rw-r--r--textproc/py-pytkdocs/distinfo3
-rw-r--r--textproc/py-pytkdocs/files/patch-setup.py44
-rw-r--r--textproc/py-pytkdocs/pkg-descr4
4 files changed, 99 insertions, 0 deletions
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