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