From nobody Sat Jul 13 17:12:22 2024 X-Original-To: dev-commits-ports-all@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 4WLw4k4HG9z5QkRT; Sat, 13 Jul 2024 17:12:22 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WLw4k3rcmz4m71; Sat, 13 Jul 2024 17:12:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720890742; 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=XRUEZ8qK8QlT3vYUiG7TtkSf54B7U42TOwQioXr1JFk=; b=FDWqwDkvLvRj8Y0A6SR6ZU6G3LXq/ua+JTqXBhA2WKnIsW9pOpvKbpTwS6jFThvbkuKXCQ z1lf5lnQn/FA5sN8gxnMyF0fLA3PiNc7/TFrhJ29wsEv1flFHgAH9OXjSsqipHjkalEmZM GBM/X+wFKLZkpx6I7Qpf/lzPdWnolh2HbaQjG5QmPxPzceyn79EiQj6CbxcG7L/ofwTpqG tXMnrWzyoP46SGBTgR2i4E8DHqBWqtYY5lbqTEOoDcEWyY75pTqR/PpIkZIn/nA9oI4yL/ HCs2svvAHqhZcjs2KngBjqYq5nn/vGKQjpwanD0BWcgpjWXD5IDH9QF+CK4OPQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720890742; a=rsa-sha256; cv=none; b=FqWt2Qj8raQdEVvWTRXsqvSt8Y7vvDpQMjZbesO2bE09i+9KQe5AA2ftb9HEs86/B44TbJ 545DZggIGV9LGGmjMZnrluM6F7QWJzuZr79AUD9CvcuJZPE/Hpc748oRxK1SVE9A+Mxa52 qduaag9rWVtInpGzrSDRn8golZ8r05RJ6t9Sv9B6A0KxyXVUfq7r81VKdhwjY+gNXAX/80 XpEq0PGb2WbElcypQIztO0MG31RUZ6PIN4R2aBfCLiynpIFbByEv+IBun7ndm3U10j7CWf reKYePaAIIL7QfQfDbixJGYKcBDQ2W37E+IEUyc+i33kBbZHXuD/eZ3ut0vM+w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720890742; 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=XRUEZ8qK8QlT3vYUiG7TtkSf54B7U42TOwQioXr1JFk=; b=P90SGRmQt3blXZl96G7qwbJbtjI4VbvMslZonD/R5S9KhECQyO2NQNZyEkXGivuY5tz3v8 fwhofCFJWMgBl18ovroSKVpWN52ZuPiHOts7wya0gqMsDhrczkfdMXV7rLYUtpKjAWRnoJ 2sMkVcgOaaMQ85ZcbiOE/O5/+KAYUyN4yF/x8olnye0UxoJ101y9NhtXwU61b5GY1j5FVv m02RyaJsU8rK1Mb7j7UtFcp6/ajiYh9Yj5kALkTj54qxS7WBMEZmJA/NuOJUu5DPiBeT9y f02FlNKVY2qLvY9jaioSw9Cey2wKGtcsY7qd1nryh/zyoJkLa2B96Lol8VsehA== 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 4WLw4k37CGzZsc; Sat, 13 Jul 2024 17:12:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46DHCMrF038799; Sat, 13 Jul 2024 17:12:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46DHCMLH038796; Sat, 13 Jul 2024 17:12:22 GMT (envelope-from git) Date: Sat, 13 Jul 2024 17:12:22 GMT Message-Id: <202407131712.46DHCMLH038796@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: 255008d84916 - main - www/py-django-graphiql-debug-toolbar: Fix runtime after f8392fba5cb4 List-Id: Commit messages for all branches of the ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-ports-all@freebsd.org Sender: owner-dev-commits-ports-all@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: 255008d84916dfcec497341eb0c2357bbcee5a91 Auto-Submitted: auto-generated The branch main has been updated by kai: URL: https://cgit.FreeBSD.org/ports/commit/?id=255008d84916dfcec497341eb0c2357bbcee5a91 commit 255008d84916dfcec497341eb0c2357bbcee5a91 Author: Kai Knoblich AuthorDate: 2024-07-13 17:07:56 +0000 Commit: Kai Knoblich CommitDate: 2024-07-13 17:11:36 +0000 www/py-django-graphiql-debug-toolbar: Fix runtime after f8392fba5cb4 * Add a workaround for py-django-debug-toolbar 4.4.6 or newer to prevent following error [1]: [...] File "/usr/local/lib/python3.11/site-packages/graphiql_debug_toolbar/middleware.py", line 7, in from debug_toolbar.middleware import _HTML_TYPES ImportError: cannot import name '_HTML_TYPES' from 'debug_toolbar.middleware' (/usr/local/lib/python3.11/site-packages/debug_toolbar/middleware.py) [...] * Switch to the PEP517 build framework while I'm here. * Bump PORTREVISION due package change. PR: 280254 [1] Reported by: Fredrik Eriksson [1] --- www/py-django-graphiql-debug-toolbar/Makefile | 8 ++++-- .../patch-graphiql__debug__toolbar_middleware.py | 29 ++++++++++++++++++++++ 2 files changed, 35 insertions(+), 2 deletions(-) diff --git a/www/py-django-graphiql-debug-toolbar/Makefile b/www/py-django-graphiql-debug-toolbar/Makefile index e1f505847178..33b04c194ca3 100644 --- a/www/py-django-graphiql-debug-toolbar/Makefile +++ b/www/py-django-graphiql-debug-toolbar/Makefile @@ -1,6 +1,6 @@ PORTNAME= django-graphiql-debug-toolbar DISTVERSION= 0.2.0 -PORTREVISION= 3 +PORTREVISION= 4 CATEGORIES= www python MASTER_SITES= PYPI PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} @@ -12,15 +12,19 @@ WWW= https://github.com/flavors/django-graphiql-debug-toolbar LICENSE= MIT LICENSE_FILE= ${WRKSRC}/LICENSE +BUILD_DEPENDS= ${PYTHON_PKGNAMEPREFIX}poetry-core>=1.0.0:devel/py-poetry-core@${PY_FLAVOR} RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}django42>=2.2:www/py-django42@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}graphene-django300>=2.0.0:devel/py-graphene-django300@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}django-debug-toolbar>=3.1:www/py-django-debug-toolbar@${PY_FLAVOR} USES= python -USE_PYTHON= autoplist distutils +USE_PYTHON= autoplist pep517 CONFLICTS_INSTALL= ${PYTHON_PKGNAMEPREFIX}*${PORTNAME} NO_ARCH= yes +post-patch: + @${FIND} ${WRKSRC} -name '*.orig' -delete + .include diff --git a/www/py-django-graphiql-debug-toolbar/files/patch-graphiql__debug__toolbar_middleware.py b/www/py-django-graphiql-debug-toolbar/files/patch-graphiql__debug__toolbar_middleware.py new file mode 100644 index 000000000000..8097b3f4e320 --- /dev/null +++ b/www/py-django-graphiql-debug-toolbar/files/patch-graphiql__debug__toolbar_middleware.py @@ -0,0 +1,29 @@ +Add compatibility for py-django-debug-toolbar >= 4.4.6 + +If py-graphiql-debug-toolbar is used with py-django-debug-toolbar 4.4.6 or +newer, the following error is emitted: + +[...] + File "/usr/local/lib/python3.11/site-packages/graphiql_debug_toolbar/middleware.py", line 7, in + from debug_toolbar.middleware import _HTML_TYPES + ImportError: cannot import name '_HTML_TYPES' from 'debug_toolbar.middleware' (/usr/local/lib/python3.11/site-packages/debug_toolbar/middleware.py) +[...] + +This is because py-django-debugtoolbar "_HTML_TYPES" has been moved from +"debug_toolbar.middleware" to "debug_toolbar.utils" in the 4.4.6 release. + +--- graphiql_debug_toolbar/middleware.py.orig 2021-08-28 21:44:07 UTC ++++ graphiql_debug_toolbar/middleware.py +@@ -4,7 +4,11 @@ from django.utils.encoding import force_str + from django.template.loader import render_to_string + from django.utils.encoding import force_str + +-from debug_toolbar.middleware import _HTML_TYPES ++try: ++ from debug_toolbar.middleware import _HTML_TYPES ++except ImportError: ++ from debug_toolbar.utils import _HTML_TYPES ++ + from debug_toolbar.middleware import DebugToolbarMiddleware as BaseMiddleware + from debug_toolbar.toolbar import DebugToolbar + from graphene_django.views import GraphQLView