diff --git a/textproc/py-mdformat/Makefile b/textproc/py-mdformat/Makefile index 989ab1be270d..b7c930b72f33 100644 --- a/textproc/py-mdformat/Makefile +++ b/textproc/py-mdformat/Makefile @@ -1,54 +1,54 @@ # XXX: see below (post-patch target) before updating PORTNAME= mdformat DISTVERSION= 0.7.22 -PORTREVISION= 2 +PORTREVISION= 3 CATEGORIES= textproc python PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} MAINTAINER= nivit@FreeBSD.org COMMENT= CommonMark compliant Markdown formatter WWW= https://github.com/hukkin/mdformat LICENSE= MIT LICENSE_FILE= ${WRKSRC}/LICENSE BUILD_DEPENDS= ${PYTHON_PKGNAMEPREFIX}setuptools>=61.0.0:devel/py-setuptools@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}wheel>=0.41.3:devel/py-wheel@${PY_FLAVOR} RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}importlib-metadata>=3.6.0:devel/py-importlib-metadata@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}markdown-it-py>=1<5:textproc/py-markdown-it-py@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}mdurl>=0.1.2:textproc/py-mdurl@${PY_FLAVOR} \ ${PY_TOMLI} \ ${PYTHON_PKGNAMEPREFIX}zipp>=0.5:devel/py-zipp@${PY_FLAVOR} TEST_DEPENDS= ${PYTHON_PKGNAMEPREFIX}covdefaults>=2.3.0_1:devel/py-covdefaults@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}pytest-cov>=4.1.0:devel/py-pytest-cov@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}pytest-randomly>=3.12.0:devel/py-pytest-randomly@${PY_FLAVOR} USES= python USE_GITHUB= yes GH_ACCOUNT= executablebooks USE_PYTHON= autoplist pep517 pytest NO_ARCH= yes OPTIONS_DEFINE= DOCS DOCS_BUILD_DEPENDS= ${PYTHON_PKGNAMEPREFIX}docutils>=0.18.1:textproc/py-docutils@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}furo>=2022.6.21:textproc/py-furo@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}myst-parser>=0.18.0:textproc/py-myst-parser@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}sphinx>=5.4.0:textproc/py-sphinx@${PY_FLAVOR} DOCS_PORTDOCS= * .buildinfo # tests: 4282 passed, 5 skipped (require Python 3.13+) TEST_ENV= PYTHONPATH=${STAGEDIR}${PYTHONPREFIX_SITELIBDIR} # XXX: remove this target as soon as devel/py-setuptools is updated to version >= 69 post-patch: @${REINPLACE_CMD} \ -e 's/\(setuptools>=\)69/\163/1' \ ${WRKSRC}/pyproject.toml post-install-DOCS-on: ${LOCALBASE}/bin/sphinx-build-${PYTHON_VER} \ -d ${WRKDIR} -b html -n ${WRKSRC}/docs ${STAGEDIR}${DOCSDIR} .include diff --git a/textproc/py-mdformat/files/patch-src_mdformat___conf.py b/textproc/py-mdformat/files/patch-src_mdformat___conf.py new file mode 100644 index 000000000000..772ec1c6678b --- /dev/null +++ b/textproc/py-mdformat/files/patch-src_mdformat___conf.py @@ -0,0 +1,22 @@ +--- src/mdformat/_conf.py.orig 2025-01-30 17:57:20 UTC ++++ src/mdformat/_conf.py +@@ -1,6 +1,6 @@ from __future__ import annotations + from __future__ import annotations + +-import functools ++import functools, os + from pathlib import Path + from types import MappingProxyType + from typing import Mapping +@@ -35,7 +35,10 @@ def read_toml_opts(conf_dir: Path) -> tuple[Mapping, P + @functools.lru_cache() + def read_toml_opts(conf_dir: Path) -> tuple[Mapping, Path | None]: + conf_path = conf_dir / ".mdformat.toml" +- if not conf_path.is_file(): ++ # conf_path.is_file() throws an exception when trying to access /net, ++ # a directory used only by autoconf with special attributes. ++ # https://github.com/hukkin/mdformat/issues/565#issuecomment-3697204512 ++ if not os.path.isfile(str(conf_path)): + parent_dir = conf_dir.parent + if conf_dir == parent_dir: + return {}, None