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