%if 0%{?fedora} > 12 %bcond_without python3 %else %bcond_with python3 %endif %{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} %global module_name pycodestyle Name: python-%{module_name} Version: 2.0.0 Release: 1%{?dist} Summary: Python style guide checker Group: Development/Languages # License is held in the comments of pep8.py # setup.py claims license is Expat license, which is the same as MIT License: MIT URL: https://pypi.python.org/pypi/%{module_name} Source0: https://pypi.io/packages/source/u/%{module_name}/%{module_name}-%{version}.tar.gz BuildArch: noarch BuildRequires: python2-devel BuildRequires: python-setuptools BuildRequires: python-sphinx BuildRequires: python-sphinx_rtd_theme Requires: python-setuptools Obsoletes: python-pep8 %description pycodestyle is a tool to check your Python code against some of the style conventions in PEP 8. It has a plugin architecture, making new checks easy, and its output is parseable, making it easy to jump to an error location in your editor. %if %{with python3} %package -n python3-pycodestyle Summary: Python style guide checker BuildRequires: python3-devel BuildRequires: python3-setuptools BuildRequires: python3-sphinx Requires: python3-setuptools %description -n python3-pycodestyle pycodestyle is a tool to check your Python code against some of the style conventions in PEP 8. It has a plugin architecture, making new checks easy, and its output is parseable, making it easy to jump to an error location in your editor. This is a version for Python 3. %endif %prep %setup -qn %{module_name}-%{version} # Remove #! from pycodestyle.py sed --in-place "s:#!\s*/usr.*::" pycodestyle.py %if %{with python3} rm -rf %{py3dir} cp -a . %{py3dir} %endif %build %{__python} setup.py build build_sphinx %if %{with python3} pushd %{py3dir} %{__python3} setup.py build popd %endif %install rm -rf %{buildroot} %if %{with python3} pushd %{py3dir} %{__python3} setup.py install -O1 --skip-build --root %{buildroot} mv %{buildroot}%{_bindir}/pycodestyle %{buildroot}%{_bindir}/python3-pycodestyle popd %endif %{__python} setup.py install -O1 --skip-build --root %{buildroot} %check python pycodestyle.py --testsuite testsuite python pycodestyle.py --doctest %if %{with python3} pushd %{py3dir} PYTHONPATH="%{buildroot}%{python3_sitelib}:$PYTHONPATH" %{__python3} pycodestyle.py --testsuite testsuite popd %endif %files %defattr(-,root,root,-) %doc CHANGES.txt README.rst build/sphinx/html/* %{_bindir}/pycodestyle %{python_sitelib}/%{module_name}.py* %{python_sitelib}/%{module_name}-%{version}-*.egg-info %if %{with python3} %files -n python3-pycodestyle %doc README.rst CHANGES.txt build/sphinx/html/* %{_bindir}/python3-pycodestyle %{python3_sitelib}/%{module_name}.py* %{python3_sitelib}/%{module_name}-%{version}-*.egg-info/ %{python3_sitelib}/__pycache__/%{module_name}* %endif %changelog * Sun Jun 05 2016 Luke Macken - 2.0.0-1 - The pep8 project has been renamed to pycodestyle - Add python-sphinx_rtd_theme to the BuildRequires * Thu Feb 04 2016 Fedora Release Engineering - 1.6.2-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild * Thu Nov 12 2015 Fedora Release Engineering - 1.6.2-3 - Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5 * Wed Nov 11 2015 Robert Kuska - 1.6.2-2 - Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5 * Wed Nov 11 2015 Matthias Runge - 1.6.2-1 - update to 1.6.2 * Fri Nov 06 2015 Robert Kuska - 1.5.7-3 - Rebuilt for Python3.5 rebuild * Thu Jun 18 2015 Fedora Release Engineering - 1.5.7-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild * Mon Oct 20 2014 Matthias Runge - 1.5.7-1 - update to 1.5.7 * Sat Jun 07 2014 Fedora Release Engineering - 1.5.6-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild * Thu May 15 2014 Bohuslav Kabrda - 1.5.6-2 - Rebuilt for https://fedoraproject.org/wiki/Changes/Python_3.4 * Wed May 14 2014 Matthias Runge - 1.5.6-1 - update to 1.5.6 (rhbz#1087351) * Tue Apr 08 2014 Matthias Runge - 1.5.4-1 - require python3-setuptools (rhbz#1084756) - update to 1.5.4 (rhbz#1081516) * Wed Feb 26 2014 Matthias Runge -1.4.6-2 - rename py3 version of pep8 to python3-pep8 (rhbz#1060408) * Tue Aug 13 2013 Ian Weller - 1.4.6-1 - update to 1.4.6 * Sun Aug 04 2013 Fedora Release Engineering - 1.4.5-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild * Fri Jun 14 2013 Matthias Runge - 1.4.5-1 - update to 1.4.5 (rhbz#918924) - introduce py3 package (rhbz#971941) * Tue Feb 26 2013 Ian Weller - 1.4.4-1 - Update to 1.4.4 * Mon Feb 11 2013 Ian Weller - 1.4.2-1 - Update to 1.4.2 * Tue Jan 29 2013 Ian Weller - 1.4.1-1 - Update to 1.4.1 - Add Sphinx docs * Fri Sep 07 2012 Ian Weller - 1.3.3-3 - Run test suite using the pep8.py that has been installed * Fri Sep 07 2012 Ian Weller - 1.3.3-2 - Add test suite * Thu Sep 06 2012 Ian Weller - 1.3.3-1 - Update to 1.3.3 * Sat Jul 21 2012 Fedora Release Engineering - 1.3-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild * Sat Jun 16 2012 Ian Weller - 1.3-1 - Update to 1.3 * Sat Apr 07 2012 Ian Weller - 1.0.1-1 - Update to 1.0.1 * Fri Jan 27 2012 Ian Weller - 0.6.1-1 - Update to 0.6.1 * Sat Jan 14 2012 Fedora Release Engineering - 0.6.0-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild * Tue Feb 08 2011 Fedora Release Engineering - 0.6.0-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild * Fri Jan 21 2011 Ian Weller - 0.6.0-2 - RHBZ 633102: Requires: python-setuptools * Tue Nov 16 2010 Ian Weller - 0.6.0-1 - Changed upstream (same code, new maintainer, new URL) - New release * Thu Jul 22 2010 David Malcolm - 0.4.2-3 - Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild * Mon Nov 9 2009 Ian Weller - 0.4.2-2 - Add BR: python-setuptools - Change URL to the correct upstream * Sun Nov 8 2009 Ian Weller - 0.4.2-1 - Initial package build