Blob Blame History Raw
%if 0%{?fedora} || 0%{?rhel} >= 7
%bcond_without python3
%else
%bcond_with python3
%endif

%global modname mccabe

Name:               python-%{modname}
Version:            0.6.1
Release:            5%{?dist}
Summary:            McCabe complexity checker

Group:              Development/Libraries
License:            MIT
URL:                http://pypi.python.org/pypi/mccabe
Source0:            https://files.pythonhosted.org/packages/source/m/%{modname}/%{modname}-%{version}.tar.gz

BuildArch:          noarch
BuildRequires:      python2-devel
%if 0%{?fedora} || 0%{?rhel} > 7
BuildRequires:      python2-setuptools
BuildRequires:      python2-pytest
BuildRequires:      python2-pytest-runner
%else
BuildRequires:      python-setuptools
BuildRequires:      pytest
%endif

%if %{with python3}
BuildRequires:      python%{python3_pkgversion}-devel, python%{python3_pkgversion}-setuptools
BuildRequires:      python%{python3_pkgversion}-pytest, python%{python3_pkgversion}-pytest-runner
%endif

%description
Ned's script to check McCabe complexity.

This module provides a plugin for ``flake8``, the Python code
checker.

%package -n python2-%{modname}
Summary:            McCabe checker, plugin for flake8
Group:              Development/Libraries
%{?python_provide:%python_provide python2-%{modname}}

%description -n python2-%{modname}
Ned's script to check McCabe complexity.

This module provides a plugin for ``flake8``, the Python code
checker.

%package -n python%{python3_pkgversion}-%{modname}
Summary:            McCabe checker, plugin for flake8
Group:              Development/Libraries
%{?python_provide:%python_provide python%{python3_pkgversion}-%{modname}}

%description -n python%{python3_pkgversion}-%{modname}
Ned's script to check McCabe complexity.

This module provides a plugin for ``flake8``, the Python code
checker.

%prep
%setup -q -n %{modname}-%{version}
# EL7 lacks python2-pytest-runner
%if 0%{?el7}
sed -i -e /pytest-runner/d setup.py
%endif

# Remove bundled egg-info in case it exists
rm -rf %{modname}.egg-info

%build
%py2_build
%{?with_python3:%py3_build}


%install
%{?with_python3:%py3_install}
%py2_install

%check
py.test-%{python2_version}
%{?with_python3:py.test-3}

%files -n python2-%{modname}
%license LICENSE
%doc README.rst
%{python2_sitelib}/%{modname}.py*
%{python2_sitelib}/%{modname}-%{version}*

%if %{with python3}
%files -n python%{python3_pkgversion}-%{modname}
%license LICENSE
%doc README.rst
%{python3_sitelib}/%{modname}.py*
%{python3_sitelib}/%{modname}-%{version}-*
%{python3_sitelib}/__pycache__/%{modname}.*
%endif

%changelog
* Tue Oct 24 2017 Matěj Cepl <mcepl@redhat.com> - 0.6.1-5
- Apply fix for building on EPEL7, thanks to mvadkert.

* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.6.1-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild

* Sun Jun 25 2017 Ville Skyttä <ville.skytta@iki.fi> - 0.6.1-3
- Use explicit python2-* dependencies where available
- Build Python 3 version by default on EL7

* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.6.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild

* Fri Jan 27 2017 Ville Skyttä <ville.skytta@iki.fi> - 0.6.1-1
- Update to 0.6.1

* Tue Jan 24 2017 Ville Skyttä <ville.skytta@iki.fi> - 0.6.0-1
- Update to 0.6.0

* Thu Jan 12 2017 Ville Skyttä <ville.skytta@iki.fi> - 0.5.3-1
- Update to 0.5.3
- Drop pytest-runner avoidance patch

* Tue Dec 13 2016 Stratakis Charalampos <cstratak@redhat.com> - 0.5.2-3
- Rebuild for Python 3.6

* Mon Oct 24 2016 Orion Poplawski <orion@cora.nwra.com> - 0.5.2-2
- Enable python3 for EPEL
- Ship python2-mccabe
- Ship LICENSE
- Modernize spec

* Sun Aug 14 2016 Ville Skyttä <ville.skytta@iki.fi> - 0.5.2-1
- Update to 0.5.2

* Sat Aug 13 2016 Ville Skyttä <ville.skytta@iki.fi> - 0.5.0-3
- Add python3-pytest build dep, patch to build/test without pytest-runner

* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5.0-2
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages

* Wed Jun 01 2016 Matěj Cepl <mcepl@redhat.com> - 0.5.0-1
- Upstream upgrade

* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.4.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild

* Thu Jan 28 2016 Matěj Cepl <mcepl@redhat.com> - 0.4.0-1
- Upstream upgrade

* Fri Nov 06 2015 Robert Kuska <rkuska@redhat.com> - 0.2.1-8
- Rebuilt for Python3.5 rebuild

* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.2.1-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild

* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.2.1-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild

* Wed May 14 2014 Bohuslav Kabrda <bkabrda@redhat.com> - 0.2.1-5
- Rebuilt for https://fedoraproject.org/wiki/Changes/Python_3.4

* Tue Apr 29 2014 Matěj Cepl <mcepl@redhat.com> - 0.2.1-4
- Fix building on RHEL-7 (we really don’t have Python3)

* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.2.1-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild

* Mon Apr 15 2013 Matěj Cepl <mcepl@redhat.com> 0.2.1-2
- Fix %%changelog.

* Sun Apr 14 2013 Matěj Cepl <mcepl@redhat.com> 0.2.1-1
- initial package for Fedora