From 898fe979548e26c4592fbb740e4a142d31b6928f Mon Sep 17 00:00:00 2001 From: adam Date: Fri, 5 May 2023 08:47:37 +0000 Subject: [PATCH] py-bleach: updated to 6.0.0 Version 6.0.0 (January 23rd, 2023) ---------------------------------- **Backwards incompatible changes** * ``bleach.clean``, ``bleach.sanitizer.Cleaner``, ``bleach.html5lib_shim.BleachHTMLParser``: the ``tags`` and ``protocols`` arguments were changed from lists to sets. Old pre-6.0.0: .. code-block:: python bleach.clean( "some text", tags=["a", "p", "img"], # ^ ^ list protocols=["http", "https"], # ^ ^ list ) New 6.0.0 and later: .. code-block:: python bleach.clean( "some text", tags={"a", "p", "img"}, # ^ ^ set protocols={"http", "https"}, # ^ ^ set ) * ``bleach.linkify``, ``bleach.linkifier.Linker``: the ``skip_tags`` and ``recognized_tags`` arguments were changed from lists to sets. Old pre-6.0.0: .. code-block:: python bleach.linkify( "some text", skip_tags=["pre"], # ^ ^ list ) linker = Linker( skip_tags=["pre"], # ^ ^ list recognized_tags=html5lib_shim.HTML_TAGS + ["custom-element"], # ^ ^ ^ list # | # | list concatenation ) New 6.0.0 and later: .. code-block:: python bleach.linkify( "some text", skip_tags={"pre"}, # ^ ^ set ) linker = Linker( skip_tags={"pre"}, # ^ ^ set recognized_tags=html5lib_shim.HTML_TAGS | {"custom-element"}, # ^ ^ ^ set # | # | union operator ) * ``bleach.sanitizer.BleachSanitizerFilter``: ``strip_allowed_elements`` is now ``strip_allowed_tags``. We now use "tags" everywhere rather than a mishmash of "tags" in some places and "elements" in others. **Security fixes** None **Bug fixes** * Add support for Python 3.11. * Fix API weirness in ``BleachSanitizerFilter``. We're using "tags" instead of "elements" everywhere--no more weird overloading of "elements" anymore. Also, it no longer calls the superclass constructor. * Add warning when ``css_sanitizer`` isn't set, but the ``style`` attribute is allowed. * Fix linkify handling of character entities. * Rework dev dependencies to use ``requirements-dev.txt`` and ``requirements-flake8.txt`` instead of extras. * Fix project infrastructure to be tox-based so it's easier to have CI run the same things we're running in development and with flake8 in an isolated environment. * Update action versions in CI. * Switch to f-strings where possible. Make tests parametrized to be easier to read/maintain. --- www/py-bleach/Makefile | 14 ++++++-------- www/py-bleach/PLIST | 19 ++++++++++++++----- www/py-bleach/distinfo | 8 ++++---- 3 files changed, 24 insertions(+), 17 deletions(-) diff --git a/www/py-bleach/Makefile b/www/py-bleach/Makefile index 01f6d0f76b67..6cfb8e06ac51 100644 --- a/www/py-bleach/Makefile +++ b/www/py-bleach/Makefile @@ -1,8 +1,7 @@ -# $NetBSD: Makefile,v 1.25 2023/04/30 18:45:35 wiz Exp $ +# $NetBSD: Makefile,v 1.26 2023/05/05 08:47:37 adam Exp $ -DISTNAME= bleach-3.3.1 +DISTNAME= bleach-6.0.0 PKGNAME= ${PYPKGPREFIX}-${DISTNAME} -PKGREVISION= 1 CATEGORIES= www python MASTER_SITES= ${MASTER_SITE_PYPI:=b/bleach/} @@ -12,17 +11,16 @@ COMMENT= Easy whitelist-based HTML-sanitizing tool LICENSE= apache-2.0 DEPENDS+= ${PYPKGPREFIX}-six>=1.9.0:../../lang/py-six -DEPENDS+= ${PYPKGPREFIX}-packaging-[0-9]*:../../devel/py-packaging DEPENDS+= ${PYPKGPREFIX}-webencodings-[0-9]*:../../textproc/py-webencodings TEST_DEPENDS+= ${PYPKGPREFIX}-test-runner>=2.0:../../devel/py-test-runner -PYTHON_VERSIONS_INCOMPATIBLE= 27 - USE_LANGUAGES= # none -REPLACE_SH+= bleach/_vendor/pip_install_vendor.sh - PYSETUPTESTTARGET= pytest +PYTHON_VERSIONS_INCOMPATIBLE= 27 + +REPLACE_SH+= bleach/_vendor/pip_install_vendor.sh + .include "../../lang/python/egg.mk" .include "../../mk/bsd.pkg.mk" diff --git a/www/py-bleach/PLIST b/www/py-bleach/PLIST index ad7aa757539c..03acce46f0cd 100644 --- a/www/py-bleach/PLIST +++ b/www/py-bleach/PLIST @@ -1,4 +1,4 @@ -@comment $NetBSD: PLIST,v 1.8 2020/11/02 14:45:57 adam Exp $ +@comment $NetBSD: PLIST,v 1.9 2023/05/05 08:47:37 adam Exp $ ${PYSITELIB}/${EGG_INFODIR}/PKG-INFO ${PYSITELIB}/${EGG_INFODIR}/SOURCES.txt ${PYSITELIB}/${EGG_INFODIR}/dependency_links.txt @@ -14,8 +14,10 @@ ${PYSITELIB}/bleach/_vendor/__init__.pyc ${PYSITELIB}/bleach/_vendor/__init__.pyo ${PYSITELIB}/bleach/_vendor/html5lib-1.1.dist-info/AUTHORS.rst ${PYSITELIB}/bleach/_vendor/html5lib-1.1.dist-info/INSTALLER +${PYSITELIB}/bleach/_vendor/html5lib-1.1.dist-info/LICENSE ${PYSITELIB}/bleach/_vendor/html5lib-1.1.dist-info/METADATA ${PYSITELIB}/bleach/_vendor/html5lib-1.1.dist-info/RECORD +${PYSITELIB}/bleach/_vendor/html5lib-1.1.dist-info/REQUESTED ${PYSITELIB}/bleach/_vendor/html5lib-1.1.dist-info/WHEEL ${PYSITELIB}/bleach/_vendor/html5lib-1.1.dist-info/top_level.txt ${PYSITELIB}/bleach/_vendor/html5lib/__init__.py @@ -117,20 +119,27 @@ ${PYSITELIB}/bleach/_vendor/html5lib/treewalkers/etree_lxml.pyo ${PYSITELIB}/bleach/_vendor/html5lib/treewalkers/genshi.py ${PYSITELIB}/bleach/_vendor/html5lib/treewalkers/genshi.pyc ${PYSITELIB}/bleach/_vendor/html5lib/treewalkers/genshi.pyo -${PYSITELIB}/bleach/_vendor/pip_install_vendor.sh +${PYSITELIB}/bleach/_vendor/parse.py +${PYSITELIB}/bleach/_vendor/parse.py.SHA256SUM +${PYSITELIB}/bleach/_vendor/parse.pyc +${PYSITELIB}/bleach/_vendor/parse.pyo ${PYSITELIB}/bleach/_vendor/vendor.txt +${PYSITELIB}/bleach/_vendor/vendor_install.sh ${PYSITELIB}/bleach/callbacks.py ${PYSITELIB}/bleach/callbacks.pyc ${PYSITELIB}/bleach/callbacks.pyo +${PYSITELIB}/bleach/css_sanitizer.py +${PYSITELIB}/bleach/css_sanitizer.pyc +${PYSITELIB}/bleach/css_sanitizer.pyo ${PYSITELIB}/bleach/html5lib_shim.py ${PYSITELIB}/bleach/html5lib_shim.pyc ${PYSITELIB}/bleach/html5lib_shim.pyo ${PYSITELIB}/bleach/linkifier.py ${PYSITELIB}/bleach/linkifier.pyc ${PYSITELIB}/bleach/linkifier.pyo +${PYSITELIB}/bleach/parse_shim.py +${PYSITELIB}/bleach/parse_shim.pyc +${PYSITELIB}/bleach/parse_shim.pyo ${PYSITELIB}/bleach/sanitizer.py ${PYSITELIB}/bleach/sanitizer.pyc ${PYSITELIB}/bleach/sanitizer.pyo -${PYSITELIB}/bleach/utils.py -${PYSITELIB}/bleach/utils.pyc -${PYSITELIB}/bleach/utils.pyo diff --git a/www/py-bleach/distinfo b/www/py-bleach/distinfo index fa4131d818b9..c19d5c226cc2 100644 --- a/www/py-bleach/distinfo +++ b/www/py-bleach/distinfo @@ -1,5 +1,5 @@ -$NetBSD: distinfo,v 1.20 2021/10/26 11:30:28 nia Exp $ +$NetBSD: distinfo,v 1.21 2023/05/05 08:47:37 adam Exp $ -BLAKE2s (bleach-3.3.1.tar.gz) = dbda35325c66359160e436c25fc1afa382966f8d818d2e2f3de7befc7e9973b8 -SHA512 (bleach-3.3.1.tar.gz) = bb68275f91a4c724c14594d008f58d31ab0a97b08fd45b6cbe8237a31a1bbfd24a19cea1a835efffb979739ce17a3c065099e677019e498e78d9a4222ff2d66c -Size (bleach-3.3.1.tar.gz) = 183687 bytes +BLAKE2s (bleach-6.0.0.tar.gz) = 432e39ccc0e24eddc845c03c9734074685ee0de23a06cba1e827b27b532b8d21 +SHA512 (bleach-6.0.0.tar.gz) = 95900e4347c1f7d0aa5b2e8fbf43fac6410dd6bbbac988fb3f407a964d0aa1dc51fe3cf17459e6ce762a02b45bb3d20b539ca05727278d120aee9500cf0d208a +Size (bleach-6.0.0.tar.gz) = 201298 bytes