14
0
forked from pool/python-bleach

- Add patch pytest-requirement.patch to build with new pytest-runner

- Version update to 2.1.2:
  * Support new html5lib

- Convert to singlespec and enable tests/etc.

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-bleach?expand=0&rev=13
This commit is contained in:
Tomáš Chvátal
2017-12-13 14:27:19 +00:00
committed by Git OBS Bridge
parent 3689b3a762
commit 9862f6181f
5 changed files with 53 additions and 17 deletions

View File

@@ -16,37 +16,44 @@
#
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-bleach
Version: 2.1.1
Version: 2.1.2
Release: 0
Summary: An easy safelist-based HTML-sanitizing tool
License: Apache-2.0
Group: Development/Languages/Python
Url: https://github.com/mozilla/bleach
Source: https://pypi.python.org/packages/source/b/bleach/bleach-%{version}.tar.gz
BuildRequires: python-devel
BuildRequires: python-setuptools
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%if 0%{?suse_version} && 0%{?suse_version} <= 1110
%{!?python_sitelib: %global python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
%else
Source: https://files.pythonhosted.org/packages/source/b/bleach/bleach-%{version}.tar.gz
Patch0: pytest-requirement.patch
BuildRequires: %{python_module flake8 >= 3.3.0}
BuildRequires: %{python_module html5lib} >= 1.0.1
BuildRequires: %{python_module pytest >= 3.0.0}
BuildRequires: %{python_module pytest-runner}
BuildRequires: %{python_module setuptools}
BuildRequires: python-rpm-macros
Requires: python-html5lib >= 1.0.1
BuildArch: noarch
%endif
%python_subpackages
%description
Bleach is an allowed-list-based HTML sanitizing library that escapes or strips markup and attributes.
Bleach can also linkify text safely, applying filters that Djangos urlize filter cannot, and optionally setting rel attributes, even on links already in the text.
%prep
%setup -q -n bleach-%{version}
%autopatch -p1
%build
python setup.py build
%python_build
%install
python setup.py install --prefix=%{_prefix} --root=%{buildroot}
%python_install
%files
%defattr(-,root,root)
%check
%python_exec setup.py test
%files %{python_files}
%{python_sitelib}/*
%changelog