]> git.pld-linux.org Git - packages/flake8.git/blame - flake8.spec
explicit runtime deps on python-{entrypoints,mccabe,pycodestyle,pyflakes}; rel 3
[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
34073edd
JB
5%bcond_without tests # pytest tests
6%bcond_without doc # Sphinx documentation
a24e9a34 7
d7cb1ebf
JB
8Summary: The modular source code checker: pycodestyle, pyflakes and co
9Summary(pl.UTF-8): Modularne narzędzie do sprawdzania kodu źródłowego: pycodestyle, pyflakes itp.
abcf879e 10Name: flake8
2fc1c087 11Version: 3.7.9
9c766400 12Release: 3
abcf879e
AM
13License: MIT
14Group: Development/Tools
34073edd 15#Source0Download: https://pypi.org/simple/flake8/
d7cb1ebf 16Source0: https://files.pythonhosted.org/packages/source/f/flake8/%{name}-%{version}.tar.gz
2fc1c087 17# Source0-md5: 7dc0ce36b6cf49b13b46bb37ddca80c5
7b99a73b 18Patch0: %{name}-req.patch
2fc1c087 19Patch1: %{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
18203870
JB
28BuildRequires: python-entrypoints >= 0.3
29BuildRequires: python-entrypoints < 0.4
d7cb1ebf 30BuildRequires: python-enum34
18203870 31BuildRequires: python-functools32
d7cb1ebf
JB
32BuildRequires: python-mccabe >= 0.6.0
33BuildRequires: python-mccabe < 0.7.0
972dfbb9 34BuildRequires: python-mock >= 2.0.0
18203870
JB
35BuildRequires: python-pycodestyle >= 2.5.0
36BuildRequires: python-pycodestyle < 2.6.0
37BuildRequires: python-pyflakes >= 2.1.0
38BuildRequires: python-pyflakes < 2.2.0
d7cb1ebf 39BuildRequires: python-pytest
18203870 40BuildRequires: python-typing
37b9d23d
JB
41%endif
42%endif
43%if %{with python3}
d7cb1ebf 44BuildRequires: python3-modules >= 1:3.4
2fc1c087 45BuildRequires: python3-setuptools >= 1:30
a24e9a34 46%if %{with tests}
18203870
JB
47BuildRequires: python3-entrypoints >= 0.3
48BuildRequires: python3-entrypoints < 0.4
d7cb1ebf
JB
49BuildRequires: python3-mccabe >= 0.6.0
50BuildRequires: python3-mccabe < 0.7.0
18203870
JB
51BuildRequires: python3-pycodestyle >= 2.5.0
52BuildRequires: python3-pycodestyle < 2.6.0
53BuildRequires: python3-pyflakes >= 2.1.0
54BuildRequires: python3-pyflakes < 2.2.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
d7cb1ebf
JB
85Summary: The modular source code checker: pycodestyle, pyflakes and co
86Summary(pl.UTF-8): Modularne narzędzie do sprawdzania kodu źródłowego: pycodestyle, pyflakes itp.
37b9d23d 87Group: Libraries/Python
9c766400
JP
88Requires: python-entrypoints >= 0.3
89Requires: python-entrypoints < 0.4
90Requires: python-mccabe >= 0.6.0
91Requires: python-mccabe < 0.7.0
d7cb1ebf 92Requires: python-modules >= 1:2.7
9c766400
JP
93Requires: python-pycodestyle >= 2.5.0
94Requires: python-pycodestyle < 2.6.0
95Requires: python-pyflakes >= 2.1.0
96Requires: python-pyflakes < 2.2.0
37b9d23d
JB
97
98%description -n python-flake8
99The modular source code checker. It is a wrapper around these tools:
100- PyFlakes
d7cb1ebf 101- pycodestyle
37b9d23d
JB
102- Ned Batchelder's McCabe script
103
104%description -n python-flake8 -l pl.UTF-8
105Modularne narzędzie do sprawdzania kodu źródłowego. Jest to opakowanie
106dla narzędzi:
107- PyFlakes
d7cb1ebf 108- pycodestyle
37b9d23d
JB
109- skrypt McCabe autorstwa Neda Batcheldera
110
111%package -n python3-flake8
d7cb1ebf
JB
112Summary: The modular source code checker: pycodestyle, pyflakes and co
113Summary(pl.UTF-8): Modularne narzędzie do sprawdzania kodu źródłowego: pycodestyle, pyflakes itp.
37b9d23d 114Group: Libraries/Python
9c766400
JP
115Requires: python3-entrypoints >= 0.3
116Requires: python3-entrypoints < 0.4
117Requires: python3-mccabe >= 0.6.0
118Requires: python3-mccabe < 0.7.0
d7cb1ebf 119Requires: python3-modules >= 1:3.4
9c766400
JP
120Requires: python3-pycodestyle >= 2.5.0
121Requires: python3-pycodestyle < 2.6.0
122Requires: python3-pyflakes >= 2.1.0
123Requires: python3-pyflakes < 2.2.0
37b9d23d
JB
124
125%description -n python3-flake8
126The modular source code checker. It is a wrapper around these tools:
127- PyFlakes
d7cb1ebf 128- pycodestyle
37b9d23d
JB
129- Ned Batchelder's McCabe script
130
131%description -n python3-flake8 -l pl.UTF-8
132Modularne narzędzie do sprawdzania kodu źródłowego. Jest to opakowanie
133dla narzędzi:
134- PyFlakes
d7cb1ebf 135- pycodestyle
37b9d23d
JB
136- skrypt McCabe autorstwa Neda Batcheldera
137
34073edd
JB
138%package -n python-flake8-apidocs
139Summary: API documentation for Python flake8 module
140Summary(pl.UTF-8): Dokumentacja API modułu Pythona flake8
141Group: Documentation
142
143%description -n python-flake8-apidocs
144API documentation for Python flake8 module.
145
146%description -n python-flake8-apidocs -l pl.UTF-8
147Dokumentacja API modułu Pythona flake8.
148
abcf879e
AM
149%prep
150%setup -q
7b99a73b 151%patch0 -p1
2fc1c087 152%patch1 -p1
abcf879e
AM
153
154%build
37b9d23d 155%if %{with python2}
18203870
JB
156%py_build
157
158%if %{with tests}
159PYTHONPATH=$(pwd)/src \
160%{__python} -m pytest -rw tests
161%endif
37b9d23d
JB
162%endif
163
164%if %{with python3}
d7cb1ebf
JB
165# don't require standalone mock
166%{__sed} -i -e 's/import mock/from unittest import mock/' $(grep 'import mock' tests/ -rl)
167
18203870
JB
168%py3_build
169
170%if %{with tests}
171PYTHONPATH=$(pwd)/src \
172%{__python3} -m pytest -rw tests
173%endif
37b9d23d 174%endif
abcf879e 175
34073edd
JB
176%if %{with doc}
177cd docs/source
178PYTHONPATH=$(pwd)/../../src \
179sphinx-build-3 -b html . _build/html
180%endif
181
abcf879e
AM
182%install
183rm -rf $RPM_BUILD_ROOT
37b9d23d
JB
184
185%if %{with python2}
186%py_install
d7cb1ebf 187%{__mv} $RPM_BUILD_ROOT%{_bindir}/flake8{,-2}
37b9d23d
JB
188%py_postclean
189%endif
190
191%if %{with python3}
33643bb9 192%py3_install
d7cb1ebf 193%{__mv} $RPM_BUILD_ROOT%{_bindir}/flake8{,-3}
37b9d23d 194%endif
abcf879e 195
8b0b6706
ER
196ln -s flake-%{!?with_python3:2}%{?with_python3:3} $RPM_BUILD_ROOT%{_bindir}/flake8
197
abcf879e
AM
198%clean
199rm -rf $RPM_BUILD_ROOT
200
201%files
202%defattr(644,root,root,755)
abcf879e 203%attr(755,root,root) %{_bindir}/flake8
37b9d23d
JB
204
205%if %{with python2}
206%files -n python-flake8
207%defattr(644,root,root,755)
34073edd 208%doc CONTRIBUTORS.txt LICENSE README.rst
37b9d23d
JB
209%attr(755,root,root) %{_bindir}/flake8-2
210%{py_sitescriptdir}/flake8
211%{py_sitescriptdir}/flake8-%{version}-py*.egg-info
212%endif
213
214%if %{with python3}
215%files -n python3-flake8
216%defattr(644,root,root,755)
34073edd 217%doc CONTRIBUTORS.txt LICENSE README.rst
37b9d23d
JB
218%attr(755,root,root) %{_bindir}/flake8-3
219%{py3_sitescriptdir}/flake8
220%{py3_sitescriptdir}/flake8-%{version}-py*.egg-info
221%endif
34073edd
JB
222
223%if %{with doc}
224%files -n python-flake8-apidocs
225%defattr(644,root,root,755)
226%doc docs/source/_build/html/{_modules,_static,internal,plugin-development,release-notes,user,*.html,*.js}
227%endif
This page took 0.128094 seconds and 4 git commands to generate.