Igor Gnatenko 23f1fef
%global modname bleach
Igor Gnatenko 23f1fef
Igor Gnatenko 23f1fef
Name:           python-%{modname}
17debe9
Version:        4.0.0
e8faa19
Release:        2%{?dist}
2324349
Summary:        An easy whitelist-based HTML-sanitizing tool
2324349
2324349
License:        ASL 2.0
c70c013
URL:            https://github.com/mozilla/bleach
4c064ad
Source0:        https://files.pythonhosted.org/packages/source/b/%{modname}/%{modname}-%{version}.tar.gz
Igor Gnatenko 23f1fef
2324349
BuildArch:      noarch
2324349
Igor Gnatenko 23f1fef
%global _description \
Igor Gnatenko 23f1fef
Bleach is an HTML sanitizing library that escapes or strips markup and\
Igor Gnatenko 23f1fef
attributes based on a white list.
2324349
Igor Gnatenko 23f1fef
%description %{_description}
2324349
Igor Gnatenko 23f1fef
%package -n python3-%{modname}
Igor Gnatenko 23f1fef
Summary:        An easy whitelist-based HTML-sanitizing tool
Igor Gnatenko 23f1fef
%{?python_provide:%python_provide python3-%{modname}}
2324349
BuildRequires:  python3-devel
Igor Gnatenko 23f1fef
BuildRequires:  python3-setuptools
ef6b25b
BuildRequires:  python3-pytest
ef6b25b
BuildRequires:  python3-pytest-runner
2324349
BuildRequires:  python3-six
Igor Gnatenko 23f1fef
BuildRequires:  python3-html5lib
2324349
Requires:       python3-six
Igor Gnatenko 23f1fef
Requires:       python3-html5lib
2324349
Igor Gnatenko 23f1fef
%description -n python3-%{modname} %{_description}
2324349
Igor Gnatenko 23f1fef
Python 3 version.
2324349
2324349
%prep
d289f89
%autosetup -n %{modname}-%{version} -p1 -S gendiff
2324349
2835693
sed -i 's/pytest-runner>=2.0,<3dev/pytest-runner/' setup.py
2835693
c6eb016
# Remove vendored libraries which were added for https://github.com/mozilla/bleach/issues/386
c6eb016
rm -r bleach/_vendor/
c6eb016
# Bleach has a shim layer that references the vendored html5lib we just deleted. Let's patch up the
c6eb016
# imports to use the real html5lib.
17debe9
sed -i "s/bleach._vendor.html5lib/html5lib/g" bleach/html5lib_shim.py tests/test_clean.py bleach/sanitizer.py
c6eb016
c6eb016
2324349
%build
Igor Gnatenko 23f1fef
%py3_build
2324349
2324349
%install
Igor Gnatenko 23f1fef
%py3_install
2324349
2324349
%check
c6eb016
! find %{buildroot}%{python3_sitelib}/bleach/ -type d | grep vendor
c6eb016
c6eb016
if [ $? -ne 0 ]; then
c6eb016
    echo "Detected vendored libraries; please remove them."
c6eb016
    /usr/bin/false
