3 %bcond_without python2 # CPython 2.x module
4 %bcond_without python3 # CPython 3.x module
5 %bcond_without tests # py.test tests
7 %define module html5lib
8 Summary: HTML parser/tokenizer based on the WHATWG HTML5 specification
9 Summary(pl.UTF-8): Analizator i tokenizer HTML-a oparty na specyfikacji WHATWG HTML5
10 Name: python-%{module}
14 Group: Libraries/Python
15 #Source0Download: https://pypi.org/simple/html5lib/
16 Source0: https://files.pythonhosted.org/packages/source/h/html5lib/%{module}-%{version}.tar.gz
17 # Source0-md5: 6748742e2ec4cb99287a6bc82bcfe2b0
18 Patch0: %{name}-pytest6.patch
19 Patch1: %{name}-mock.patch
20 URL: https://github.com/html5lib/
22 BuildRequires: python-devel >= 1:2.7
23 BuildRequires: python-setuptools >= 1:18.5
25 BuildRequires: python-flake8
26 BuildRequires: python-mock >= 3.0.5
27 %if "%{py_ver}" < "2.7"
28 BuildRequires: python-ordereddict
30 BuildRequires: python-pytest >= 4.6.10
31 BuildRequires: python-pytest-expect >= 1.1
32 BuildRequires: python-pytest-expect < 2.0
33 BuildRequires: python-six >= 1.9
34 BuildRequires: python-webencodings
38 BuildRequires: python3-devel >= 1:3.3
39 BuildRequires: python3-setuptools >= 1:18.5
41 BuildRequires: python3-flake8
42 BuildRequires: python3-pytest >= 5.4.2
43 BuildRequires: python3-pytest-expect >= 1.1
44 BuildRequires: python3-pytest-expect < 2.0
45 BuildRequires: python3-six >= 1.9
46 BuildRequires: python3-webencodings
49 BuildRequires: rpm-pythonprov
50 BuildRequires: rpmbuild(macros) >= 1.714
51 Requires: python-modules >= 1:2.7
53 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
56 HTML parser/tokenizer based on the WHATWG HTML5 specification.
58 %description -l pl.UTF-8
59 Analizator i tokenizer HTML-a oparty na specyfikacji WHATWG HTML5.
61 %package -n python3-%{module}
62 Summary: HTML parser/tokenizer based on the WHATWG HTML5 specification
63 Summary(pl.UTF-8): Analizator i tokenizer HTML-a oparty na specyfikacji WHATWG HTML5
64 Group: Libraries/Python
65 Requires: python3-modules >= 1:3.3
67 %description -n python3-%{module}
68 HTML parser/tokenizer based on the WHATWG HTML5 specification.
70 %description -n python3-%{module} -l pl.UTF-8
71 Analizator i tokenizer HTML-a oparty na specyfikacji WHATWG HTML5.
74 %setup -q -n %{module}-%{version}
83 PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
84 PYTEST_PLUGINS=pytest_expect.expect \
85 %{__python} -m pytest html5lib/tests
93 PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
94 PYTEST_PLUGINS=pytest_expect.expect \
95 %{__python3} -m pytest html5lib/tests
100 rm -rf $RPM_BUILD_ROOT
113 rm -rf $RPM_BUILD_ROOT
117 %defattr(644,root,root,755)
118 %doc AUTHORS.rst CHANGES.rst LICENSE README.rst
119 %{py_sitescriptdir}/html5lib-%{version}-py*.egg-info
120 %{py_sitescriptdir}/html5lib
124 %files -n python3-%{module}
125 %defattr(644,root,root,755)
126 %doc AUTHORS.rst CHANGES.rst LICENSE README.rst
127 %{py3_sitescriptdir}/html5lib-%{version}-py*.egg-info
128 %{py3_sitescriptdir}/html5lib