From nobody Fri Nov 18 06:46:36 2022 X-Original-To: dev-commits-ports-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4ND6l052j3z4hc2F; Fri, 18 Nov 2022 06:46:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ND6l04TVTz4R9g; Fri, 18 Nov 2022 06:46:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1668753996; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZzVKoX/69C/dY/dCqVLgvADIRdMU1LQMyn1hq23qF0M=; b=qIcrgqvd8EQI+scCDQAnFcxGzoOH3XEHBJ+af9+aJuiWcQ9eYU++bR7LcmhBSlXSIlvFpk 1Z5LMn1299DLs+J7kGwmRFKNlDe9Arja5oXAV+UR7qZChMuBsF2JerEVpBKPZwDNrCZWkr 4PjEa3WsKXuPL1xiV2TKy78tvQEZqzyDOVSnwR/0XD1hCvZSXJXTaA/tM+NKS7omL7Gfir EadyflgbM/wIOrk64fMWe+rhbKZBgITl6ZBMMGVaMOiucWjoVfUCswgkBmA6t6EuKS0nm0 TXwoHYEFWCf9UvySVkCXWF61ociC6F95DkztQJLdscwsI5/ihC4SVo0/n+4C0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1668753996; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZzVKoX/69C/dY/dCqVLgvADIRdMU1LQMyn1hq23qF0M=; b=sy15SO9kHoglecuoWASTCdaLTmAvFBKhqgOikrsxOFPyglCdRJXDt+gKNyxiWS6LwGyF+E 221rVIwrbTAV0pbB1wAVAbMv+w3IT82QZz0YIKbvAmqTXTMYC53tmn0kL0rfrb8dWvpHLi wOxKfRgjZqmUUKhLvzipGWqPiWo7r0PvYJd7bWoT5XVREKc0jftSvw+1R9GgnQA66AdqzF LAapO1x26YTaZiI3WDcr2+b/zTd/tA8bvC4yTwCf0kkdNdBZXcPdQ/60ZDtXXebQ69C1uO oSDIwnnp6nZJM/zndwgSACZQvfhvOfBTzfqB/mczB6p0dfnA+PkQoLlFCNfcvA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1668753996; a=rsa-sha256; cv=none; b=It7VZXN7zd+RkCj3Hdxn1USG6SOJ0MxGVlNSGWoUo/CIpDRGHJ/xbdneAf3leRgkC2kByw vT+G4sDAYbtX1DPNFoyRacj+4NE3+uWTIehMGkgR7/LXkMm+dIs9QBMGdYfzmNItiaFVXr +bQVxOgomWR9NUa8aiXygF805PYGLSolAPSf5g4+pfBHksrgeEMYueROKQRW7BtkMtGiF3 p5fWdol3ZxBuDlxv4M5wptqZrwdv18LBVXDKUh0rzYKEs2ymoYmzgjJ/ZJfEa/Pr8Ei/0Q Jk/UPRKXsBaDbW+KLmZci9fL4Fv88tS2wjPnnivQSohIJclEYHCtjyU/sWioGA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4ND6l03VlFz1BFG; Fri, 18 Nov 2022 06:46:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 2AI6ka18034205; Fri, 18 Nov 2022 06:46:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2AI6ka7o034203; Fri, 18 Nov 2022 06:46:36 GMT (envelope-from git) Date: Fri, 18 Nov 2022 06:46:36 GMT Message-Id: <202211180646.2AI6ka7o034203@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Kai Knoblich Subject: git: c97b0646fcb8 - main - textproc/py-mkdocstrings: Add support for Jinja2 3.1 List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-main@freebsd.org X-BeenThere: dev-commits-ports-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kai X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c97b0646fcb8289dadcbbada96cb457a0f7c1b53 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kai: URL: https://cgit.FreeBSD.org/ports/commit/?id=c97b0646fcb8289dadcbbada96cb457a0f7c1b53 commit c97b0646fcb8289dadcbbada96cb457a0f7c1b53 Author: Kai Knoblich AuthorDate: 2022-11-18 06:39:43 +0000 Commit: Kai Knoblich CommitDate: 2022-11-18 06:39:43 +0000 textproc/py-mkdocstrings: Add support for Jinja2 3.1 * The newer releases of py-mkdocstrings need some additional dependencies, which are not yet available as ports. Thus backport a patch of the 0.18.0 release to add compatibility for Jinja2 3.1. This fixes the runtime regarding "contextfunction" that was replaced with "pass_context" in Jinja2 3.1 after 23cc43859179. * Bump PORTREVISION due package change. --- textproc/py-mkdocstrings/Makefile | 1 + .../files/patch-src_mkdocstrings_loggers.py | 34 ++++++++++++++++++++++ 2 files changed, 35 insertions(+) diff --git a/textproc/py-mkdocstrings/Makefile b/textproc/py-mkdocstrings/Makefile index 791c81be8efc..0b44e2548343 100644 --- a/textproc/py-mkdocstrings/Makefile +++ b/textproc/py-mkdocstrings/Makefile @@ -1,5 +1,6 @@ PORTNAME= mkdocstrings DISTVERSION= 0.17.0 +PORTREVISION= 1 CATEGORIES= textproc python PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} diff --git a/textproc/py-mkdocstrings/files/patch-src_mkdocstrings_loggers.py b/textproc/py-mkdocstrings/files/patch-src_mkdocstrings_loggers.py new file mode 100644 index 000000000000..defa90fffce3 --- /dev/null +++ b/textproc/py-mkdocstrings/files/patch-src_mkdocstrings_loggers.py @@ -0,0 +1,34 @@ +From: =?UTF-8?q?Timoth=C3=A9e=20Mazzucotelli?= +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. +