aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKai Knoblich <kai@FreeBSD.org>2023-08-31 05:27:25 +0000
committerKai Knoblich <kai@FreeBSD.org>2023-08-31 05:44:18 +0000
commit6b168f112781310a794a3ba68d99a38c819d9aba (patch)
treed40d3a2b4ef94046dd744a787c7271058389e9de
parente1c6e80783e10e0716b5cab7b1b0448d5f48f7ca (diff)
downloadports-6b168f112781310a794a3ba68d99a38c819d9aba.tar.gz
ports-6b168f112781310a794a3ba68d99a38c819d9aba.zip
textproc/py-mkdocstrings: Update to 0.22.0
* Introduce CRYSTAL, PYTHON and PYTHONLEGACY options to reflect the optional dependencies as noted in "pyproject.toml". Leave the last two as non-default for now, because both are mutually exclusive due conflicting dependencies. * Switch to PEP517 build framework and get rid of the no longer required workarounds for distutils. * Remove the backported patch for Jinja2 3.1+ compatibility which is also no longer needed. * Convert the test suite to USE_PYTHON=pytest as well. Changelogs since 0.17.0: https://github.com/mkdocstrings/mkdocstrings/blob/0.22.0/CHANGELOG.md
-rw-r--r--textproc/py-mkdocstrings/Makefile43
-rw-r--r--textproc/py-mkdocstrings/distinfo6
-rw-r--r--textproc/py-mkdocstrings/files/patch-setup.py44
-rw-r--r--textproc/py-mkdocstrings/files/patch-src_mkdocstrings_loggers.py34
4 files changed, 33 insertions, 94 deletions
diff --git a/textproc/py-mkdocstrings/Makefile b/textproc/py-mkdocstrings/Makefile
index 3b26f3a5d4a3..5d1896b78f99 100644
--- a/textproc/py-mkdocstrings/Makefile
+++ b/textproc/py-mkdocstrings/Makefile
@@ -1,6 +1,5 @@
PORTNAME= mkdocstrings
-DISTVERSION= 0.17.0
-PORTREVISION= 1
+DISTVERSION= 0.22.0
CATEGORIES= textproc python
PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
@@ -11,32 +10,50 @@ WWW= https://github.com/mkdocstrings/mkdocstrings
LICENSE= ISCL
LICENSE_FILE= ${WRKSRC}/LICENSE
+BUILD_DEPENDS= ${PYTHON_PKGNAMEPREFIX}pdm-backend>0:devel/py-pdm-backend@${PY_FLAVOR}
RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}Jinja2>=2.11.1:devel/py-Jinja2@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}markdown>=3.3:textproc/py-markdown@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}markupsafe>=1.1:textproc/py-markupsafe@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}mkdocs>=1.2:textproc/py-mkdocs@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}pymdown-extensions>=6.3:textproc/py-pymdown-extensions@${PY_FLAVOR} \
- ${PYTHON_PKGNAMEPREFIX}mkdocs-autorefs>=0.1:textproc/py-mkdocs-autorefs@${PY_FLAVOR} \
- ${PYTHON_PKGNAMEPREFIX}pytkdocs>=0.14.0:textproc/py-pytkdocs@${PY_FLAVOR}
+ ${PYTHON_PKGNAMEPREFIX}mkdocs-autorefs>=0.3.1:textproc/py-mkdocs-autorefs@${PY_FLAVOR}
TEST_DEPENDS= ${PYTHON_PKGNAMEPREFIX}pytest>0:devel/py-pytest@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}mkdocs-material>0:textproc/py-mkdocs-material@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}sphinx>0:textproc/py-sphinx@${PY_FLAVOR}
USES= python
USE_GITHUB= yes
-USE_PYTHON= autoplist distutils
+USE_PYTHON= autoplist pep517 pytest
+# Skip "test_sphinx_load_mkdocstrings_inventory_file" as it requires
+# mkdocs-gen-files (not in Ports tree, yet).
+# The same applies to "test_plugin" which requires markdown-exec (not in Ports
+# tree yet).
+PYTEST_IGNORED_TESTS= test_sphinx_load_mkdocstrings_inventory_file test_plugin
+# Required otherwise the build process tries to get the current version via git
+MAKE_ENV= PDM_BUILD_SCM_VERSION=${DISTVERSION}
TEST_ENV= PYTHONPATH=${STAGEDIR}${PYTHONPREFIX_SITELIBDIR}
NO_ARCH= yes
-post-patch:
- @${REINPLACE_CMD} -e 's|%%DISTVERSION%%|${DISTVERSION}|' ${WRKSRC}/setup.py
+OPTIONS_DEFINE= CRYSTAL
+OPTIONS_DEFAULT= CRYSTAL
+OPTIONS_RADIO= PYHANDLER
+OPTIONS_RADIO_PYHANDLER= PYTHON PYTHONLEGACY
-# Skip "test_sphinx_load_mkdocstrings_inventory_file" as it requires
-# mkdocs-gen-files (not in Ports tree, yet).
-do-test:
- @cd ${WRKSRC} && ${SETENV} ${TEST_ENV} ${PYTHON_CMD} -m pytest -v -rs \
- -k 'not test_sphinx_load_mkdocstrings_inventory_file'
+CRYSTAL_DESC= Crystal language handler
+PYTHONLEGACY_DESC= Legacy Python language handler
+PYTHON_DESC= Python language handler
+
+CRYSTAL_RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}mkdocstrings-crystal>=0.3.4:textproc/py-mkdocstrings-crystal@${PY_FLAVOR}
+PYTHONLEGACY_RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}mkdocstrings-python-legacy>=0.2.1:textproc/py-mkdocstrings-python-legacy@${PY_FLAVOR}
+PYTHON_RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}mkdocstrings-python>=0.5.2:textproc/py-mkdocstrings-python@${PY_FLAVOR}
+
+.include <bsd.port.pre.mk>
+
+.if ${PYTHON_REL} < 31000
+RUN_DEPENDS+= ${PYTHON_PKGNAMEPREFIX}importlib-metadata>=4.6:devel/py-importlib-metadata@${PY_FLAVOR} \
+ ${PYTHON_PKGNAMEPREFIX}typing-extensions>=4.1:devel/py-typing-extensions@${PY_FLAVOR}
+.endif
-.include <bsd.port.mk>
+.include <bsd.port.post.mk>
diff --git a/textproc/py-mkdocstrings/distinfo b/textproc/py-mkdocstrings/distinfo
index 7ffaec2dfc77..b6fe9927b69d 100644
--- a/textproc/py-mkdocstrings/distinfo
+++ b/textproc/py-mkdocstrings/distinfo
@@ -1,3 +1,3 @@
-TIMESTAMP = 1645976995
-SHA256 (mkdocstrings-mkdocstrings-0.17.0_GH0.tar.gz) = dcd8f03387c423bb1ddf6fbbec8dfa0432dfc3d01001adb4a0c07985f333971c
-SIZE (mkdocstrings-mkdocstrings-0.17.0_GH0.tar.gz) = 73551
+TIMESTAMP = 1688217280
+SHA256 (mkdocstrings-mkdocstrings-0.22.0_GH0.tar.gz) = fcabb0e22b5630de43ade2e26c3ace2d2d70f132a472da3fda0421571e24883d
+SIZE (mkdocstrings-mkdocstrings-0.22.0_GH0.tar.gz) = 81345
diff --git a/textproc/py-mkdocstrings/files/patch-setup.py b/textproc/py-mkdocstrings/files/patch-setup.py
deleted file mode 100644
index 99fdbaca862e..000000000000
--- a/textproc/py-mkdocstrings/files/patch-setup.py
+++ /dev/null
@@ -1,44 +0,0 @@
---- setup.py.orig 2022-02-28 05:29:01 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 = [
-+ 'Jinja2>=2.11.1',
-+ 'Markdown>=3.3',
-+ 'MarkupSafe>=1.1',
-+ 'mkdocs>=1.2',
-+ 'mkdocs-autorefs>=0.1',
-+ 'pymdown-extensions>=6.3',
-+ 'pytkdocs>=0.14.0',
-+]
-+ENTRY_POINTS = {
-+ 'mkdocs.plugins': [
-+ 'mkdocstrings = mkdocstrings.plugin:MkdocstringsPlugin',
-+ ],
-+}
-+
-+setup_kwargs = {
-+ 'name': 'mkdocstrings',
-+ 'version': '%%DISTVERSION%%',
-+ 'description': 'Automatic documentation from sources, for MkDocs.',
-+ 'author': '',
-+ 'author_email': 'Timothée Mazzucotelli <pawamoy@pm.me>',
-+ 'package_dir': {'': 'src/'},
-+ 'packages': [
-+ 'mkdocstrings',
-+ 'mkdocstrings.handlers',
-+ 'mkdocstrings.templates.python',
-+ 'mkdocstrings.templates.python.material',
-+ 'mkdocstrings.templates.python.mkdocs',
-+ 'mkdocstrings.templates.python.readthedocs'
-+ ],
-+ 'package_data': {'': ['*']},
-+ 'install_requires': INSTALL_REQUIRES,
-+ 'python_requires': '>=3.6.2',
-+ 'entry_points': ENTRY_POINTS,
-+}
-+
-+setup(**setup_kwargs)
diff --git a/textproc/py-mkdocstrings/files/patch-src_mkdocstrings_loggers.py b/textproc/py-mkdocstrings/files/patch-src_mkdocstrings_loggers.py
deleted file mode 100644
index defa90fffce3..000000000000
--- a/textproc/py-mkdocstrings/files/patch-src_mkdocstrings_loggers.py
+++ /dev/null
@@ -1,34 +0,0 @@
-From: =?UTF-8?q?Timoth=C3=A9e=20Mazzucotelli?= <pawamoy@pm.me>
-Date: Wed, 2 Feb 2022 12:27:27 +0100
-Subject: [PATCH] refactor: Support Jinja2 3.1
-
-Issue #360: https://github.com/mkdocstrings/mkdocstrings/issues/360
-PR #361: https://github.com/mkdocstrings/mkdocstrings/issues/361
-
---- src/mkdocstrings/loggers.py.orig 2021-12-27 17:59:33 UTC
-+++ src/mkdocstrings/loggers.py
-@@ -4,10 +4,14 @@ from typing import Any, Callable, Optional, Tuple
- from pathlib import Path
- from typing import Any, Callable, Optional, Tuple
-
--from jinja2 import contextfunction
- from jinja2.runtime import Context
- from mkdocs.utils import warning_filter
-
-+try:
-+ from jinja2 import pass_context
-+except ImportError: # TODO: remove once Jinja2 < 3.1 is dropped
-+ from jinja2 import contextfunction as pass_context # noqa: WPS440
-+
- TEMPLATES_DIR = Path(__file__).parent / "templates"
-
-
-@@ -71,7 +75,7 @@ def get_template_logger_function(logger_func: Callable
- A function.
- """
-
-- @contextfunction
-+ @pass_context
- def wrapper(context: Context, msg: Optional[str] = None) -> str:
- """Log a message.
-