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,29 +1,26 @@ PORTNAME= sphinx-autodoc-typehints +PORTREVISION= 1 DISTVERSION= 1.22 CATEGORIES= textproc python MASTER_SITES= PYPI PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} DISTNAME= sphinx_autodoc_typehints-${DISTVERSION} MAINTAINER= andreas@bilke.org COMMENT= Type hints (PEP 484) support for the Sphinx autodoc extension WWW= https://github.com/tox-dev/sphinx-autodoc-typehints LICENSE= MIT 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} USES= python:3.7+ USE_PYTHON= autoplist concurrent pep517 NO_ARCH= yes .include 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"}