]> git.pld-linux.org Git - packages/python-attrs.git/blob - python-attrs.spec
5aa0e8b9b3287f6dbb8e4da9217e081afff20541
[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.4.0
12 Release:        3
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:  5a9b5e9ceebc380a13fb93235b11bbda
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-furo
48 BuildRequires:  python3-sphinx-notfound-page
49 BuildRequires:  python3-zope.interface
50 %endif
51 Requires:       python-modules >= 1:2.7
52 BuildArch:      noarch
53 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
54
55 %description
56 attrs is the Python package that will bring back the joy of writing
57 classes by relieving you from the drudgery of implementing object
58 protocols (aka dunder methods).
59
60 %description -l pl.UTF-8
61 attrs to pakiet Pythona, mający przywrócić radość pisania klas
62 uwalniając od mordęgi implementowania protokołów obiektów (metod z
63 podwójnym podkreśleniem).
64
65 %package -n python3-attrs
66 Summary:        attrs - classes without boilerplate
67 Summary(pl.UTF-8):      attrs - klasy bez ramowego kodu
68 Group:          Libraries/Python
69 Requires:       python3-modules >= 1:3.5
70
71 %description -n python3-attrs
72 attrs is the Python package that will bring back the joy of writing
73 classes by relieving you from the drudgery of implementing object
74 protocols (aka dunder methods).
75
76 %description -n python3-attrs -l pl.UTF-8
77 attrs to pakiet Pythona, mający przywrócić radość pisania klas
78 uwalniając od mordęgi implementowania protokołów obiektów (metod z
79 podwójnym podkreśleniem).
80
81 %package apidocs
82 Summary:        API documentation for Python attrs module
83 Summary(pl.UTF-8):      Dokumentacja API modułu Pythona attrs
84 Group:          Documentation
85
86 %description apidocs
87 API documentation for Pythona attrs module.
88
89 %description apidocs -l pl.UTF-8
90 Dokumentacja API modułu Pythona attrs.
91
92 %prep
93 %setup -q -n attrs-%{version}
94
95 %build
96 %if %{with python2}
97 %py_build
98
99 %if %{with tests}
100 PYTHONPATH=$(pwd)/src \
101 %{__python} -m pytest tests
102 %endif
103 %endif
104
105 %if %{with python3}
106 %py3_build
107
108 %if %{with tests}
109 PYTHONPATH=$(pwd)/src \
110 %{__python3} -m pytest tests
111 %endif
112 %endif
113
114 %if %{with doc}
115 PYTHONPATH=$(pwd)/src \
116 %{__make} -C docs html \
117         SPHINXBUILD=sphinx-build-3
118 %endif
119
120 %install
121 rm -rf $RPM_BUILD_ROOT
122
123 %if %{with python2}
124 %py_install
125
126 %py_postclean
127 %endif
128
129 %if %{with python3}
130 %py3_install
131 %endif
132
133 %clean
134 rm -rf $RPM_BUILD_ROOT
135
136 %if %{with python2}
137 %files
138 %defattr(644,root,root,755)
139 %doc AUTHORS.rst CHANGELOG.rst LICENSE README.rst
140 %{py_sitescriptdir}/attr
141 %{py_sitescriptdir}/attrs
142 %{py_sitescriptdir}/attrs-%{version}-py*.egg-info
143 %endif
144
145 %if %{with python3}
146 %files -n python3-attrs
147 %defattr(644,root,root,755)
148 %doc AUTHORS.rst CHANGELOG.rst LICENSE README.rst
149 %{py3_sitescriptdir}/attr
150 %{py3_sitescriptdir}/attrs
151 %{py3_sitescriptdir}/attrs-%{version}-py*.egg-info
152 %endif
153
154 %if %{with doc}
155 %files apidocs
156 %defattr(644,root,root,755)
157 %doc docs/_build/html/{_static,*.html,*.js}
158 %endif
This page took 0.094585 seconds and 2 git commands to generate.