]> git.pld-linux.org Git - packages/python-fields.git/blame - python-fields.spec
rebuild with tests and docs
[packages/python-fields.git] / python-fields.spec
CommitLineData
f02af86f
JB
1#
2# Conditional build:
3%bcond_without doc # Sphinx documentation
4%bcond_without tests # unit tests
5%bcond_without python2 # CPython 2.x module
6%bcond_without python3 # CPython 3.x module
7
8Summary: Container class boilerplate killer
9Summary(pl.UTF-8): Zabójca ramowego kodu klas kontenerów
10Name: python-fields
11Version: 5.0.0
14315fb4 12Release: 7
f02af86f
JB
13License: BSD
14Group: Libraries/Python
15#Source0Download: https://pypi.org/simple/fields/
16Source0: https://files.pythonhosted.org/packages/source/f/fields/fields-%{version}.tar.gz
17# Source0-md5: 4b3a60ddaad146f698979cf4da2639d4
18Patch0: %{name}-docs.patch
19Patch1: %{name}-tests.patch
20URL: https://github.com/ionelmc/python-fields
21BuildRequires: rpm-pythonprov
22BuildRequires: rpmbuild(macros) >= 1.714
23%if %{with python2}
24BuildRequires: python-modules >= 1:2.6
25BuildRequires: python-setuptools
26%if %{with tests}
150e957b 27BuildRequires: python-characteristic
f02af86f
JB
28BuildRequires: python-pytest
29BuildRequires: python-pytest-benchmark
30%endif
31%endif
32%if %{with python3}
33BuildRequires: python3-modules >= 1:3.3
34BuildRequires: python3-setuptools
35%if %{with tests}
150e957b 36BuildRequires: python3-characteristic
f02af86f
JB
37BuildRequires: python3-pytest
38BuildRequires: python3-pytest-benchmark
39%endif
40%endif
41%if %{with doc}
42BuildRequires: python3-sphinx_py3doc_enhanced_theme
43# with sphinx.ext.napoleon
44BuildRequires: sphinx-pdg-3 >= 1.3
45%endif
46Requires: python-modules >= 1:2.6
47BuildArch: noarch
48BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
49
50%description
51Container class boilerplate killer. Features:
52- Human-readable __repr__
53- Complete set of comparison methods
54- Keyword and positional argument support. Works like a normal class -
55 you can override just about anything in the subclass (eg: a custom
56 __init__).
57
58%description -l pl.UTF-8
59Zabójca ramowego kodu klas kontenerów. Możliwości:
60- __repr__ czytelne dla człowieka
61- pełny zbiór metod porównujących
62- obsługa argumentów pozycyjnych i słownikowych; działa jak zwykła
63 klasa - można przeciążać prawie wszystko w podklasie (np. własny
64 __init__).
65
66%package -n python3-fields
67Summary: Container class boilerplate killer
68Summary(pl.UTF-8): Zabójca ramowego kodu klas kontenerów
69Group: Libraries/Python
70Requires: python3-modules >= 1:3.3
71
72%description -n python3-fields
73Container class boilerplate killer. Features:
74- Human-readable __repr__
75- Complete set of comparison methods
76- Keyword and positional argument support. Works like a normal class -
77 you can override just about anything in the subclass (eg: a custom
78 __init__).
79
80%description -n python3-fields -l pl.UTF-8
81Zabójca ramowego kodu klas kontenerów. Możliwości:
82- __repr__ czytelne dla człowieka
83- pełny zbiór metod porównujących
84- obsługa argumentów pozycyjnych i słownikowych; działa jak zwykła
85 klasa - można przeciążać prawie wszystko w podklasie (np. własny
86 __init__).
87
88%package apidocs
89Summary: API documentation for Python fields module
90Summary(pl.UTF-8): Dokumentacja API modułu Pythona fields
91Group: Documentation
92
93%description apidocs
94API documentation for Python fields module.
95
96%description apidocs -l pl.UTF-8
97Dokumentacja API modułu Pythona fields.
98
99%prep
100%setup -q -n fields-%{version}
101%patch0 -p1
102%patch1 -p1
103
104%build
105%if %{with python2}
106%py_build
107
108%if %{with tests}
67278804
JB
109PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
110PYTEST_PLUGINS="pytest_benchmark.plugin" \
f02af86f
JB
111PYTHONPATH=$(pwd)/src \
112%{__python} -m pytest tests
113%endif
114%endif
115
116%if %{with python3}
117%py3_build
118
119%if %{with tests}
67278804
JB
120PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
121PYTEST_PLUGINS="pytest_benchmark.plugin" \
f02af86f
JB
122PYTHONPATH=$(pwd)/src \
123%{__python3} -m pytest tests
124%endif
125%endif
126
127%if %{with doc}
128cd docs
129PYTHONPATH=$(pwd)/../src \
130sphinx-build-3 -b html . _build/html
131%endif
132
133%install
134rm -rf $RPM_BUILD_ROOT
135
136%if %{with python2}
137%py_install
138
139%py_postclean
140%endif
141
142%if %{with python3}
143%py3_install
144%endif
145
146%clean
147rm -rf $RPM_BUILD_ROOT
148
149%if %{with python2}
150%files
151%defattr(644,root,root,755)
152%doc AUTHORS.rst CHANGELOG.rst LICENSE README.rst
153%{py_sitescriptdir}/fields
154%{py_sitescriptdir}/fields-%{version}-py*.egg-info
155%endif
156
157%if %{with python3}
158%files -n python3-fields
159%defattr(644,root,root,755)
160%doc AUTHORS.rst CHANGELOG.rst LICENSE README.rst
161%{py3_sitescriptdir}/fields
162%{py3_sitescriptdir}/fields-%{version}-py*.egg-info
163%endif
164
165%if %{with doc}
166%files apidocs
167%defattr(644,root,root,755)
168%doc docs/_build/html/{_modules,_static,reference,*.html,*.js}
169%endif
This page took 0.121228 seconds and 4 git commands to generate.