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
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.
14 Group: Development/Tools
15 #Source0Download: https://pypi.org/simple/flake8/
16 Source0: https://files.pythonhosted.org/packages/source/f/flake8/%{name}-%{version}.tar.gz
17 # Source0-md5: 7dc0ce36b6cf49b13b46bb37ddca80c5
18 Patch0: %{name}-req.patch
19 Patch1: %{name}-duplicate.patch
20 URL: https://gitlab.com/pycqa/flake8
21 BuildRequires: rpmbuild(macros) >= 1.714
22 BuildRequires: rpm-pythonprov
24 BuildRequires: python-modules >= 1:2.7
25 BuildRequires: python-setuptools >= 1:30
27 BuildRequires: python-configparser
28 BuildRequires: python-entrypoints >= 0.3
29 BuildRequires: python-entrypoints < 0.4
30 BuildRequires: python-enum34
31 BuildRequires: python-functools32
32 BuildRequires: python-mccabe >= 0.6.0
33 BuildRequires: python-mccabe < 0.7.0
34 BuildRequires: python-mock >= 2.0.0
35 BuildRequires: python-pycodestyle >= 2.5.0
36 BuildRequires: python-pycodestyle < 2.6.0
37 BuildRequires: python-pyflakes >= 2.1.0
38 BuildRequires: python-pyflakes < 2.2.0
39 BuildRequires: python-pytest
40 BuildRequires: python-typing
44 BuildRequires: python3-modules >= 1:3.4
45 BuildRequires: python3-setuptools >= 1:30
47 BuildRequires: python3-entrypoints >= 0.3
48 BuildRequires: python3-entrypoints < 0.4
49 BuildRequires: python3-mccabe >= 0.6.0
50 BuildRequires: python3-mccabe < 0.7.0
51 BuildRequires: python3-pycodestyle >= 2.5.0
52 BuildRequires: python3-pycodestyle < 2.6.0
53 BuildRequires: python3-pyflakes >= 2.1.0
54 BuildRequires: python3-pyflakes < 2.2.0
55 BuildRequires: python3-pytest
56 BuildRequires: sed >= 4.0
60 BuildRequires: python3-sphinx-prompt
61 BuildRequires: sphinx-pdg-3 >= 1.3
64 Requires: python3-flake8 = %{version}-%{release}
66 Requires: python-flake8 = %{version}-%{release}
69 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
72 The modular source code checker. It is a wrapper around these tools:
75 - Ned Batchelder's McCabe script
77 %description -l pl.UTF-8
78 Modularne narzędzie do sprawdzania kodu źródłowego. Jest to opakowanie
82 - skrypt McCabe autorstwa Neda Batcheldera
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-modules >= 1:2.7
90 %description -n python-flake8
91 The modular source code checker. It is a wrapper around these tools:
94 - Ned Batchelder's McCabe script
96 %description -n python-flake8 -l pl.UTF-8
97 Modularne narzędzie do sprawdzania kodu źródłowego. Jest to opakowanie
101 - skrypt McCabe autorstwa Neda Batcheldera
103 %package -n python3-flake8
104 Summary: The modular source code checker: pycodestyle, pyflakes and co
105 Summary(pl.UTF-8): Modularne narzędzie do sprawdzania kodu źródłowego: pycodestyle, pyflakes itp.
106 Group: Libraries/Python
107 Requires: python3-modules >= 1:3.4
109 %description -n python3-flake8
110 The modular source code checker. It is a wrapper around these tools:
113 - Ned Batchelder's McCabe script
115 %description -n python3-flake8 -l pl.UTF-8
116 Modularne narzędzie do sprawdzania kodu źródłowego. Jest to opakowanie
120 - skrypt McCabe autorstwa Neda Batcheldera
122 %package -n python-flake8-apidocs
123 Summary: API documentation for Python flake8 module
124 Summary(pl.UTF-8): Dokumentacja API modułu Pythona flake8
127 %description -n python-flake8-apidocs
128 API documentation for Python flake8 module.
130 %description -n python-flake8-apidocs -l pl.UTF-8
131 Dokumentacja API modułu Pythona flake8.
143 PYTHONPATH=$(pwd)/src \
144 %{__python} -m pytest -rw tests
149 # don't require standalone mock
150 %{__sed} -i -e 's/import mock/from unittest import mock/' $(grep 'import mock' tests/ -rl)
155 PYTHONPATH=$(pwd)/src \
156 %{__python3} -m pytest -rw tests
162 PYTHONPATH=$(pwd)/../../src \
163 sphinx-build-3 -b html . _build/html
167 rm -rf $RPM_BUILD_ROOT
171 %{__mv} $RPM_BUILD_ROOT%{_bindir}/flake8{,-2}
177 %{__mv} $RPM_BUILD_ROOT%{_bindir}/flake8{,-3}
180 ln -s flake-%{!?with_python3:2}%{?with_python3:3} $RPM_BUILD_ROOT%{_bindir}/flake8
183 rm -rf $RPM_BUILD_ROOT
186 %defattr(644,root,root,755)
187 %attr(755,root,root) %{_bindir}/flake8
190 %files -n python-flake8
191 %defattr(644,root,root,755)
192 %doc CONTRIBUTORS.txt LICENSE README.rst
193 %attr(755,root,root) %{_bindir}/flake8-2
194 %{py_sitescriptdir}/flake8
195 %{py_sitescriptdir}/flake8-%{version}-py*.egg-info
199 %files -n python3-flake8
200 %defattr(644,root,root,755)
201 %doc CONTRIBUTORS.txt LICENSE README.rst
202 %attr(755,root,root) %{_bindir}/flake8-3
203 %{py3_sitescriptdir}/flake8
204 %{py3_sitescriptdir}/flake8-%{version}-py*.egg-info
208 %files -n python-flake8-apidocs
209 %defattr(644,root,root,755)
210 %doc docs/source/_build/html/{_modules,_static,internal,plugin-development,release-notes,user,*.html,*.js}