From: Antoine Jacoutot Subject: Re: [wip] py-backports-zstd 1.2.0 To: Theo Buehler , ports@openbsd.org, daniel@openbsd.org Date: Fri, 12 Dec 2025 13:11:53 +0100 On Fri, Dec 12, 2025 at 11:12:37AM +0000, Stuart Henderson wrote: > On 2025/12/12 11:30, Theo Buehler wrote: > > Attached a port for backports.zstd which is needed for py-flask-compress > > with Python 3.13. > > > > One thing of note is the tight setuptools>=80 requirement patched out. > > this is showing up a lot, I should probably try updating that > > > More importantly, this conflicts with textproc/hotdoc due to sharing the > > backports/__init__py file. I don't know how to handle this gracefully. > > hotdoc can stop doing that (ok with you Antoine?), but based on what > it says in https://pypi.org/project/backports/ we should probably not > install backports/__init_.py anyway. Sure, OK. Thanks. > Index: Makefile > =================================================================== > RCS file: /cvs/ports/textproc/hotdoc/Makefile,v > diff -u -p -r1.23 Makefile > --- Makefile 1 Nov 2025 11:16:43 -0000 1.23 > +++ Makefile 12 Dec 2025 11:12:06 -0000 > @@ -2,7 +2,7 @@ COMMENT= documentation tool micro-frame > > MODPY_DISTV= 0.17.4 > DISTNAME= hotdoc-${MODPY_DISTV} > -REVISION= 1 > +REVISION= 2 > > CATEGORIES= textproc > > @@ -19,6 +19,7 @@ MODULES= lang/python > > MODPY_PI= Yes > MODPY_PYBUILD= setuptools > +MODPY_TEST_LINK_SO= Yes > > BUILD_DEPENDS= devel/cmake/core > > @@ -37,14 +38,4 @@ RUN_DEPENDS= devel/py-appdirs \ > textproc/py-lxml \ > textproc/py-yaml > > -# XXX only include what we need from backports (unported) > -SITES.pybackports= https://files.pythonhosted.org/packages/fc/25/dae014b114397a6f60578d7358bf5fcb103f71556e5363a50d7b42e9bc51/ > -DISTFILES.pybackports= backports.entry_points_selectable-1.3.0.tar.gz > -post-install: > - ${INSTALL_DATA_DIR} ${WRKINST}/${MODPY_SITEPKG} > - cp -a ${WRKDIR}/backports.entry_points_selectable-1.3.0/backports/ \ > - ${WRKINST}/${MODPY_SITEPKG} > - ${MODPY_COMPILEALL} ${WRKINST}/${MODPY_SITEPKG}/backports/ > - > -# LGPLv2.1+ > .include > Index: distinfo > =================================================================== > RCS file: /cvs/ports/textproc/hotdoc/distinfo,v > diff -u -p -r1.13 distinfo > --- distinfo 31 Jan 2025 09:08:32 -0000 1.13 > +++ distinfo 12 Dec 2025 11:12:06 -0000 > @@ -1,4 +1,2 @@ > -SHA256 (backports.entry_points_selectable-1.3.0.tar.gz) = F6i0SucA+6VIaG3SdN3JHAYDcVZc1jgGwgodM5EXRuY= > SHA256 (hotdoc-0.17.4.tar.gz) = xNXf9kfwOqh6HS0GA10oGe3QmbkWNeOy7jkIKTV66fw= > -SIZE (backports.entry_points_selectable-1.3.0.tar.gz) = 9882 > SIZE (hotdoc-0.17.4.tar.gz) = 1957809 > Index: patches/patch-hotdoc_extensions_gi_utils_py > =================================================================== > RCS file: patches/patch-hotdoc_extensions_gi_utils_py > diff -N patches/patch-hotdoc_extensions_gi_utils_py > --- /dev/null 1 Jan 1970 00:00:00 -0000 > +++ patches/patch-hotdoc_extensions_gi_utils_py 12 Dec 2025 11:12:06 -0000 > @@ -0,0 +1,24 @@ > +From 51043c3ef889e36c8232280581598b875073ded7 Mon Sep 17 00:00:00 2001 > +From: Eli Schwartz > +Date: Mon, 28 Apr 2025 17:40:21 -0400 > +Subject: [PATCH] avoid third-party backports dependency on sufficiently new > + python > + > +Index: hotdoc/extensions/gi/utils.py > +--- hotdoc/extensions/gi/utils.py.orig > ++++ hotdoc/extensions/gi/utils.py > +@@ -1,9 +1,13 @@ > + import os > + from collections import namedtuple > + import pathlib > ++import sys > + import traceback > + > +-from backports.entry_points_selectable import entry_points > ++if sys.version_info >= (3, 10): > ++ from importlib.metadata import entry_points > ++else: > ++ from backports.entry_points_selectable import entry_points > + > + from hotdoc.core.links import Link > + from hotdoc.utils.loggable import info, debug > Index: patches/patch-hotdoc_utils_utils_py > =================================================================== > RCS file: patches/patch-hotdoc_utils_utils_py > diff -N patches/patch-hotdoc_utils_utils_py > --- /dev/null 1 Jan 1970 00:00:00 -0000 > +++ patches/patch-hotdoc_utils_utils_py 12 Dec 2025 11:12:06 -0000 > @@ -0,0 +1,22 @@ > +From 51043c3ef889e36c8232280581598b875073ded7 Mon Sep 17 00:00:00 2001 > +From: Eli Schwartz > +Date: Mon, 28 Apr 2025 17:40:21 -0400 > +Subject: [PATCH] avoid third-party backports dependency on sufficiently new > + python > + > +Index: hotdoc/utils/utils.py > +--- hotdoc/utils/utils.py.orig > ++++ hotdoc/utils/utils.py > +@@ -35,7 +35,11 @@ import importlib.util > + from urllib.request import urlretrieve > + from pathlib import Path > + > +-from backports.entry_points_selectable import entry_points > ++if sys.version_info >= (3, 10): > ++ from importlib.metadata import entry_points > ++else: > ++ from backports.entry_points_selectable import entry_points > ++ > + try: > + import importlib.metadata as meta > + except ImportError: > Index: patches/patch-setup_py > =================================================================== > RCS file: patches/patch-setup_py > diff -N patches/patch-setup_py > --- /dev/null 1 Jan 1970 00:00:00 -0000 > +++ patches/patch-setup_py 12 Dec 2025 11:12:06 -0000 > @@ -0,0 +1,18 @@ > +From 51043c3ef889e36c8232280581598b875073ded7 Mon Sep 17 00:00:00 2001 > +From: Eli Schwartz > +Date: Mon, 28 Apr 2025 17:40:21 -0400 > +Subject: [PATCH] avoid third-party backports dependency on sufficiently new > + python > + > +Index: setup.py > +--- setup.py.orig > ++++ setup.py > +@@ -300,7 +300,7 @@ INSTALL_REQUIRES = [ > + 'wheezy.template', > + 'toposort>=1.4', > + 'importlib_metadata; python_version<"3.10"', > +- 'backports.entry_points_selectable', > ++ 'backports.entry_points_selectable; python_version<"3.10"', > + ] > + > + # dbus-deviation requires sphinx, which requires python 3.5 > Index: pkg/PLIST > =================================================================== > RCS file: /cvs/ports/textproc/hotdoc/pkg/PLIST,v > diff -u -p -r1.9 PLIST > --- pkg/PLIST 23 Oct 2025 13:20:22 -0000 1.9 > +++ pkg/PLIST 12 Dec 2025 11:12:06 -0000 > @@ -1,13 +1,5 @@ > bin/hotdoc > bin/hotdoc_dep_printer > -lib/python${MODPY_VERSION}/site-packages/backports/ > -lib/python${MODPY_VERSION}/site-packages/backports/__init__.py > -lib/python${MODPY_VERSION}/site-packages/backports/${MODPY_PYCACHE}/ > -lib/python${MODPY_VERSION}/site-packages/backports/${MODPY_PYCACHE}__init__.${MODPY_PYC_MAGIC_TAG}${MODPY_PYOEXTENSION} > -lib/python${MODPY_VERSION}/site-packages/backports/${MODPY_PYCACHE}__init__.${MODPY_PYC_MAGIC_TAG}pyc > -lib/python${MODPY_VERSION}/site-packages/backports/${MODPY_PYCACHE}entry_points_selectable.${MODPY_PYC_MAGIC_TAG}${MODPY_PYOEXTENSION} > -lib/python${MODPY_VERSION}/site-packages/backports/${MODPY_PYCACHE}entry_points_selectable.${MODPY_PYC_MAGIC_TAG}pyc > -lib/python${MODPY_VERSION}/site-packages/backports/entry_points_selectable.py > lib/python${MODPY_VERSION}/site-packages/hotdoc/ > lib/python${MODPY_VERSION}/site-packages/hotdoc-${MODPY_DISTV}.dist-info/ > lib/python${MODPY_VERSION}/site-packages/hotdoc-${MODPY_DISTV}.dist-info/METADATA -- Antoine