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: Python attributes without boilerplate
9 Summary(pl.UTF-8): Atrybuty w Pythonie bez ramowego kodu
10 Name: python-characteristic
14 Group: Libraries/Python
15 #Source0Download: https://pypi.org/simple/characteristic/
16 Source0: https://files.pythonhosted.org/packages/source/c/characteristic/characteristic-%{version}.tar.gz
17 # Source0-md5: b249368dd021fde1c06b4802867c0913
18 Patch0: %{name}-setup.patch
19 URL: https://characteristic.readthedocs.org/
20 BuildRequires: rpm-pythonprov
21 BuildRequires: rpmbuild(macros) >= 1.714
23 BuildRequires: python-modules >= 1:2.6
24 BuildRequires: python-setuptools >= 1:7.0
26 BuildRequires: python-pytest
30 BuildRequires: python3-modules >= 1:3.3
31 BuildRequires: python3-setuptools >= 1:7.0
33 BuildRequires: python-pytest
37 BuildRequires: sphinx-pdg
39 Requires: python-modules >= 1:2.6
41 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
44 characteristic is an MIT-licensed Python package with class decorators
45 that ease the chores of implementing the most common attribute-related
48 You just specify the attributes to work with and characteristic gives
50 - a nice human-readable __repr__,
51 - a complete set of comparison methods,
52 - immutability for attributes,
53 - and a kwargs-based initializer (that cooperates with your existing
54 one and optionally even checks the types of the arguments)
56 without writing dull boilerplate code again and again.
58 %description -l pl.UTF-8
59 characteristic to udostępniony na licencji MIT moduł Pythona z
60 dekoratorami klas ułatwiający implementowanie większości popularnych
61 protokołów związanych z atrybutami.
63 Wystarczy podać atrybuty, a characteristic daje dowolne lub wszystkie
65 - czytelne dla człowieka __repr__,
66 - pełny zestaw metod porównujących,
67 - niezmienność atrybutów,
68 - konstruktor oparty na kwargs (współpracujący z istniejącym,
69 opcjonalnie nawet sprawdzający typy argumentów)
71 bez pisania ciągle nudnego kodu ramowego.
73 %package -n python3-characteristic
74 Summary: Python attributes without boilerplate
75 Summary(pl.UTF-8): Atrybuty w Pythonie bez ramowego kodu
76 Group: Libraries/Python
77 Requires: python3-modules >= 1:3.3
79 %description -n python3-characteristic
80 characteristic is an MIT-licensed Python package with class decorators
81 that ease the chores of implementing the most common attribute-related
84 You just specify the attributes to work with and characteristic gives
86 - a nice human-readable __repr__,
87 - a complete set of comparison methods,
88 - immutability for attributes,
89 - and a kwargs-based initializer (that cooperates with your existing
90 one and optionally even checks the types of the arguments)
92 without writing dull boilerplate code again and again.
94 %description -n python3-characteristic -l pl.UTF-8
95 characteristic to udostępniony na licencji MIT moduł Pythona z
96 dekoratorami klas ułatwiający implementowanie większości popularnych
97 protokołów związanych z atrybutami.
99 Wystarczy podać atrybuty, a characteristic daje dowolne lub wszystkie
100 z następujących cech:
101 - czytelne dla człowieka __repr__,
102 - pełny zestaw metod porównujących,
103 - niezmienność atrybutów,
104 - konstruktor oparty na kwargs (współpracujący z istniejącym,
105 opcjonalnie nawet sprawdzający typy argumentów)
107 bez pisania ciągle nudnego kodu ramowego.
110 Summary: API documentation for Python characteristic module
111 Summary(pl.UTF-8): Dokumentacja API modułu Pythona characteristic
115 API documentation for Python characteristic module.
117 %description apidocs -l pl.UTF-8
118 Dokumentacja API modułu Pythona characteristic.
121 %setup -q -n characteristic-%{version}
126 %py_build %{?with_tests:test}
130 %py3_build %{?with_tests:test}
135 %{__make} -C docs html
139 rm -rf $RPM_BUILD_ROOT
144 %{__rm} $RPM_BUILD_ROOT%{py_sitescriptdir}/test_characteristic.py*
151 %{__rm} $RPM_BUILD_ROOT%{py3_sitescriptdir}/test_characteristic.py \
152 $RPM_BUILD_ROOT%{py3_sitescriptdir}/__pycache__/test_characteristic.*.py* \
156 rm -rf $RPM_BUILD_ROOT
160 %defattr(644,root,root,755)
161 %doc AUTHORS.rst LICENSE README.rst
162 %{py_sitescriptdir}/characteristic.py[co]
163 %{py_sitescriptdir}/characteristic-%{version}-py*.egg-info
167 %files -n python3-characteristic
168 %defattr(644,root,root,755)
169 %doc AUTHORS.rst LICENSE README.rst
170 %{py3_sitescriptdir}/characteristic.py
171 %{py3_sitescriptdir}/__pycache__/characteristic.cpython-*.py[co]
172 %{py3_sitescriptdir}/characteristic-%{version}-py*.egg-info
177 %defattr(644,root,root,755)
178 %doc docs/_build/html/{_static,*.html,*.js}