]> git.pld-linux.org Git - packages/python-html5lib.git/blob - python-html5lib.spec
rebuild with python 3.10
[packages/python-html5lib.git] / python-html5lib.spec
1 #
2 # Conditional build:
3 %bcond_without  python2 # CPython 2.x module
4 %bcond_without  python3 # CPython 3.x module
5 %bcond_without  tests   # py.test tests
6 #
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}
11 Version:        1.1
12 Release:        2
13 License:        MIT
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/
21 %if %{with python2}
22 BuildRequires:  python-devel >= 1:2.7
23 BuildRequires:  python-setuptools >= 1:18.5
24 %if %{with tests}
25 BuildRequires:  python-flake8
26 BuildRequires:  python-mock >= 3.0.5
27 %if "%{py_ver}" < "2.7"
28 BuildRequires:  python-ordereddict
29 %endif
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
35 %endif
36 %endif
37 %if %{with python3}
38 BuildRequires:  python3-devel >= 1:3.3
39 BuildRequires:  python3-setuptools >= 1:18.5
40 %if %{with tests}
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
47 %endif
48 %endif
49 BuildRequires:  rpm-pythonprov
50 BuildRequires:  rpmbuild(macros) >= 1.714
51 Requires:       python-modules >= 1:2.7
52 BuildArch:      noarch
53 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
54
55 %description
56 HTML parser/tokenizer based on the WHATWG HTML5 specification.
57
58 %description -l pl.UTF-8
59 Analizator i tokenizer HTML-a oparty na specyfikacji WHATWG HTML5.
60
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
66
67 %description -n python3-%{module}
68 HTML parser/tokenizer based on the WHATWG HTML5 specification.
69
70 %description -n python3-%{module} -l pl.UTF-8
71 Analizator i tokenizer HTML-a oparty na specyfikacji WHATWG HTML5.
72
73 %prep
74 %setup -q -n %{module}-%{version}
75 %patch0 -p1
76 %patch1 -p1
77
78 %build
79 %if %{with python2}
80 %py_build
81
82 %if %{with tests}
83 PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
84 PYTEST_PLUGINS=pytest_expect.expect \
85 %{__python} -m pytest html5lib/tests
86 %endif
87 %endif
88
89 %if %{with python3}
90 %py3_build
91
92 %if %{with tests}
93 PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
94 PYTEST_PLUGINS=pytest_expect.expect \
95 %{__python3} -m pytest html5lib/tests
96 %endif
97 %endif
98
99 %install
100 rm -rf $RPM_BUILD_ROOT
101
102 %if %{with python2}
103 %py_install
104
105 %py_postclean
106 %endif
107
108 %if %{with python3}
109 %py3_install
110 %endif
111
112 %clean
113 rm -rf $RPM_BUILD_ROOT
114
115 %if %{with python2}
116 %files
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
121 %endif
122
123 %if %{with python3}
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
129 %endif
This page took 0.0544 seconds and 3 git commands to generate.