Igor Gnatenko 23f1fef
%global modname bleach
Igor Gnatenko 23f1fef
Igor Gnatenko 23f1fef
Name:           python-%{modname}
a88efce
Version:        3.1.4
a88efce
Release:        1%{?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
ef6b25b
%autosetup -n %{modname}-%{version} -p1
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.
c6eb016
sed -i "s/bleach._vendor.html5lib/html5lib/g" bleach/html5lib_shim.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
d09d44d
# skip tests until this is fixed:
d09d44d
# https://github.com/mozilla/bleach/issues/503
d09d44d
# %{__python3} setup.py test
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
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
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