File python-pep8.spec of Package python-pep8
#
# spec file for package python-pep8
#
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-pep8
Version: 1.7.0
Release: 0
Summary: Python style guide checker
License: MIT
Group: Development/Languages/Python
Url: https://github.com/pycqa/pep8
Source: https://files.pythonhosted.org/packages/source/p/pep8/pep8-%{version}.tar.gz
BuildRequires: %{python_module devel}
BuildRequires: %{python_module setuptools}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
Requires: python-setuptools
Requires(post): update-alternatives
Requires(postun): update-alternatives
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildArch: noarch
%python_subpackages
%description
Pep8 is a tool to check your Python code against some of the style
conventions in PEP 8.
%prep
%setup -q -n pep8-%{version}
sed -ri '1s/^#!.*//' pep8.py
%build
%python_build
%install
%python_install
%python_clone -a %{buildroot}%{_bindir}/pep8
%fdupes %{buildroot}%{_prefix}
%check
%python_exec setup.py test
%post
%python_install_alternative pep8
%postun
%python_uninstall_alternative pep8
%files %{python_files}
%defattr(-,root,root)
%doc CHANGES.txt README.rst
%python_alternative %{_bindir}/pep8
%pycache_only %{python_sitelib}/__pycache__/*
%{python_sitelib}/pep8.py*
%{python_sitelib}/pep8-%{version}-py*.egg-info
%changelog