15
0
Files
python-vulture/python-vulture.spec

90 lines
2.6 KiB
RPMSpec
Raw Normal View History

#
# spec file for package python-vulture
#
# 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 http://bugs.opensuse.org/
#
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-vulture
Version: 0.29
Release: 0
Summary: Python module for finding dead code
License: MIT
Group: Development/Languages/Python
Url: https://github.com/jendrikseipp/vulture
Source: https://files.pythonhosted.org/packages/source/v/vulture/vulture-%{version}.tar.gz
BuildRequires: %{python_module devel}
BuildRequires: %{python_module setuptools}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
# SECTION test requirements
BuildRequires: %{python_module pytest-cov}
BuildRequires: %{python_module pytest}
# /SECTION
BuildArch: noarch
Requires(post): update-alternatives
Requires(postun): update-alternatives
%python_subpackages
%description
Vulture finds unused code in Python programs. This is useful for
cleaning up and finding errors in code bases. Running Vulture
on both the library and test suite, untested code can be found.
Due to Python's dynamic nature, static code analyzers like Vulture are
likely to miss some dead code. Also, code that is only called implicitly
may be reported as unused.
Features:
* static code analysis
* only one module
* tests itself and has complete test coverage
* complements pyflakes and has the same output syntax
* sorts unused classes and functions by size with ``--sort-by-size``
* supports Python 2.6, 2.7 and 3.x
%prep
%setup -q -n vulture-%{version}
sed -i -e '/^#! \//, 1d' *.py vulture/core.py
%build
%python_build
%install
%python_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%python_clone -a %{buildroot}%{_bindir}/vulture
%check
%python_exec setup.py test
%post
%python_install_alternative vulture
%postun
%python_uninstall_alternative vulture
%files %{python_files}
%doc NEWS.rst README.rst
%license LICENSE.txt
%python_alternative %{_bindir}/vulture
%{python_sitelib}/*
%changelog