git: c1f83d71134e - main - textproc/py-sphinx-autodoc-typehints: fix building in non isolated mode

From: Robert Clausecker <fuz_at_FreeBSD.org>
Date: Sat, 11 Mar 2023 08:39:26 UTC
The branch main has been updated by fuz:

URL: https://cgit.FreeBSD.org/ports/commit/?id=c1f83d71134e6cf4a5142c3cb917f25c265bbad3

commit c1f83d71134e6cf4a5142c3cb917f25c265bbad3
Author:     Andreas Bilke <andreas@bilke.org>
AuthorDate: 2023-03-09 00:07:21 +0000
Commit:     Robert Clausecker <fuz@FreeBSD.org>
CommitDate: 2023-03-11 08:38:57 +0000

    textproc/py-sphinx-autodoc-typehints: fix building in non isolated mode
    
    Since upsteam does not see any problem with the current behaviour we can
    only patch this issue on our side.
    
    Also remove some redundant build dependencies.
    
    PR:             269686
---
 textproc/py-sphinx-autodoc-typehints/Makefile          |  5 +----
 ...atch-src_sphinx__autodoc__typehints_____init____.py | 18 ++++++++++++++++++
 2 files changed, 19 insertions(+), 4 deletions(-)

diff --git a/textproc/py-sphinx-autodoc-typehints/Makefile b/textproc/py-sphinx-autodoc-typehints/Makefile
index 568c0c07207e..d5990144bfcb 100644
--- a/textproc/py-sphinx-autodoc-typehints/Makefile
+++ b/textproc/py-sphinx-autodoc-typehints/Makefile
@@ -1,4 +1,5 @@
 PORTNAME=	sphinx-autodoc-typehints
+PORTREVISION=	1
 DISTVERSION=	1.22
 CATEGORIES=	textproc python
 MASTER_SITES=	PYPI
@@ -15,10 +16,6 @@ LICENSE_FILE=	${WRKSRC}/LICENSE
 
 BUILD_DEPENDS=	${PYTHON_PKGNAMEPREFIX}hatchling>=0.21.1:devel/py-hatchling@${PY_FLAVOR} \
 		${PYTHON_PKGNAMEPREFIX}hatch-vcs>0:devel/py-hatch-vcs@${PY_FLAVOR} \
-		${PYTHON_PKGNAMEPREFIX}pip>=22.2:devel/py-pip@${PY_FLAVOR} \
-		${PYTHON_PKGNAMEPREFIX}setuptools>=40.0.4:devel/py-setuptools@${PY_FLAVOR} \
-		${PYTHON_PKGNAMEPREFIX}setuptools_scm>=2.0.0:devel/py-setuptools_scm@${PY_FLAVOR} \
-		${PYTHON_PKGNAMEPREFIX}wheel>=0.29.0:devel/py-wheel@${PY_FLAVOR} \
 		${PYTHON_PKGNAMEPREFIX}sphinx>=5.3:textproc/py-sphinx@${PY_FLAVOR}
 RUN_DEPENDS=	${PYTHON_PKGNAMEPREFIX}sphinx>=5.3:textproc/py-sphinx@${PY_FLAVOR}
 
diff --git a/textproc/py-sphinx-autodoc-typehints/files/patch-src_sphinx__autodoc__typehints_____init____.py b/textproc/py-sphinx-autodoc-typehints/files/patch-src_sphinx__autodoc__typehints_____init____.py
new file mode 100644
index 000000000000..d7a79eb23fd7
--- /dev/null
+++ b/textproc/py-sphinx-autodoc-typehints/files/patch-src_sphinx__autodoc__typehints_____init____.py
@@ -0,0 +1,18 @@
+--- src/sphinx_autodoc_typehints/__init__.py.orig	2023-03-03 19:01:28.608152000 +0100
++++ src/sphinx_autodoc_typehints/__init__.py	2023-03-03 19:03:03.209005000 +0100
+@@ -23,7 +23,14 @@
+ from sphinx.util.inspect import stringify_signature
+ 
+ from .patches import install_patches
+-from .version import __version__
++
++# see https://github.com/tox-dev/sphinx-autodoc-typehints/pull/328/files for the original patch
++try:
++    from .version import __version__
++except ImportError:
++    # The format of this file was changed, so lets fall back to the older style.
++    # See https://github.com/tox-dev/sphinx-autodoc-typehints/issues/327
++    from .version import version as __version__
+ 
+ _LOGGER = logging.getLogger(__name__)
+ _PYDATA_ANNOTATIONS = {"Any", "AnyStr", "Callable", "ClassVar", "Literal", "NoReturn", "Optional", "Tuple", "Union"}