]> git.pld-linux.org Git - packages/python3-cssselect2.git/blob - python3-cssselect2.spec
fbeb3a17736ff49e139854e189b87db0fbde98e1
[packages/python3-cssselect2.git] / python3-cssselect2.spec
1 #
2 # Conditional build:
3 %bcond_without  doc     # Sphinx documentation
4 %bcond_without  tests   # unit tests
5
6 Summary:        CSS selectors for Python ElementTree
7 Summary(pl.UTF-8):      Selektory CSS dla pythonowego ElementTree
8 Name:           python3-cssselect2
9 Version:        0.4.1
10 Release:        1
11 License:        BSD
12 Group:          Libraries/Python
13 #Source0Download: https://pypi.org/simple/cssselect2/
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/
18 BuildRequires:  python3-modules >= 1:3.6
19 BuildRequires:  python3-setuptools >= 1:39.2.0
20 %if %{with tests}
21 BuildRequires:  python3-pytest
22 BuildRequires:  python3-pytest-cov
23 BuildRequires:  python3-tinycss2
24 BuildRequires:  python3-webencodings
25 %endif
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
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
39 ElementTree-like parsers, including cElementTree, lxml, html5lib,
40 etc.
41
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
59 %prep
60 %setup -n cssselect2-%{version}
61 %patch0 -p1
62
63 # for pythonegg dependencies
64 %{__sed} -i -e 's/distutils.core/setuptools/' setup.py
65
66 %build
67 %py3_build
68
69 %if %{with tests}
70 PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
71 %{__python3} -m pytest -v
72 %endif
73
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
85 %clean
86 rm -rf $RPM_BUILD_ROOT
87
88 %files
89 %defattr(644,root,root,755)
90 %doc LICENSE README.rst
91 %{py3_sitescriptdir}/cssselect2
92 %{py3_sitescriptdir}/cssselect2-%{version}-py*.egg-info
93
94 %if %{with doc}
95 %files apidocs
96 %defattr(644,root,root,755)
97 %doc docs/build/html/*
98 %endif
This page took 0.057653 seconds and 2 git commands to generate.