c6eb016
fi;
c6eb016
0b40908
# https://bugs.python.org/issue27657
cec8407
# https://github.com/mozilla/bleach/issues/536
cec8407
# currently: ========== 190 failed, 142 passed, 23 deselected, 6 xfailed in 8.86s ===========
17debe9
%{__python3} -m pytest -k 'not test_uri_value_allowed_protocols and not test_css_parsing_gauntlet_regex_backtracking'
2324349
Igor Gnatenko 23f1fef
%files -n python3-%{modname}
2324349
%license LICENSE
Igor Gnatenko 23f1fef
%doc README.rst
Igor Gnatenko 23f1fef
%{python3_sitelib}/%{modname}-*.egg-info/
Igor Gnatenko 23f1fef
%{python3_sitelib}/%{modname}/
2324349
2324349
%changelog
e8faa19
* Fri Jan 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 4.0.0-2
e8faa19
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
e8faa19
17debe9
* Mon Aug 09 2021 Matthias Runge <mrunge@redhat.com> - 4.0.0-1
17debe9
- update to 4.0.0 (rhbz#1923781)
17debe9
735690b
* Fri Jul 23 2021 Fedora Release Engineering <releng@fedoraproject.org> - 3.2.3-3
735690b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
735690b
b69b6a5
* Thu Jun 03 2021 Python Maint <python-maint@redhat.com> - 3.2.3-2
b69b6a5
- Rebuilt for Python 3.10
b69b6a5
cec8407
* Wed Jan 27 2021 Matthias Runge <mrunge@redhat.com> - 3.2.3-1
cec8407
- rebase to 3.2.3 (rhbz#1918556)
cec8407
eea58fd
* Mon Oct 05 2020 Matthias Runge <mrunge@redhat.com> - 3.2.1-1
eea58fd
- update to 3.2.1 (rhbz#1829635)
eea58fd
- fix ftbfs (1863709)
eea58fd
- fix CVE-2020-6816 (rhbz#1827493)
eea58fd
e9e40bb
* Sat Aug 01 2020 Fedora Release Engineering <releng@fedoraproject.org> - 3.1.4-5
e9e40bb
- Second attempt - Rebuilt for
e9e40bb
  https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
e9e40bb
e0ba329
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 3.1.4-4
e0ba329
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
e0ba329
f7eb91c
* Sat May 23 2020 Miro Hrončok <mhroncok@redhat.com> - 3.1.4-3
f7eb91c
- Rebuilt for Python 3.9
f7eb91c
7fe8964
* Wed Apr 22 2020 Nils Philippsen <nils@redhat.com> - 3.1.4-2
7fe8964
- skip failing tests regardless of Python version
7fe8964
a88efce
* Wed Apr 22 2020 Nils Philippsen <nils@redhat.com> - 3.1.4-1
a88efce
- version 3.1.4
4c064ad
- use pythonhosted.org source URL as the tarballs match published hashes
7fe8964
- only skip failing tests and only on Python 3.9
d289f89
- cope with html5lib prerelease on EL8
a88efce
06dc083
* Wed Feb 19 2020 Matthias Runge <mrunge@redhat.com> - 3.1.0-5
d09d44d
- skip tests for python 3.9 
a88efce
21a3027
* Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 3.1.0-5
21a3027
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
21a3027
be6bfe6
* Tue Sep 03 2019 Randy Barlow <bowlofeggs@fedoraproject.org> - 3.1.0-4
be6bfe6
- Drop python2-bleach (#1746757).
be6bfe6
7819d22
* Fri Aug 16 2019 Miro Hrončok <mhroncok@redhat.com> - 3.1.0-3
7819d22
- Rebuilt for Python 3.8
7819d22
487954c
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 3.1.0-2
487954c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
487954c
7319ee1
* Wed Mar 06 2019 Randy Barlow <bowlofeggs@fedoraproject.org> - 3.1.0-1
7319ee1
- Update to 3.1.0.
7319ee1
- https://github.com/mozilla/bleach/blob/v3.1.0/CHANGES
7319ee1
17656d5
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 3.0.2-2
17656d5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
17656d5
c6eb016
* Fri Dec 14 2018 Randy Barlow <bowlofeggs@fedoraproject.org> - 3.0.2-1
c6eb016
- Update to 3.0.2 (#1641626).
c6eb016
- https://github.com/mozilla/bleach/blob/v3.0.2/CHANGES
c6eb016
87a5b54
* Wed Dec 05 2018 Randy Barlow <bowlofeggs@fedoraproject.org> - 2.1.4-1
87a5b54
- Update to 2.1.4.
87a5b54
- https://github.com/mozilla/bleach/blob/v2.1.4/CHANGES
87a5b54
67c0195
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.1.3-3
67c0195
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
67c0195
f322e39
* Sun Jun 17 2018 Miro Hrončok <mhroncok@redhat.com> - 2.1.3-2
f322e39
- Rebuilt for Python 3.7
f322e39
f98a222
* Tue Mar 06 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 2.1.3-1
f98a222
- Update to 2.1.3
f98a222
417f3c2
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.1.2-2
417f3c2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild