From owner-dev-commits-ports-all@freebsd.org Tue Sep 21 23:45:56 2021 Return-Path: Delivered-To: dev-commits-ports-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E92B167F86C; Tue, 21 Sep 2021 23:45:56 +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 4HDdNN33jpz4qyG; Tue, 21 Sep 2021 23:45:56 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 49BCE5815; Tue, 21 Sep 2021 23:45:56 +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 18LNjuO6048444; Tue, 21 Sep 2021 23:45:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18LNjuO3048443; Tue, 21 Sep 2021 23:45:56 GMT (envelope-from git) Date: Tue, 21 Sep 2021 23:45:56 GMT Message-Id: <202109212345.18LNjuO3048443@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: "Danilo G. Baio" Subject: git: 7583c6f81dcf - main - textproc/py-sphinx: Add upstream patch to fix runtime error with Python 3.10 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dbaio X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7583c6f81dcf0b411f932f2384d64efbe83eaf9c Auto-Submitted: auto-generated X-BeenThere: dev-commits-ports-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the ports repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Sep 2021 23:45:57 -0000 The branch main has been updated by dbaio: URL: https://cgit.FreeBSD.org/ports/commit/?id=7583c6f81dcf0b411f932f2384d64efbe83eaf9c commit 7583c6f81dcf0b411f932f2384d64efbe83eaf9c Author: Yasuhiro Kimura AuthorDate: 2021-09-21 23:36:42 +0000 Commit: Danilo G. Baio CommitDate: 2021-09-21 23:40:15 +0000 textproc/py-sphinx: Add upstream patch to fix runtime error with Python 3.10 PR: 257770 Approved by: dbaio (python, maintainer) --- .../py-sphinx/files/patch-sphinx_util_typing.py | 58 ++++++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/textproc/py-sphinx/files/patch-sphinx_util_typing.py b/textproc/py-sphinx/files/patch-sphinx_util_typing.py new file mode 100644 index 000000000000..2b21fdd41d1a --- /dev/null +++ b/textproc/py-sphinx/files/patch-sphinx_util_typing.py @@ -0,0 +1,58 @@ +From 8b2031c747e7c7e6b845ee2e3db47de617d33cc6 Mon Sep 17 00:00:00 2001 +From: Takeshi KOMIYA +Date: Fri, 30 Jul 2021 01:27:38 +0900 +Subject: [PATCH] Fix #9512: sphinx-build: crashed with the HEAD of Python 3.10 + +Recently, `types.Union` was renamed to `types.UnionType` on the HEAD +of 3.10 (refs: python/cpython#27342). After this change, sphinx-build +has been crashed because of ImportError. +--- CHANGES.orig 2021-03-06 11:59:38 UTC ++++ CHANGES +@@ -419,6 +419,8 @@ Bugs fixed + * #6914: figure numbers are unexpectedly assigned to uncaptioned items + * #8320: make "inline" line numbers un-selectable + ++* #9512: sphinx-build: crashed with the HEAD of Python 3.10 ++ + Testing + -------- + + CHANGES | 2 ++ + sphinx/util/typing.py | 12 ++++++------ + 2 files changed, 8 insertions(+), 6 deletions(-) + +--- sphinx/util/typing.py.orig 2021-03-06 11:58:24 UTC ++++ sphinx/util/typing.py +@@ -30,10 +30,10 @@ else: + ref = _ForwardRef(self.arg) + return ref._eval_type(globalns, localns) + +-if sys.version_info > (3, 10): +- from types import Union as types_Union +-else: +- types_Union = None ++try: ++ from types import UnionType # type: ignore # python 3.10 or above ++except ImportError: ++ UnionType = None + + if False: + # For type annotation +@@ -107,7 +107,7 @@ def restify(cls: Optional["Type"]) -> str: + return ':class:`struct.Struct`' + elif inspect.isNewType(cls): + return ':class:`%s`' % cls.__name__ +- elif types_Union and isinstance(cls, types_Union): ++ elif UnionType and isinstance(cls, UnionType): + if len(cls.__args__) > 1 and None in cls.__args__: + args = ' | '.join(restify(a) for a in cls.__args__ if a) + return 'Optional[%s]' % args +@@ -349,7 +349,7 @@ def _stringify_py37(annotation: Any) -> str: + elif hasattr(annotation, '__origin__'): + # instantiated generic provided by a user + qualname = stringify(annotation.__origin__) +- elif types_Union and isinstance(annotation, types_Union): # types.Union (for py3.10+) ++ elif UnionType and isinstance(annotation, UnionType): # types.Union (for py3.10+) + qualname = 'types.Union' + else: + # we weren't able to extract the base type, appending arguments would