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