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