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
8 Summary: Container class boilerplate killer
9 Summary(pl.UTF-8): Zabójca ramowego kodu klas kontenerów
14 Group: Libraries/Python
15 #Source0Download: https://pypi.org/simple/fields/
16 Source0: https://files.pythonhosted.org/packages/source/f/fields/fields-%{version}.tar.gz
17 # Source0-md5: 4b3a60ddaad146f698979cf4da2639d4
18 Patch0: %{name}-docs.patch
19 Patch1: %{name}-tests.patch
20 URL: https://github.com/ionelmc/python-fields
21 BuildRequires: rpm-pythonprov
22 BuildRequires: rpmbuild(macros) >= 1.714
24 BuildRequires: python-modules >= 1:2.6
25 BuildRequires: python-setuptools
27 BuildRequires: python-characteristic
28 BuildRequires: python-pytest
29 BuildRequires: python-pytest-benchmark
33 BuildRequires: python3-modules >= 1:3.3
34 BuildRequires: python3-setuptools
36 BuildRequires: python3-characteristic
37 BuildRequires: python3-pytest
38 BuildRequires: python3-pytest-benchmark
42 BuildRequires: python3-sphinx_py3doc_enhanced_theme
43 # with sphinx.ext.napoleon
44 BuildRequires: sphinx-pdg-3 >= 1.3
46 Requires: python-modules >= 1:2.6
48 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
51 Container 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
58 %description -l pl.UTF-8
59 Zabó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
66 %package -n python3-fields
67 Summary: Container class boilerplate killer
68 Summary(pl.UTF-8): Zabójca ramowego kodu klas kontenerów
69 Group: Libraries/Python
70 Requires: python3-modules >= 1:3.3
72 %description -n python3-fields
73 Container 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
80 %description -n python3-fields -l pl.UTF-8
81 Zabó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
89 Summary: API documentation for Python fields module
90 Summary(pl.UTF-8): Dokumentacja API modułu Pythona fields
94 API documentation for Python fields module.
96 %description apidocs -l pl.UTF-8
97 Dokumentacja API modułu Pythona fields.
100 %setup -q -n fields-%{version}
109 PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
110 PYTEST_PLUGINS="pytest_benchmark.plugin" \
111 PYTHONPATH=$(pwd)/src \
112 %{__python} -m pytest tests
120 PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
121 PYTEST_PLUGINS="pytest_benchmark.plugin" \
122 PYTHONPATH=$(pwd)/src \
123 %{__python3} -m pytest tests
129 PYTHONPATH=$(pwd)/../src \
130 sphinx-build-3 -b html . _build/html
134 rm -rf $RPM_BUILD_ROOT
147 rm -rf $RPM_BUILD_ROOT
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
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
167 %defattr(644,root,root,755)
168 %doc docs/_build/html/{_modules,_static,reference,*.html,*.js}