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: 7e5fe39d578a2c2d0962b61b35b8c3fc
18 Patch0: %{name}-mock.patch
19 URL: https://gitlab.com/pycqa/flake8
20 BuildRequires: rpmbuild(macros) >= 1.714
21 BuildRequires: rpm-pythonprov
23 BuildRequires: python-modules >= 1:2.7
24 BuildRequires: python-setuptools >= 30
26 BuildRequires: python-configparser
27 BuildRequires: python-enum34
28 BuildRequires: python-mccabe >= 0.6.0
29 BuildRequires: python-mccabe < 0.7.0
30 BuildRequires: python-mock >= 2.0.0
31 BuildRequires: python-pycodestyle >= 2.0.0
32 BuildRequires: python-pycodestyle < 2.4.0
33 BuildRequires: python-pyflakes >= 1.5.0
34 BuildRequires: python-pyflakes < 1.7.0
35 BuildRequires: python-pytest
36 BuildRequires: python-pytest-runner
40 BuildRequires: python3-modules >= 1:3.4
41 BuildRequires: python3-setuptools >= 30
43 BuildRequires: python3-mccabe >= 0.6.0
44 BuildRequires: python3-mccabe < 0.7.0
45 BuildRequires: python3-pycodestyle >= 2.0.0
46 BuildRequires: python3-pycodestyle < 2.4.0
47 BuildRequires: python3-pyflakes >= 1.5.0
48 BuildRequires: python3-pyflakes < 1.7.0
49 BuildRequires: python3-pytest
50 BuildRequires: python3-pytest-runner
51 BuildRequires: sed >= 4.0
55 BuildRequires: python3-sphinx-prompt
56 BuildRequires: sphinx-pdg-3
59 Requires: python3-flake8 = %{version}-%{release}
61 Requires: python-flake8 = %{version}-%{release}
64 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
67 The modular source code checker. It is a wrapper around these tools:
70 - Ned Batchelder's McCabe script
72 %description -l pl.UTF-8
73 Modularne narzędzie do sprawdzania kodu źródłowego. Jest to opakowanie
77 - skrypt McCabe autorstwa Neda Batcheldera
79 %package -n python-flake8
80 Summary: The modular source code checker: pycodestyle, pyflakes and co
81 Summary(pl.UTF-8): Modularne narzędzie do sprawdzania kodu źródłowego: pycodestyle, pyflakes itp.
82 Group: Libraries/Python
83 Requires: python-modules >= 1:2.7
85 %description -n python-flake8
86 The modular source code checker. It is a wrapper around these tools:
89 - Ned Batchelder's McCabe script
91 %description -n python-flake8 -l pl.UTF-8
92 Modularne narzędzie do sprawdzania kodu źródłowego. Jest to opakowanie
96 - skrypt McCabe autorstwa Neda Batcheldera
98 %package -n python3-flake8
99 Summary: The modular source code checker: pycodestyle, pyflakes and co
100 Summary(pl.UTF-8): Modularne narzędzie do sprawdzania kodu źródłowego: pycodestyle, pyflakes itp.
101 Group: Libraries/Python
102 Requires: python3-modules >= 1:3.4
104 %description -n python3-flake8
105 The modular source code checker. It is a wrapper around these tools:
108 - Ned Batchelder's McCabe script
110 %description -n python3-flake8 -l pl.UTF-8
111 Modularne narzędzie do sprawdzania kodu źródłowego. Jest to opakowanie
115 - skrypt McCabe autorstwa Neda Batcheldera
117 %package -n python-flake8-apidocs
118 Summary: API documentation for Python flake8 module
119 Summary(pl.UTF-8): Dokumentacja API modułu Pythona flake8
122 %description -n python-flake8-apidocs
123 API documentation for Python flake8 module.
125 %description -n python-flake8-apidocs -l pl.UTF-8
126 Dokumentacja API modułu Pythona flake8.
134 %py_build %{?with_tests:test}
138 # don't require standalone mock
139 %{__sed} -i -e 's/import mock/from unittest import mock/' $(grep 'import mock' tests/ -rl)
141 %py3_build %{?with_tests:test}
146 PYTHONPATH=$(pwd)/../../src \
147 sphinx-build-3 -b html . _build/html
151 rm -rf $RPM_BUILD_ROOT
155 %{__mv} $RPM_BUILD_ROOT%{_bindir}/flake8{,-2}
161 %{__mv} $RPM_BUILD_ROOT%{_bindir}/flake8{,-3}
163 # avoid dependencies on python3egg(configparser), python3egg(enum34)
164 %{__sed} -i -e "/^\[:python_version *< *'3\.2']/,/^$/ d" \
165 -e "/^\[:python_version *< *'3\.4']/,/^$/ d" \
166 $RPM_BUILD_ROOT%{py3_sitescriptdir}/flake8-%{version}-py*.egg-info/requires.txt
169 ln -s flake-%{!?with_python3:2}%{?with_python3:3} $RPM_BUILD_ROOT%{_bindir}/flake8
172 rm -rf $RPM_BUILD_ROOT
175 %defattr(644,root,root,755)
176 %attr(755,root,root) %{_bindir}/flake8
179 %files -n python-flake8
180 %defattr(644,root,root,755)
181 %doc CONTRIBUTORS.txt LICENSE README.rst
182 %attr(755,root,root) %{_bindir}/flake8-2
183 %{py_sitescriptdir}/flake8
184 %{py_sitescriptdir}/flake8-%{version}-py*.egg-info
188 %files -n python3-flake8
189 %defattr(644,root,root,755)
190 %doc CONTRIBUTORS.txt LICENSE README.rst
191 %attr(755,root,root) %{_bindir}/flake8-3
192 %{py3_sitescriptdir}/flake8
193 %{py3_sitescriptdir}/flake8-%{version}-py*.egg-info
197 %files -n python-flake8-apidocs
198 %defattr(644,root,root,755)
199 %doc docs/source/_build/html/{_modules,_static,internal,plugin-development,release-notes,user,*.html,*.js}