Blob Blame Raw
# Python 3 only for Fedora for now.
%if 0%{?fedora}
%global with_python3 1
%endif

%global srcname pytest-flakes

Name:           python-%{srcname}
Version:        2.0.0
Release:        3%{?dist}
Summary:        Pytest plugin to check source code with pyflakes

License:        MIT
URL:            https://pypi.python.org/pypi/%{srcname}
Source0:        https://files.pythonhosted.org/packages/source/p/%{srcname}/%{srcname}-%{version}.tar.gz

BuildArch:      noarch
BuildRequires:  python2-devel
BuildRequires:  python2-setuptools
BuildRequires:  python2-pyflakes
BuildRequires:  python2-pytest
# this is specified in setup.py, so we need it installed to run the
# tests even if we have pytest >= 2.8, in which case it won't be used
# at all
BuildRequires:  python2-pytest-cache

%if 0%{?with_python3}
BuildRequires:  python%{python3_pkgversion}-devel
BuildRequires:  python%{python3_pkgversion}-setuptools
BuildRequires:  python%{python3_pkgversion}-pyflakes
BuildRequires:  python%{python3_pkgversion}-pytest
BuildRequires:  python%{python3_pkgversion}-pytest-cache
%endif # with_python3

%description
Py.test plugin for efficiently checking python source with pyflakes.


%package -n python2-%{srcname}
Summary:        %{summary}
%{?python_provide:%python_provide python2-%{srcname}}
Requires:       python2-pyflakes

%description -n python2-%{srcname}
Py.test plugin for efficiently checking python source with pyflakes.
Python 2 build.



%if 0%{?with_python3}
%package -n python%{python3_pkgversion}-%{srcname}
Summary:        Pytest plugin to check source code with pyflakes
Requires:       python%{python3_pkgversion}-pyflakes

%description -n python%{python3_pkgversion}-%{srcname}
Py.test plugin for efficiently checking python source with pyflakes.
Python 3 build.
%endif # with_python3


%prep
%setup -q -n %{srcname}-%{version}
rm -rf *.egg-info


%build
%py2_build
%if 0%{?with_python3}
%py3_build
%endif # with_python3


%install
%if 0%{?with_python3}
%py3_install
%endif # with_python3
%py2_install


%check
%{__python2} setup.py test
%if 0%{?with_python3}
%{__python3} setup.py test
%endif # with_python3

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

%if 0%{?with_python3}
%files -n python%{python3_pkgversion}-%{srcname}
%license LICENSE
%doc README.rst
%{python3_sitelib}/__pycache__/*
%{python3_sitelib}/*.egg-info
%{python3_sitelib}/*.py
%endif # with_python3


%changelog
* Fri Feb 09 2018 Iryna Shcherbina <ishcherb@redhat.com> - 2.0.0-3
- Update Python 2 dependency declarations to new packaging standards
  (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3)

* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild

* Fri Nov 17 2017 Orin Poplawski <orion@nwra.com> - 2.0.0-1
- Update to 2.0.0

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

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

* Mon Dec 19 2016 Miro HronĨok <mhroncok@redhat.com> - 1.0.1-5
- Rebuild for Python 3.6

* Wed Nov 16 2016 Orion Poplawski <orion@cora.nwra.com> - 1.0.1-4
- Do not own __pycache__ dir

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

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

* Fri Jan 22 2016 Adam Williamson <awilliam@redhat.com> - 1.0.1-1
- new release 1.0.1 (compatible with pytest 2.8)
- rename py2 package to python2-pytest-flakes
- only require pytest-cache on <F24 (and EPEL), pytest 2.8 includes it
- use pyX_build and pyX_install
- use license macro
- provide python2-pytest-flakes
- drop EPEL 6 workarounds from spec as we can't build on EPEL 6 anyway

* Tue Nov 10 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.2-6
- Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5

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

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

* Mon May 19 2014 Bohuslav Kabrda <bkabrda@redhat.com> - 0.2-3
- Rebuilt for https://fedoraproject.org/wiki/Changes/Python_3.4

* Sat Mar 22 2014 Orion Poplawski <orion@cora.nwra.com> - 0.2-2
- Capitalize summary/description
- Add upstream license file

* Tue Feb 25 2014 Orion Poplawski <orion@cora.nwra.com> - 0.2-1
- Initial package