]> git.pld-linux.org Git - packages/flake8.git/blob - flake8.spec
rebuild with python 3.10
[packages/flake8.git] / flake8.spec
1 #
2 # Conditional build:
3 %bcond_without  python2 # CPython 2.x module
4 %bcond_without  python3 # CPython 3.x module
5 %bcond_without  tests   # pytest tests
6 %bcond_without  doc     # Sphinx documentation
7
8 Summary:        The modular source code checker: pycodestyle, pyflakes and co.
9 Summary(pl.UTF-8):      Modularne narzędzie do sprawdzania kodu źródłowego: pycodestyle, pyflakes itp.
10 Name:           flake8
11 # before updating to 4.x fork python-flake8.spec with last 3.x version
12 Version:        3.9.2
13 Release:        2
14 License:        MIT
15 Group:          Development/Tools
16 #Source0Download: https://pypi.org/simple/flake8/
17 Source0:        https://files.pythonhosted.org/packages/source/f/flake8/%{name}-%{version}.tar.gz
18 # Source0-md5:  5c102972d3d0f35255c56a20613fcec5
19 Patch0:         %{name}-duplicate.patch
20 URL:            https://gitlab.com/pycqa/flake8
21 BuildRequires:  rpmbuild(macros) >= 1.714
22 BuildRequires:  rpm-pythonprov
23 %if %{with python2}
24 BuildRequires:  python-modules >= 1:2.7
25 BuildRequires:  python-setuptools >= 1:30
26 %if %{with tests}
27 BuildRequires:  python-configparser
28 BuildRequires:  python-enum34
29 BuildRequires:  python-functools32
30 BuildRequires:  python-importlib_metadata
31 BuildRequires:  python-mccabe >= 0.6.0
32 BuildRequires:  python-mccabe < 0.7.0
33 BuildRequires:  python-mock >= 2.0.0
34 BuildRequires:  python-pycodestyle >= 2.7.0
35 BuildRequires:  python-pycodestyle < 2.8.0
36 BuildRequires:  python-pyflakes >= 2.3.0
37 BuildRequires:  python-pyflakes < 2.4.0
38 BuildRequires:  python-pytest
39 BuildRequires:  python-typing
40 %endif
41 %endif
42 %if %{with python3}
43 BuildRequires:  python3-modules >= 1:3.5
44 BuildRequires:  python3-setuptools >= 1:30
45 %if %{with tests}
46 %if "%{py3_ver}" < "3.8"
47 BuildRequires:  python3-importlib_metadata
48 %endif
49 BuildRequires:  python3-mccabe >= 0.6.0
50 BuildRequires:  python3-mccabe < 0.7.0
51 BuildRequires:  python3-pycodestyle >= 2.7.0
52 BuildRequires:  python3-pycodestyle < 2.8.0
53 BuildRequires:  python3-pyflakes >= 2.3.0
54 BuildRequires:  python3-pyflakes < 2.4.0
55 BuildRequires:  python3-pytest
56 BuildRequires:  sed >= 4.0
57 %endif
58 %endif
59 %if %{with doc}
60 BuildRequires:  python3-sphinx-prompt
61 BuildRequires:  sphinx-pdg-3 >= 1.3
62 %endif
63 %if %{with python3}
64 Requires:       python3-flake8 = %{version}-%{release}
65 %else
66 Requires:       python-flake8 = %{version}-%{release}
67 %endif
68 BuildArch:      noarch
69 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
70
71 %description
72 The modular source code checker. It is a wrapper around these tools:
73 - PyFlakes
74 - pycodestyle
75 - Ned Batchelder's McCabe script
76
77 %description -l pl.UTF-8
78 Modularne narzędzie do sprawdzania kodu źródłowego. Jest to opakowanie
79 dla narzędzi:
80 - PyFlakes
81 - pycodestyle
82 - skrypt McCabe autorstwa Neda Batcheldera
83
84 %package -n python-flake8
85 Summary:        The modular source code checker: pycodestyle, pyflakes and co.
86 Summary(pl.UTF-8):      Modularne narzędzie do sprawdzania kodu źródłowego: pycodestyle, pyflakes itp.
87 Group:          Libraries/Python
88 Requires:       python-mccabe >= 0.6.0
89 Requires:       python-mccabe < 0.7.0
90 Requires:       python-modules >= 1:2.7
91 Requires:       python-pycodestyle >= 2.7.0
92 Requires:       python-pycodestyle < 2.8.0
93 Requires:       python-pyflakes >= 2.3.0
94 Requires:       python-pyflakes < 2.4.0
95
96 %description -n python-flake8
97 The modular source code checker. It is a wrapper around these tools:
98 - PyFlakes
99 - pycodestyle
100 - Ned Batchelder's McCabe script
101
102 %description -n python-flake8 -l pl.UTF-8
103 Modularne narzędzie do sprawdzania kodu źródłowego. Jest to opakowanie
104 dla narzędzi:
105 - PyFlakes
106 - pycodestyle
107 - skrypt McCabe autorstwa Neda Batcheldera
108
109 %package -n python3-flake8
110 Summary:        The modular source code checker: pycodestyle, pyflakes and co
111 Summary(pl.UTF-8):      Modularne narzędzie do sprawdzania kodu źródłowego: pycodestyle, pyflakes itp.
112 Group:          Libraries/Python
113 Requires:       python3-mccabe >= 0.6.0
114 Requires:       python3-mccabe < 0.7.0
115 Requires:       python3-modules >= 1:3.4
116 Requires:       python3-pycodestyle >= 2.7.0
117 Requires:       python3-pycodestyle < 2.8.0
118 Requires:       python3-pyflakes >= 2.3.0
119 Requires:       python3-pyflakes < 2.4.0
120
121 %description -n python3-flake8
122 The modular source code checker. It is a wrapper around these tools:
123 - PyFlakes
124 - pycodestyle
125 - Ned Batchelder's McCabe script
126
127 %description -n python3-flake8 -l pl.UTF-8
128 Modularne narzędzie do sprawdzania kodu źródłowego. Jest to opakowanie
129 dla narzędzi:
130 - PyFlakes
131 - pycodestyle
132 - skrypt McCabe autorstwa Neda Batcheldera
133
134 %package -n python-flake8-apidocs
135 Summary:        API documentation for Python flake8 module
136 Summary(pl.UTF-8):      Dokumentacja API modułu Pythona flake8
137 Group:          Documentation
138
139 %description -n python-flake8-apidocs
140 API documentation for Python flake8 module.
141
142 %description -n python-flake8-apidocs -l pl.UTF-8
143 Dokumentacja API modułu Pythona flake8.
144
145 %prep
146 %setup -q
147 %patch0 -p1
148
149 %build
150 %if %{with python2}
151 %py_build
152
153 %if %{with tests}
154 PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
155 PYTHONPATH=$(pwd)/src \
156 %{__python} -m pytest -rw tests
157 %endif
158 %endif
159
160 %if %{with python3}
161 # don't require standalone mock
162 %{__sed} -i -e 's/import mock/from unittest import mock/' $(grep 'import mock' tests/ -rl)
163
164 %py3_build
165
166 %if %{with tests}
167 PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
168 PYTHONPATH=$(pwd)/src \
169 %{__python3} -m pytest -rw tests
170 %endif
171 %endif
172
173 %if %{with doc}
174 cd docs/source
175 PYTHONPATH=$(pwd)/../../src \
176 sphinx-build-3 -b html . _build/html
177 %endif
178
179 %install
180 rm -rf $RPM_BUILD_ROOT
181
182 %if %{with python2}
183 %py_install
184 %{__mv} $RPM_BUILD_ROOT%{_bindir}/flake8{,-2}
185 %py_postclean
186 %endif
187
188 %if %{with python3}
189 %py3_install
190 %{__mv} $RPM_BUILD_ROOT%{_bindir}/flake8{,-3}
191 %endif
192
193 ln -s flake-%{!?with_python3:2}%{?with_python3:3} $RPM_BUILD_ROOT%{_bindir}/flake8
194
195 %clean
196 rm -rf $RPM_BUILD_ROOT
197
198 %files
199 %defattr(644,root,root,755)
200 %attr(755,root,root) %{_bindir}/flake8
201
202 %if %{with python2}
203 %files -n python-flake8
204 %defattr(644,root,root,755)
205 %doc CONTRIBUTORS.txt LICENSE README.rst
206 %attr(755,root,root) %{_bindir}/flake8-2
207 %{py_sitescriptdir}/flake8
208 %{py_sitescriptdir}/flake8-%{version}-py*.egg-info
209 %endif
210
211 %if %{with python3}
212 %files -n python3-flake8
213 %defattr(644,root,root,755)
214 %doc CONTRIBUTORS.txt LICENSE README.rst
215 %attr(755,root,root) %{_bindir}/flake8-3
216 %{py3_sitescriptdir}/flake8
217 %{py3_sitescriptdir}/flake8-%{version}-py*.egg-info
218 %endif
219
220 %if %{with doc}
221 %files -n python-flake8-apidocs
222 %defattr(644,root,root,755)
223 %doc docs/source/_build/html/{_modules,_static,internal,plugin-development,release-notes,user,*.html,*.js}
224 %endif
This page took 0.062872 seconds and 4 git commands to generate.