]>
Commit | Line | Data |
---|---|---|
0745c189 JR |
1 | # |
2 | # Conditional build: | |
3c78f8a4 | 3 | %bcond_without doc # Sphinx documentation |
0745c189 JR |
4 | %bcond_without tests # unit tests |
5 | ||
6 | Summary: Low-level CSS parser for Python | |
3c78f8a4 | 7 | Summary(pl.UTF-8): Niskopoziomowy parser CSS dla Pythona |
0745c189 JR |
8 | Name: python3-tinycss2 |
9 | Version: 1.1.0 | |
40fc765a | 10 | Release: 4 |
0745c189 | 11 | License: BSD |
3c78f8a4 JB |
12 | Group: Libraries/Python |
13 | #Source0Download: https://pypi.org/simple/tinycss2/ | |
0745c189 JR |
14 | Source0: https://files.pythonhosted.org/packages/source/t/tinycss2/tinycss2-%{version}.tar.gz |
15 | # Source0-md5: 7caf513c4e87fc2449dcfbf407a8416f | |
16 | Patch0: disable-flake8-isort-for-pytest.patch | |
17 | Patch1: disable-missing-data-tests.patch | |
1b34edba | 18 | Patch2: no-cov.patch |
3c78f8a4 JB |
19 | URL: https://pypi.org/project/tinycss2/ |
20 | BuildRequires: python3-modules >= 1:3.6 | |
21 | BuildRequires: python3-setuptools | |
0745c189 JR |
22 | %if %{with tests} |
23 | BuildRequires: python3-pytest | |
24 | BuildRequires: python3-pytest-cov | |
0745c189 JR |
25 | BuildRequires: python3-webencodings >= 0.4 |
26 | %endif | |
3c78f8a4 | 27 | %if %{with doc} |
8e9235e3 | 28 | BuildRequires: python3-Sphinx |
3c78f8a4 | 29 | BuildRequires: python3-sphinx_rtd_theme |
3c78f8a4 JB |
30 | %endif |
31 | BuildRequires: rpm-pythonprov | |
32 | BuildRequires: rpmbuild(macros) >= 1.714 | |
33 | BuildRequires: sed >= 4.0 | |
0745c189 | 34 | BuildArch: noarch |
3c78f8a4 | 35 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
0745c189 JR |
36 | |
37 | %description | |
38 | tinycss2 is a modern, low-level CSS parser for Python. tinycss2 is a | |
39 | rewrite of tinycss with a simpler API, based on the more recent CSS | |
40 | Syntax Level 3 specification. | |
41 | ||
3c78f8a4 JB |
42 | %description -l pl.UTF-8 |
43 | tinycss2 to nowoczesny, niskopoziomowy parser CSS dla Ptyhona. Jest to | |
44 | napisany od początku tinycss z prostszym API, oparty na nowszej | |
45 | specyfikacji CSS Syntax Level 3. | |
46 | ||
47 | %package apidocs | |
48 | Summary: API documentation for Python tinycss2 module | |
49 | Summary(pl.UTF-8): Dokumentacja API modułu Pythona tinycss2 | |
50 | Group: Documentation | |
51 | ||
52 | %description apidocs | |
53 | API documentation for Python tinycss2 module. | |
54 | ||
55 | %description apidocs -l pl.UTF-8 | |
56 | Dokumentacja API modułu Pythona tinycss2. | |
57 | ||
0745c189 JR |
58 | %prep |
59 | %setup -n tinycss2-%{version} | |
60 | %patch0 -p1 | |
61 | %patch1 -p1 | |
1b34edba | 62 | %patch2 -p1 |
0745c189 | 63 | |
3c78f8a4 JB |
64 | # for pythonegg dependencies |
65 | %{__sed} -i -e 's/distutils.core/setuptools/' setup.py | |
66 | ||
0745c189 JR |
67 | %build |
68 | %py3_build | |
69 | ||
0745c189 | 70 | %if %{with tests} |
3c78f8a4 | 71 | PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \ |
0745c189 JR |
72 | %{__python3} -m pytest -v |
73 | %endif | |
74 | ||
3c78f8a4 JB |
75 | %if %{with doc} |
76 | cd docs | |
77 | PYTHONPATH=$(pwd)/.. \ | |
78 | %{__python3} -m sphinx -W . build/html | |
79 | %endif | |
80 | ||
81 | %install | |
82 | rm -rf $RPM_BUILD_ROOT | |
83 | ||
84 | %py3_install | |
85 | ||
0745c189 JR |
86 | %clean |
87 | rm -rf $RPM_BUILD_ROOT | |
88 | ||
89 | %files | |
90 | %defattr(644,root,root,755) | |
3c78f8a4 | 91 | %doc LICENSE README.rst |
0745c189 JR |
92 | %{py3_sitescriptdir}/tinycss2 |
93 | %{py3_sitescriptdir}/tinycss2-%{version}-py*.egg-info | |
3c78f8a4 JB |
94 | |
95 | %if %{with doc} | |
96 | %files apidocs | |
97 | %defattr(644,root,root,755) | |
98 | %doc docs/build/html/{_static,*.html,*.js} | |
99 | %endif |