]> git.pld-linux.org Git - packages/python-attrs.git/blob - python-attrs.spec
- updated to 21.2.0
[packages/python-attrs.git] / python-attrs.spec
1 #
2 # Conditional build:
3 %bcond_without  doc     # Sphinx documentation
4 %bcond_with     tests   # unit tests (TODO: re-enable when proper pytest is available in PLD)
5 %bcond_without  python2 # CPython 2.x module
6 %bcond_without  python3 # CPython 3.x module
7
8 Summary:        attrs - classes without boilerplate
9 Summary(pl.UTF-8):      attrs - klasy bez ramowego kodu
10 Name:           python-attrs
11 Version:        21.2.0
12 Release:        1
13 License:        MIT
14 Group:          Libraries/Python
15 #Source0Download: https://pypi.org/simple/attrs/
16 Source0:        https://files.pythonhosted.org/packages/source/a/attrs/attrs-%{version}.tar.gz
17 # Source0-md5:  06af884070d9180694becdb106e5cd65
18 URL:            https://pypi.org/project/attrs/
19 BuildRequires:  rpm-pythonprov
20 BuildRequires:  rpmbuild(macros) >= 1.714
21 %if %{with python2}
22 BuildRequires:  python-modules >= 1:2.7
23 BuildRequires:  python-setuptools
24 %if %{with tests}
25 BuildRequires:  python-coverage
26 BuildRequires:  python-hypothesis
27 BuildRequires:  python-pympler
28 BuildRequires:  python-pytest >= 4.3.0
29 BuildRequires:  python-six
30 BuildRequires:  python-zope.interface
31 %endif
32 %endif
33 %if %{with python3}
34 BuildRequires:  python3-modules >= 1:3.5
35 BuildRequires:  python3-setuptools
36 %if %{with tests}
37 BuildRequires:  python3-coverage
38 BuildRequires:  python3-hypothesis
39 BuildRequires:  python3-pympler
40 BuildRequires:  python3-pytest >= 4.3.0
41 BuildRequires:  python3-six
42 BuildRequires:  python3-zope.interface
43 %endif
44 %endif
45 %if %{with doc}
46 BuildRequires:  sphinx-pdg-3
47 BuildRequires:  python3-sphinx-notfound-page
48 BuildRequires:  python3-zope.interface
49 %endif
50 Requires:       python-modules >= 1:2.7
51 BuildArch:      noarch
52 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
53
54 %description
55 attrs is the Python package that will bring back the joy of writing
56 classes by relieving you from the drudgery of implementing object
57 protocols (aka dunder methods).
58
59 %description -l pl.UTF-8
60 attrs to pakiet Pythona, mający przywrócić radość pisania klas
61 uwalniając od mordęgi implementowania protokołów obiektów (metod z
62 podwójnym podkreśleniem).
63
64 %package -n python3-attrs
65 Summary:        attrs - classes without boilerplate
66 Summary(pl.UTF-8):      attrs - klasy bez ramowego kodu
67 Group:          Libraries/Python
68 Requires:       python3-modules >= 1:3.5
69
70 %description -n python3-attrs
71 attrs is the Python package that will bring back the joy of writing
72 classes by relieving you from the drudgery of implementing object
73 protocols (aka dunder methods).
74
75 %description -n python3-attrs -l pl.UTF-8
76 attrs to pakiet Pythona, mający przywrócić radość pisania klas
77 uwalniając od mordęgi implementowania protokołów obiektów (metod z
78 podwójnym podkreśleniem).
79
80 %package apidocs
81 Summary:        API documentation for Python attrs module
82 Summary(pl.UTF-8):      Dokumentacja API modułu Pythona attrs
83 Group:          Documentation
84
85 %description apidocs
86 API documentation for Pythona attrs module.
87
88 %description apidocs -l pl.UTF-8
89 Dokumentacja API modułu Pythona attrs.
90
91 %prep
92 %setup -q -n attrs-%{version}
93
94 %build
95 %if %{with python2}
96 %py_build
97
98 %if %{with tests}
99 PYTHONPATH=$(pwd)/src \
100 %{__python} -m pytest tests
101 %endif
102 %endif
103
104 %if %{with python3}
105 %py3_build
106
107 %if %{with tests}
108 PYTHONPATH=$(pwd)/src \
109 %{__python3} -m pytest tests
110 %endif
111 %endif
112
113 %if %{with doc}
114 PYTHONPATH=$(pwd)/src \
115 %{__make} -C docs html \
116         SPHINXBUILD=sphinx-build-3
117 %endif
118
119 %install
120 rm -rf $RPM_BUILD_ROOT
121
122 %if %{with python2}
123 %py_install
124
125 %py_postclean
126 %endif
127
128 %if %{with python3}
129 %py3_install
130 %endif
131
132 %clean
133 rm -rf $RPM_BUILD_ROOT
134
135 %if %{with python2}
136 %files
137 %defattr(644,root,root,755)
138 %doc AUTHORS.rst CHANGELOG.rst LICENSE README.rst
139 %{py_sitescriptdir}/attr
140 %{py_sitescriptdir}/attrs-%{version}-py*.egg-info
141 %endif
142
143 %if %{with python3}
144 %files -n python3-attrs
145 %defattr(644,root,root,755)
146 %doc AUTHORS.rst CHANGELOG.rst LICENSE README.rst
147 %{py3_sitescriptdir}/attr
148 %{py3_sitescriptdir}/attrs-%{version}-py*.egg-info
149 %endif
150
151 %if %{with doc}
152 %files apidocs
153 %defattr(644,root,root,755)
154 %doc docs/_build/html/{_static,*.html,*.js}
155 %endif
This page took 0.094935 seconds and 3 git commands to generate.