]> git.pld-linux.org Git - packages/python-characteristic.git/blob - python-characteristic.spec
26889288e6b4576c335add22a4c5e836028c6cbc
[packages/python-characteristic.git] / python-characteristic.spec
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
8 Summary:        Python attributes without boilerplate
9 Summary(pl.UTF-8):      Atrybuty w Pythonie bez ramowego kodu
10 Name:           python-characteristic
11 Version:        14.3.0
12 Release:        3
13 License:        MIT
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
22 %if %{with python2}
23 BuildRequires:  python-modules >= 1:2.6
24 BuildRequires:  python-setuptools >= 1:7.0
25 %if %{with tests}
26 BuildRequires:  python-pytest
27 %endif
28 %endif
29 %if %{with python3}
30 BuildRequires:  python3-modules >= 1:3.3
31 BuildRequires:  python3-setuptools >= 1:7.0
32 %if %{with tests}
33 BuildRequires:  python-pytest
34 %endif
35 %endif
36 %if %{with doc}
37 BuildRequires:  sphinx-pdg
38 %endif
39 Requires:       python-modules >= 1:2.6
40 BuildArch:      noarch
41 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
42
43 %description
44 characteristic is an MIT-licensed Python package with class decorators
45 that ease the chores of implementing the most common attribute-related
46 object protocols.
47
48 You just specify the attributes to work with and characteristic gives
49 you any or all of:
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)
55
56 without writing dull boilerplate code again and again.
57
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.
62
63 Wystarczy podać atrybuty, a characteristic daje dowolne lub wszystkie
64 z następujących cech:
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)
70
71 bez pisania ciągle nudnego kodu ramowego.
72
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
78
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
82 object protocols.
83
84 You just specify the attributes to work with and characteristic gives
85 you any or all of:
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)
91
92 without writing dull boilerplate code again and again.
93
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.
98
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)
106
107 bez pisania ciągle nudnego kodu ramowego.
108
109 %package apidocs
110 Summary:        API documentation for Python characteristic module
111 Summary(pl.UTF-8):      Dokumentacja API modułu Pythona characteristic
112 Group:          Documentation
113
114 %description apidocs
115 API documentation for Python characteristic module.
116
117 %description apidocs -l pl.UTF-8
118 Dokumentacja API modułu Pythona characteristic.
119
120 %prep
121 %setup -q -n characteristic-%{version}
122 %patch0 -p1
123
124 %build
125 %if %{with python2}
126 %py_build %{?with_tests:test}
127 %endif
128
129 %if %{with python3}
130 %py3_build %{?with_tests:test}
131 %endif
132
133 %if %{with doc}
134 PYTHONPATH=$(pwd) \
135 %{__make} -C docs html
136 %endif
137
138 %install
139 rm -rf $RPM_BUILD_ROOT
140
141 %if %{with python2}
142 %py_install
143
144 %{__rm} $RPM_BUILD_ROOT%{py_sitescriptdir}/test_characteristic.py*
145 %py_postclean
146 %endif
147
148 %if %{with python3}
149 %py3_install
150
151 %{__rm} $RPM_BUILD_ROOT%{py3_sitescriptdir}/test_characteristic.py \
152         $RPM_BUILD_ROOT%{py3_sitescriptdir}/__pycache__/test_characteristic.*.py* \
153 %endif
154
155 %clean
156 rm -rf $RPM_BUILD_ROOT
157
158 %if %{with python2}
159 %files
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
164 %endif
165
166 %if %{with python3}
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
173 %endif
174
175 %if %{with doc}
176 %files apidocs
177 %defattr(644,root,root,755)
178 %doc docs/_build/html/{_static,*.html,*.js}
179 %endif
This page took 0.071227 seconds and 2 git commands to generate.