forked from pool/python-autoflake
- Use noun phrase in summary. OBS-URL: https://build.opensuse.org/request/show/654135 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-autoflake?expand=0&rev=4
98 lines
2.9 KiB
RPMSpec
98 lines
2.9 KiB
RPMSpec
#
|
|
# spec file for package python-autoflake
|
|
#
|
|
# Copyright (c) 2018 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 https://bugs.opensuse.org/
|
|
#
|
|
|
|
|
|
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
|
|
%bcond_without test
|
|
Name: python-autoflake
|
|
Version: 1.1
|
|
Release: 0
|
|
# for license file
|
|
%define tag 44b07bb9dab60a74cb5da0b67cc78b734763785c
|
|
Summary: Program to removes unused Python imports and variables
|
|
License: MIT
|
|
Group: Development/Languages/Python
|
|
Url: https://github.com/myint/autoflake
|
|
Source: https://files.pythonhosted.org/packages/source/a/autoflake/autoflake-%{version}.tar.gz
|
|
Source10: https://raw.githubusercontent.com/myint/autoflake/%{tag}/LICENSE
|
|
# PATCH-FIX-UPSTREAM fix_standard_paths.patch -- https://github.com/myint/autoflake/issues/32
|
|
Patch0: fix_standard_paths.patch
|
|
BuildRequires: %pythons
|
|
BuildRequires: %{python_module setuptools}
|
|
BuildRequires: fdupes
|
|
BuildRequires: python-rpm-macros
|
|
%if %{with test}
|
|
BuildRequires: %{python_module coverage}
|
|
BuildRequires: %{python_module pyflakes >= 1.1.0}
|
|
%endif
|
|
Requires: python-pyflakes >= 1.1.0
|
|
BuildArch: noarch
|
|
Requires(post): update-alternatives
|
|
Requires(postun): update-alternatives
|
|
|
|
%python_subpackages
|
|
|
|
%description
|
|
Autoflake removes unused imports and unused variables from Python
|
|
code. It makes use of pyflakes to do this.
|
|
|
|
By default, autoflake only removes unused imports for modules that
|
|
are part of the standard library. (Other modules may have side
|
|
effects that make them unsafe to remove automatically.) Removal of
|
|
unused variables is also disabled by default.
|
|
|
|
autoflake also removes useless pass statements.
|
|
|
|
%prep
|
|
%setup -q -n autoflake-%{version}
|
|
cp %{SOURCE10} .
|
|
%patch0 -p1
|
|
sed -i -e '/^#!\//, 1d' autoflake.py
|
|
|
|
%build
|
|
%python_build
|
|
|
|
%install
|
|
%python_install
|
|
|
|
%{python_expand chmod a-x %{buildroot}%{$python_sitelib}/autoflake.py
|
|
%fdupes %{buildroot}%{$python_sitelib}
|
|
}
|
|
|
|
%python_clone -a %{buildroot}%{_bindir}/autoflake
|
|
|
|
%if %{with test}
|
|
%check
|
|
export $LANG=en_US.UTF-8
|
|
%python_exec setup.py test
|
|
%endif
|
|
|
|
%post
|
|
%python_install_alternative autoflake
|
|
|
|
%postun
|
|
%python_uninstall_alternative autoflake
|
|
|
|
%files %{python_files}
|
|
%defattr(-,root,root,-)
|
|
%doc AUTHORS.rst README.rst
|
|
%license LICENSE
|
|
%python_alternative %{_bindir}/autoflake
|
|
%{python_sitelib}/*
|
|
|
|
%changelog
|