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

90 lines
2.6 KiB
RPMSpec
Raw Permalink Normal View History

#
# spec file for package python-vulture
#
# Copyright (c) 2025 SUSE LLC
#
# 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/
#
%{?sle15_python_module_pythons}
Name: python-vulture
Version: 2.13
Release: 0
Summary: Python module for finding dead code
License: MIT
URL: https://github.com/jendrikseipp/vulture
Source: https://files.pythonhosted.org/packages/source/v/vulture/vulture-%{version}.tar.gz
BuildRequires: %{python_module pip}
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module wheel}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
Requires(post): update-alternatives
Requires(postun): update-alternatives
BuildArch: noarch
# SECTION test requirements
BuildRequires: %{python_module pytest > 3.2.3}
- update to 2.10: * Drop support for Python 3.7 (Jendrik Seipp, #323). * Add support for Python 3.12 (Jendrik Seipp, #332). * Use `end_lineno` AST attribute to obtain more accurate line counts (Jendrik Seipp). * Use exit code 0 for `--help` and `--version` again (Jendrik Seipp, #321). * Use exit code 3 when dead code is found (whosayn, #319). * Treat non-supported decorator names as "@" instead of crashing (Llandy3d and Jendrik Seipp, #284). * Drop support for Python 3.6 (Jendrik Seipp). * Add `UnicodeEncodeError` exception handling to `core.py` * Add whitelist for `Enum` attributes `_name_` and `_value_` * Run tests and add PyPI trove for Python 3.11 (Jendrik Seipp). * Ignore `setup_module()`, `teardown_module()`, etc. in pytest `test_*.py` files (Jendrik Seipp). * Add whitelist for `socketserver.TCPServer.allow_reuse_address` (Ben Elliston). * Clarify that `--exclude` patterns are matched against absolute paths (Jendrik Seipp, #260). * Add basic `match` statement support (kreathon, #276, #291). * Mark imports in `__all__` as used (kreathon, #172, #282). * Add whitelist for `pint.UnitRegistry.default_formatter` (Ben Elliston, #258). * Print absolute filepaths as relative again (as in version 2.1 and before) * if they are below the current directory (The-Compiler, #246). * Run tests and add PyPI trove for Python 3.10 (chayim, #266). * Allow using the `del` keyword to mark unused variables (sshishov, #279). OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-vulture?expand=0&rev=22
2023-12-27 16:54:52 +00:00
BuildRequires: %{python_module Pint}
# /SECTION
%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' vulture/core.py
%build
%pyproject_wheel
%install
%pyproject_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%python_clone -a %{buildroot}%{_bindir}/vulture
%check
rm setup.cfg
%pytest
%post
%python_install_alternative vulture
%postun
%python_uninstall_alternative vulture
%files %{python_files}
%doc CHANGELOG.md README.md
%license LICENSE.txt
%python_alternative %{_bindir}/vulture
%{python_sitelib}/vulture
%{python_sitelib}/vulture-%{version}.dist-info
%changelog