f4fd9d0
%if 0%{?fedora}
30354bf
%bcond_without python3
30354bf
%else
30354bf
%bcond_with python3
30354bf
%endif
30354bf
30354bf
%global modname flake8
30354bf
539ae9b
%global pyflakes_dep    >= 0.8.1
539ae9b
%global pycodestyle_dep >= 2.0.0
539ae9b
%global mccabe_dep      >= 0.5.0
539ae9b
30354bf
Name:             python-%{modname}
539ae9b
Version:          3.0.4
539ae9b
Release:          1%{?dist}
539ae9b
Summary:          Python code checking using pyflakes, pycodestyle, and mccabe
30354bf
30354bf
License:          MIT
539ae9b
URL:              https://gitlab.com/pycqa/flake8
2f0bd58
Source0:          https://files.pythonhosted.org/packages/source/f/%{modname}/%{modname}-%{version}.tar.gz
539ae9b
# https://gitlab.com/pycqa/flake8/merge_requests/123
539ae9b
Patch0:           flake8-3.0.4-pytest.patch
30354bf
30354bf
BuildArch:        noarch
2a60911
2a60911
%description
539ae9b
Flake8 is a wrapper around PyFlakes, pycodestyle, and Ned's McCabe
539ae9b
script. It runs all the tools by launching the single flake8 script,
539ae9b
and displays the warnings in a per-file, merged output.
2a60911
2a60911
It also adds a few features: files that contain "# flake8: noqa" are
2a60911
skipped, lines that contain a "# noqa" comment at the end will not
2a60911
issue warnings, Git and Mercurial hooks are included, a McCabe
2a60911
complexity checker is included, and it is extendable through
2a60911
flake8.extension entry points.
2a60911
2a60911
%package -n python2-%{modname}
539ae9b
Summary:        Python code checking using pyflakes, pycodestyle, and mccabe
2a60911
2a60911
Obsoletes:   python-%{modname} < 2.5.1
2a60911
%{?python_provide:%python_provide python2-%{modname}}
2a60911
539ae9b
Requires:    python-mccabe %{mccabe_dep}
539ae9b
Requires:    python2-pycodestyle %{pycodestyle_dep}
539ae9b
Requires:    pyflakes %{pyflakes_dep}
2a60911
Requires:    python-setuptools
539ae9b
Requires:    python-enum34
539ae9b
Requires:    python-configparser
2a60911
52ce2a8
BuildRequires:    python2-devel
52ce2a8
BuildRequires:    python-setuptools
539ae9b
BuildRequires:    python-mccabe %{mccabe_dep}
539ae9b
BuildRequires:    python2-pycodestyle %{pycodestyle_dep}
539ae9b
BuildRequires:    pyflakes %{pyflakes_dep}
94f2190
BuildRequires:    python-mock
539ae9b
BuildRequires:    python-enum34
539ae9b
BuildRequires:    python-configparser
7e856f1
BuildRequires:    python2-pytest-runner
30354bf
2a60911
%description -n python2-%{modname}
539ae9b
Flake8 is a wrapper around PyFlakes, pycodestyle, and Ned's McCabe
539ae9b
script. It runs all the tools by launching the single flake8 script,
539ae9b
and displays the warnings in a per-file, merged output.
30354bf
c73f41a
It also adds a few features: files that contain "# flake8: noqa" are
c73f41a
skipped, lines that contain a "# noqa" comment at the end will not
c73f41a
issue warnings, Git and Mercurial hooks are included, a McCabe
c73f41a
complexity checker is included, and it is extendable through
c73f41a
flake8.extension entry points.
30354bf
30354bf
%if %{with python3}
30354bf
%package -n python3-%{modname}
539ae9b
Summary:        Python code checking using pyflakes, pycodestyle, and mccabe
2a60911
2a60911
%{?python_provide:%python_provide python3-%{modname}}
30354bf
52ce2a8
Requires:    python3-setuptools
539ae9b
Requires:    python3-mccabe %{mccabe_dep}
539ae9b
Requires:    python3-pycodestyle %{pycodestyle_dep}
539ae9b
Requires:    python3-pyflakes %{pyflakes_dep}
52ce2a8
e88440c
BuildRequires:    python3-devel
e88440c
BuildRequires:    python3-setuptools
539ae9b
BuildRequires:    python3-mccabe %{mccabe_dep}
539ae9b
BuildRequires:    python3-pycodestyle %{pycodestyle_dep}
539ae9b
BuildRequires:    python3-pyflakes %{pyflakes_dep}
e88440c
BuildRequires:    python3-mock
7e856f1
BuildRequires:    python3-pytest-runner
e88440c
30354bf
%description -n python3-%{modname}
539ae9b
Flake8 is a wrapper around PyFlakes, pycodestyle, and Ned's McCabe
539ae9b
script. It runs all the tools by launching the single flake8 script,
539ae9b
and displays the warnings in a per-file, merged output.
30354bf
c73f41a
It also adds a few features: files that contain "# flake8: noqa" are
c73f41a
skipped, lines that contain a "# noqa" comment at the end will not
c73f41a
issue warnings, Git and Mercurial hooks are included, a McCabe
c73f41a
complexity checker is included, and it is extendable through
c73f41a
flake8.extension entry points.
30354bf
30354bf
This is version of the package running with Python 3.
30354bf
%endif
30354bf
30354bf
30354bf
%prep
539ae9b
%autosetup -n %{modname}-%{version}
539ae9b
touch tox.ini  # https://gitlab.com/pycqa/flake8/merge_requests/123
d3c78c5
e88440c
# remove requirements from setup.py, handled by rpm.
e88440c
sed -i '/"pyflakes.*"/d' setup.py
539ae9b
sed -i '/"pycodestyle.*"/d' setup.py
e88440c
sed -i '/"mccabe .*"/d' setup.py
f4fd9d0
30354bf
30354bf
%build
2a60911
%py2_build
30354bf
%if %{with python3}
2a60911
%py3_build
30354bf
%endif
30354bf
2a60911
30354bf
%install
30354bf
# Must do the python3 install first because the scripts in /usr/bin are
30354bf
# overwritten with every setup.py install (and we want the python2 version
30354bf
# to be the default for now).
30354bf
%if %{with python3}
2a60911
%py3_install
227e633
mv %{buildroot}%{_bindir}/flake8 %{buildroot}%{_bindir}/flake8-3
227e633
ln -s flake8-3 %{buildroot}%{_bindir}/flake8-%{python3_version}
227e633
ln -s flake8-3 %{buildroot}%{_bindir}/python3-flake8  # backwards compat
30354bf
%endif
2a60911
%py2_install
227e633
ln -s flake8 %{buildroot}%{_bindir}/flake8-2
227e633
ln -s flake8-2 %{buildroot}%{_bindir}/flake8-%{python2_version}
30354bf
30354bf
30354bf
%check
539ae9b
%{__python2} setup.py test
539ae9b
%{?with_python3:%{__python3} setup.py test}
2a60911
30354bf
2a60911
%files -n python2-%{modname}
30354bf
%doc README.rst CONTRIBUTORS.txt
227e633
%{_bindir}/flake8
227e633
%{_bindir}/flake8-2
227e633
%{_bindir}/flake8-%{python2_version}
30354bf
%{python_sitelib}/%{modname}*
30354bf
30354bf
%if %{with python3}
30354bf
%files -n python3-%{modname}
30354bf
%doc README.rst CONTRIBUTORS.txt
227e633
%{_bindir}/flake8-3
227e633
%{_bindir}/flake8-%{python3_version}
30354bf
%{_bindir}/python3-flake8
30354bf
%{python3_sitelib}/%{modname}*
30354bf
%endif
30354bf
30354bf
30354bf
%changelog
539ae9b
* Sat Sep 17 2016 Ville Skyttä <ville.skytta@iki.fi> - 3.0.4-1
539ae9b
- Update to 3.0.4
227e633
- Add standard versioned names for executable
227e633
8fcc4b7
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.5.5-2
8fcc4b7
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
8fcc4b7
2f0bd58
* Wed Jun 15 2016 Ville Skyttä <ville.skytta@iki.fi> - 2.5.5-1
2f0bd58
- Update to 2.5.5 (rhbz#1346516)
2f0bd58
c736a68
* Fri Feb 12 2016 Ville Skyttä <ville.skytta@iki.fi> - 2.5.4-1
c736a68
- Update to 2.5.4 (rhbz#1306870)
c736a68
1fc067b
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 2.5.2-2
1fc067b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
1fc067b
6c441d6
* Sun Jan 31 2016 Ville Skyttä <ville.skytta@iki.fi> - 2.5.2-1
6c441d6
- Update to 2.5.2 (rhbz#1303383)
6c441d6
7660157
* Wed Dec 30 2015 Ville Skyttä <ville.skytta@iki.fi> - 2.5.1-1
7660157
- Update to 2.5.1 (rhbz#1289545)
2a60911
- Update to current Fedora Python packaging guidelines
7660157
04aab87
* Tue Nov 10 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.5.0-3
04aab87
- Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5
04aab87
a198995
* Tue Nov 10 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.5.0-2
a198995
- Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5
a198995
66c8897
* Mon Nov 02 2015 Matthias Runge <mrunge@redhat.com> - 2.5.0-1
66c8897
- update to 2.5.0 (rhbz#1275447)
66c8897
c73f41a
* Mon Oct 26 2015 Ville Skyttä <ville.skytta@iki.fi> - 2.4.1-3
c73f41a
- Update/improve description
c73f41a
e88440c
* Mon Jul 06 2015 Matthias Runge <mrunge@redhat.com> - 2.4.1-2
e88440c
- fix FTBFS (rhbz#1239837)
e88440c
6755173
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.4.1-2
6755173
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
6755173
821dfe2
* Thu May 21 2015 Matej Cepl <mcepl@redhat.com> - 2.4.1-1
821dfe2
- update to 2.4.1 (rhbz#1178814)
821dfe2
f3c406b
* Mon Oct 20 2014 Matthias Runge <mrunge@redhat.com> - 2.2.5-1
f3c406b
- update to 2.2.5 (rhbz#1132878)
f3c406b
bb54326
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.1.0-3
bb54326
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
bb54326
835f348
* Wed May 14 2014 Bohuslav Kabrda <bkabrda@redhat.com> - 2.1.0-2
835f348
- Rebuilt for https://fedoraproject.org/wiki/Changes/Python_3.4
835f348
9676920
* Wed Apr 09 2014 Matthias Runge <mrunge@redhat.com> - 2.1.0-1
9676920
- update to 2.1.0
9676920
52ce2a8
* Thu Jan 02 2014 Matthias Runge <mrunge@redhat.com> - 2.0-5
52ce2a8
- add missing requires to pep8, python-mccabe and pyflakes (rhbz#1046955)
52ce2a8
30354bf
* Mon Nov 18 2013 Matthias Runge <mrunge@redhat.com> - 2.0-4
30354bf
- use __python2 instead of __python
30354bf
- add CONTRIBUTORS.txt to py3 docs
30354bf
30354bf
* Tue Nov 05 2013 Matthias Runge <mrunge@redhat.com> - 2.0-3
30354bf
- minimal spec cleanup, fix one rpmlint warning
30354bf
30354bf
* Sat Sep 08 2012 Matej Cepl <mcepl@redhat.com> - 1.4-2
30354bf
- Update .spec file according to ongoing packaging review.
30354bf
30354bf
* Tue Jul 10 2012 Matej Cepl <mcepl@redhat.com> - 1.4-1
30354bf
- initial package for Fedora
30354bf