%global pypi_name yapf %global desc %{expand: \ YAPF Introduction Most of the current formatters for Python e.g., autopep8, and pep8ify are made to remove lint errors from code. This has some obvious limitations. For instance, code that conforms to the PEP 8 guidelines may not be} Name: python-%{pypi_name} Version: 0.26.0 Release: 2%{?dist} Summary: A formatter for Python code License: ASL 2.0 URL: https://github.com/google/yapf Source0: %{url}/archive/v%{version}/%{pypi_name}-%{version}.tar.gz BuildArch: noarch BuildRequires: python3-devel BuildRequires: python3dist(setuptools) %description %{desc} %package -n python3-%{pypi_name} Summary: %{summary} %{?python_provide:%python_provide python3-%{pypi_name}} Requires: python3dist(setuptools) %description -n python3-%{pypi_name} %{desc} %prep %autosetup -n %{pypi_name}-%{version} # Remove bundled egg-info rm -rf %{pypi_name}.egg-info for lib in $(find . -type f -name "*.py"); do sed '1{\@^#!/usr/bin/env python@d}' $lib > $lib.new && touch -r $lib $lib.new && mv $lib.new $lib done cp plugins/README.rst README-plugins.rst %build %py3_build %install %py3_install %check %{__python3} setup.py test %files -n python3-%{pypi_name} %license LICENSE %doc README-plugins.rst README.rst %{_bindir}/yapf %{python3_sitelib}/%{pypi_name} %{python3_sitelib}/yapftests %{python3_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info %changelog * Mon Apr 01 2019 Luis Bazan - 0.26.0-2 - Fix comment #7 BZ #1691609 * Fri Mar 22 2019 Luis Bazan - 0.26.0-1 - Initial package.