]> git.pld-linux.org Git - SPECS.git/blob - python-fields.spec
SPECS updated Sun 1 Aug 11:02:02 CEST 2021
[SPECS.git] / python-fields.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:        Container class boilerplate killer
9 Summary(pl.UTF-8):      Zabójca ramowego kodu klas kontenerów
10 Name:           python-fields
11 Version:        5.0.0
12 Release:        4
13 License:        BSD
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
23 %if %{with python2}
24 BuildRequires:  python-modules >= 1:2.6
25 BuildRequires:  python-setuptools
26 %if %{with tests}
27 BuildRequires:  python-characteristic
28 BuildRequires:  python-pytest
29 BuildRequires:  python-pytest-benchmark
30 %endif
31 %endif
32 %if %{with python3}
33 BuildRequires:  python3-modules >= 1:3.3
34 BuildRequires:  python3-setuptools
35 %if %{with tests}
36 BuildRequires:  python3-characteristic
37 BuildRequires:  python3-pytest
38 BuildRequires:  python3-pytest-benchmark
39 %endif
40 %endif
41 %if %{with doc}
42 BuildRequires:  python3-sphinx_py3doc_enhanced_theme
43 # with sphinx.ext.napoleon
44 BuildRequires:  sphinx-pdg-3 >= 1.3
45 %endif
46 Requires:       python-modules >= 1:2.6
47 BuildArch:      noarch
48 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
49
50 %description
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
56   __init__).
57
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
64   __init__).
65
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
71
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
78   __init__).
79
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
86   __init__).
87
88 %package apidocs
89 Summary:        API documentation for Python fields module
90 Summary(pl.UTF-8):      Dokumentacja API modułu Pythona fields
91 Group:          Documentation
92
93 %description apidocs
94 API documentation for Python fields module.
95
96 %description apidocs -l pl.UTF-8
97 Dokumentacja 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}
109 PYTHONPATH=$(pwd)/src \
110 %{__python} -m pytest tests
111 %endif
112 %endif
113
114 %if %{with python3}
115 %py3_build
116
117 %if %{with tests}
118 PYTHONPATH=$(pwd)/src \
119 %{__python3} -m pytest tests
120 %endif
121 %endif
122
123 %if %{with doc}
124 cd docs
125 PYTHONPATH=$(pwd)/../src \
126 sphinx-build-3 -b html . _build/html
127 %endif
128
129 %install
130 rm -rf $RPM_BUILD_ROOT
131
132 %if %{with python2}
133 %py_install
134
135 %py_postclean
136 %endif
137
138 %if %{with python3}
139 %py3_install
140 %endif
141
142 %clean
143 rm -rf $RPM_BUILD_ROOT
144
145 %if %{with python2}
146 %files
147 %defattr(644,root,root,755)
148 %doc AUTHORS.rst CHANGELOG.rst LICENSE README.rst
149 %{py_sitescriptdir}/fields
150 %{py_sitescriptdir}/fields-%{version}-py*.egg-info
151 %endif
152
153 %if %{with python3}
154 %files -n python3-fields
155 %defattr(644,root,root,755)
156 %doc AUTHORS.rst CHANGELOG.rst LICENSE README.rst
157 %{py3_sitescriptdir}/fields
158 %{py3_sitescriptdir}/fields-%{version}-py*.egg-info
159 %endif
160
161 %if %{with doc}
162 %files apidocs
163 %defattr(644,root,root,755)
164 %doc docs/_build/html/{_modules,_static,reference,*.html,*.js}
165 %endif
This page took 0.06188 seconds and 3 git commands to generate.