]>
Commit | Line | Data |
---|---|---|
bed17b88 JR |
1 | # |
2 | # Conditional build: | |
45fbf0a1 | 3 | %bcond_without doc # Sphinx documentation |
bed17b88 JR |
4 | %bcond_without tests # unit tests |
5 | ||
6 | Summary: CSS selectors for Python ElementTree | |
45fbf0a1 | 7 | Summary(pl.UTF-8): Selektory CSS dla pythonowego ElementTree |
bed17b88 JR |
8 | Name: python3-cssselect2 |
9 | Version: 0.4.1 | |
e4a76ceb | 10 | Release: 4 |
bed17b88 | 11 | License: BSD |
45fbf0a1 JB |
12 | Group: Libraries/Python |
13 | #Source0Download: https://pypi.org/simple/cssselect2/ | |
bed17b88 JR |
14 | Source0: https://files.pythonhosted.org/packages/source/c/cssselect2/cssselect2-%{version}.tar.gz |
15 | # Source0-md5: 6dfd5963c8a5d85f2634d1650b1ddfe1 | |
16 | Patch0: disable-flake8-isort-pytest.patch | |
c73e6cd5 | 17 | Patch1: no-cov.patch |
bed17b88 | 18 | URL: https://cssselect2.readthedocs.io/ |
45fbf0a1 JB |
19 | BuildRequires: python3-modules >= 1:3.6 |
20 | BuildRequires: python3-setuptools >= 1:39.2.0 | |
bed17b88 JR |
21 | %if %{with tests} |
22 | BuildRequires: python3-pytest | |
23 | BuildRequires: python3-pytest-cov | |
bed17b88 JR |
24 | BuildRequires: python3-tinycss2 |
25 | BuildRequires: python3-webencodings | |
26 | %endif | |
45fbf0a1 JB |
27 | %if %{with doc} |
28 | BuildRequires: python3-Sphinx | |
29 | BuildRequires: python3-sphinx_rtd_theme | |
30 | %endif | |
31 | BuildRequires: rpm-pythonprov | |
32 | BuildRequires: rpmbuild(macros) >= 1.714 | |
33 | BuildRequires: sed >= 4.0 | |
bed17b88 JR |
34 | BuildArch: noarch |
35 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
36 | ||
37 | %description | |
38 | cssselect2 is a straightforward implementation of CSS3 Selectors for | |
39 | markup documents (HTML, XML, etc.) that can be read by | |
45fbf0a1 | 40 | ElementTree-like parsers, including cElementTree, lxml, html5lib, |
bed17b88 JR |
41 | etc. |
42 | ||
45fbf0a1 JB |
43 | %description -l pl.UTF-8 |
44 | cssselect2 to bezpośrednia implementacja selektorów CSS3 dla | |
45 | dokumentów ze znacznikami (HTML, XML itp.), które można czytać | |
46 | parserami w stylu ElementTree, w tym cElementTree, lxml, html5lib | |
47 | itp. | |
48 | ||
49 | %package apidocs | |
50 | Summary: API documentation for Python cssselect2 module | |
51 | Summary(pl.UTF-8): Dokumentacja API modułu Pythona cssselect2 | |
52 | Group: Documentation | |
53 | ||
54 | %description apidocs | |
55 | API documentation for Python cssselect2 module. | |
56 | ||
57 | %description apidocs -l pl.UTF-8 | |
58 | Dokumentacja API modułu Pythona cssselect2. | |
59 | ||
bed17b88 JR |
60 | %prep |
61 | %setup -n cssselect2-%{version} | |
62 | %patch0 -p1 | |
c73e6cd5 | 63 | %patch1 -p1 |
bed17b88 | 64 | |
45fbf0a1 JB |
65 | # for pythonegg dependencies |
66 | %{__sed} -i -e 's/distutils.core/setuptools/' setup.py | |
67 | ||
bed17b88 JR |
68 | %build |
69 | %py3_build | |
70 | ||
bed17b88 | 71 | %if %{with tests} |
45fbf0a1 | 72 | PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \ |
bed17b88 JR |
73 | %{__python3} -m pytest -v |
74 | %endif | |
75 | ||
45fbf0a1 JB |
76 | %if %{with doc} |
77 | cd docs | |
78 | PYTHONPATH=$(pwd)/.. \ | |
79 | %{__python3} -m sphinx -W . build/html | |
80 | %endif | |
81 | ||
82 | %install | |
83 | rm -rf $RPM_BUILD_ROOT | |
84 | ||
85 | %py3_install | |
86 | ||
bed17b88 JR |
87 | %clean |
88 | rm -rf $RPM_BUILD_ROOT | |
89 | ||
90 | %files | |
91 | %defattr(644,root,root,755) | |
45fbf0a1 | 92 | %doc LICENSE README.rst |
bed17b88 JR |
93 | %{py3_sitescriptdir}/cssselect2 |
94 | %{py3_sitescriptdir}/cssselect2-%{version}-py*.egg-info | |
45fbf0a1 JB |
95 | |
96 | %if %{with doc} | |
97 | %files apidocs | |
98 | %defattr(644,root,root,755) | |
99 | %doc docs/build/html/* | |
100 | %endif |