14
0
forked from pool/python-bleach
Files
python-bleach/python-bleach.spec
Daniel Garcia a683d0f9c5 - Update to 6.0.0:
* bleach.clean, bleach.sanitizer.Cleaner,
    bleach.html5lib_shim.BleachHTMLParser: the tags and protocols
    arguments were changed from lists to sets.
  * bleach.linkify, bleach.linkifier.Linker: the skip_tags and
    recognized_tags arguments were changed from lists to sets.
  * 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.
  # Bug fixes
  * Add support for Python 3.11. (#675)
  * Fix API weirness in BleachSanitizerFilter. (#649)
  * 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. (#676)
  * Fix linkify handling of character entities. (#501)
  * 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.

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-bleach?expand=0&rev=51
2023-05-08 12:00:20 +00:00

75 lines
2.4 KiB
RPMSpec

#
# spec file for package python-bleach
#
# Copyright (c) 2023 SUSE LLC
# Copyright (c) 2015 LISA GmbH, Bingen, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%{?sle15_python_module_pythons}
Name: python-bleach
Version: 6.0.0
Release: 0
Summary: A whitelist-based HTML-sanitizing tool
License: Apache-2.0
URL: https://github.com/jsocol/bleach
Source: https://files.pythonhosted.org/packages/source/b/bleach/bleach-%{version}.tar.gz
Patch0: de-vendor.patch
BuildRequires: %{python_module html5lib >= 1.1}
BuildRequires: %{python_module pytest}
BuildRequires: %{python_module setuptools}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
Requires: python-html5lib >= 1.1
BuildArch: noarch
%python_subpackages
%description
Bleach is an HTML sanitation library that escapes or strips markup and
attributes based on a white list. Bleach can also linkify text safely, applying
filters that Django's ``urlize`` filter cannot, and optionally setting ``rel``
attributes, even on links already in the text.
Bleach is intended for sanitizing text from *untrusted* sources.
Because it relies on html5lib, Bleach is as good as modern browsers at dealing
with weird, quirky HTML fragments. Bleach's methods will fix
unbalanced or mis-nested tags.
Documentation is at http://bleach.readthedocs.org/ .
%prep
%autosetup -p1 -n bleach-%{version}
rm -rf bleach/_vendor
%build
%python_build
%install
%python_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%check
# gh#mozilla/bleach#503
# https://github.com/mozilla/bleach/issues/543
%pytest -k 'not (test_uri_value_allowed_protocols or test_bleach_html_parser or test_css_parsing_gauntlet_regex_backtracking)'
%files %{python_files}
%license LICENSE
%doc CHANGES README.rst
%{python_sitelib}/bleach
%{python_sitelib}/bleach-%{version}*-info
%changelog