927be8e
%if 0%{?rhel} && 0%{?rhel} <= 7
cf9ae3e
%{!?__python2: %global __python2 /usr/bin/python2}
cf9ae3e
%{!?python2_sitelib: %global python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
cf9ae3e
%{!?python2_sitearch: %global python2_sitearch %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
cf9ae3e
%else
cf9ae3e
%global with_python3 1
cf9ae3e
%endif
cf9ae3e
cf9ae3e
%global srcname pytest-flakes
cf9ae3e
cf9ae3e
Name:           python-%{srcname}
cf9ae3e
Version:        0.2
f727a60
Release:        4%{?dist}
cf9ae3e
Summary:        Pytest plugin to check source code with pyflakes
cf9ae3e
cf9ae3e
License:        MIT
cf9ae3e
URL:            https://pypi.python.org/pypi/%{srcname}
cf9ae3e
Source0:        https://pypi.python.org/packages/source/p/%{srcname}/%{srcname}-%{version}.zip
cf9ae3e
Source1:        https://raw.githubusercontent.com/fschulze/pytest-flakes/master/LICENSE
cf9ae3e
cf9ae3e
BuildArch:      noarch
cf9ae3e
BuildRequires:  python2-devel
cf9ae3e
BuildRequires:  python-setuptools
cf9ae3e
BuildRequires:  pyflakes
cf9ae3e
BuildRequires:  python-pytest-cache
cf9ae3e
Requires:       pyflakes
cf9ae3e
Requires:       python-pytest-cache
cf9ae3e
cf9ae3e
%if 0%{?with_python3}
cf9ae3e
BuildRequires:  python3-devel
cf9ae3e
BuildRequires:  python3-setuptools
cf9ae3e
BuildRequires:  python3-pyflakes
cf9ae3e
BuildRequires:  python3-pytest-cache
cf9ae3e
%endif
cf9ae3e
cf9ae3e
%description
cf9ae3e
Py.test plugin for efficiently checking python source with pyflakes.
cf9ae3e
cf9ae3e
cf9ae3e
%if 0%{?with_python3}
cf9ae3e
%package -n python3-%{srcname}
cf9ae3e
Summary:        Pytest plugin to check source code with pyflakes
cf9ae3e
Requires:       python3-pyflakes
cf9ae3e
Requires:       python3-pytest-cache
cf9ae3e
cf9ae3e
%description -n python3-%{srcname}
cf9ae3e
Py.test plugin for efficiently checking python source with pyflakes.
cf9ae3e
%endif # with_python3
cf9ae3e
cf9ae3e
cf9ae3e
%prep
cf9ae3e
%setup -q -n %{srcname}-%{version}
cf9ae3e
cp %SOURCE1 .
cf9ae3e
rm -rf *.egg-info
cf9ae3e
cf9ae3e
%if 0%{?with_python3}
cf9ae3e
rm -rf %{py3dir}
cf9ae3e
cp -a . %{py3dir}
cf9ae3e
find %{py3dir} -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python3}|'
cf9ae3e
%endif # with_python3
cf9ae3e
cf9ae3e
cf9ae3e
%build
cf9ae3e
%{__python2} setup.py build
cf9ae3e
cf9ae3e
%if 0%{?with_python3}
cf9ae3e
pushd %{py3dir}
cf9ae3e
%{__python3} setup.py build
cf9ae3e
popd
cf9ae3e
%endif # with_python3
cf9ae3e
cf9ae3e
cf9ae3e
%install
cf9ae3e
%if 0%{?with_python3}
cf9ae3e
pushd %{py3dir}
cf9ae3e
%{__python3} setup.py install --skip-build --root %{buildroot}
cf9ae3e
popd
cf9ae3e
%endif # with_python3
cf9ae3e
cf9ae3e
%{__python2} setup.py install --skip-build --root %{buildroot}
cf9ae3e
cf9ae3e
cf9ae3e
%check
cf9ae3e
%{__python2} setup.py test
cf9ae3e
cf9ae3e
%if 0%{?with_python3}
cf9ae3e
pushd %{py3dir}
cf9ae3e
%{__python3} setup.py test
cf9ae3e
popd
cf9ae3e
%endif # with_python3
cf9ae3e
cf9ae3e
 
cf9ae3e
%files
cf9ae3e
%doc LICENSE README.rst
cf9ae3e
%{python2_sitelib}/*
cf9ae3e
cf9ae3e
%if 0%{?with_python3}
cf9ae3e
%files -n python3-%{srcname}
cf9ae3e
%doc LICENSE README.rst
cf9ae3e
%{python3_sitelib}/*
cf9ae3e
%endif # with_python3
cf9ae3e
cf9ae3e
cf9ae3e
%changelog
f727a60
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.2-4
f727a60
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
f727a60
eab228c
* Mon May 19 2014 Bohuslav Kabrda <bkabrda@redhat.com> - 0.2-3
eab228c
- Rebuilt for https://fedoraproject.org/wiki/Changes/Python_3.4
eab228c
cf9ae3e
* Sat Mar 22 2014 Orion Poplawski <orion@cora.nwra.com> - 0.2-2
cf9ae3e
- Capitalize summary/description
cf9ae3e
- Add upstream license file
cf9ae3e
cf9ae3e
* Tue Feb 25 2014 Orion Poplawski <orion@cora.nwra.com> - 0.2-1
cf9ae3e
- Initial package