14
0
forked from pool/python-pylint
Files
python-pylint/python-pylint.spec
Steve Kowalik 75c13e2f7b - Update to 3.3.6:
* Fix a false positive for used-before-assignment when an inner function's
    return type * annotation is a class defined at module scope.
  * Fix false positives for use-implicit-booleaness-not-comparison,
    use-implicit-booleaness-not-comparison-to-string and
    use-implicit-booleaness-not-comparison-to-zero when chained comparisons
    are checked.
  * Fix a false positive for invalid-getnewargs-ex-returned when the tuple or
    dict has been assigned to a name.
  * Remove getopt and optparse from the list of deprecated modules.
  * Fixed conditional import x.y causing false positive
    possibly-used-before-assignment.
  * Fix a crash when something besides a class is found in an except handler.
  * Fixed raising invalid-name when using camelCase for private methods with
    two leading underscores.
  * Fixes "skipped files" count calculation; the previous method was
    displaying an arbitrary number.
  * Fixes a crash that occurred when pylint was run in a container on a host
    with cgroupsv2 and restrictions on CPU usage.
  * Relaxed the requirements for isort so pylint can benefit from isort 6.
  * Fix false positives for undefined-variable for classes using Python 3.12
    generic type syntax.
  * Fix a false positive for use-implicit-booleaness-not-len. No lint should
    be emitted for generators (len is not defined for generators).
  * Fix Unable to import 'collections.abc' (import-error) on Python 3.13.1.
  * Fix a false positive for potential-index-error when an indexed iterable
    contains a starred element that evaluates to more than one item.
  * Fixes the issue with --source-root option not working when the source
    files are in a subdirectory of the source root (e.g. when using a /src
    layout).

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pylint?expand=0&rev=169
2025-04-08 03:29:42 +00:00

137 lines
4.8 KiB
RPMSpec

#
# spec file for package python-pylint
#
# 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/
#
%bcond_without tests
%{?sle15_python_module_pythons}
Name: python-pylint
Version: 3.3.6
Release: 0
Summary: Syntax and style checker for Python code
License: GPL-2.0-or-later
URL: https://github.com/pylint-dev/pylint
# Tests are no longer packaged in the PyPI sdist, use GitHub archive
Source: https://github.com/pylint-dev/pylint/archive/refs/tags/v%{version}.tar.gz#/pylint-%{version}-gh.tar.gz
BuildRequires: %{python_module base >= 3.7.2}
BuildRequires: %{python_module pip}
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module wheel}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
Requires: python-dill >= 0.3.7
Requires: python-platformdirs >= 2.2
Requires: python-tomlkit >= 0.10.1
Requires: (python-astroid >= 3.3.8 with python-astroid < 4.0.0~dev0)
Requires: (python-isort >= 4.2.5 with python-isort < 7)
Requires: (python-mccabe >= 0.6 with python-mccabe < 0.8)
%if 0%{?python_version_nodots} < 311
Requires: python-tomli >= 1.1.0
%endif
%if 0%{?python_version_nodots} < 310
Requires: python-typing-extensions >= 3.10
%endif
%if %{with tests}
# SECTION pylint deps
BuildRequires: %{python_module astroid >= 3.3.8 with %python-astroid < 4.0.0~dev0}
BuildRequires: %{python_module dill >= 0.3.7}
BuildRequires: %{python_module enchant}
BuildRequires: %{python_module isort >= 4.2.5 with %python-isort < 7}
BuildRequires: %{python_module mccabe >= 0.6 with %python-mccabe < 0.8}
BuildRequires: %{python_module platformdirs >= 2.2}
BuildRequires: %{python_module tomli >= 1.1.0 if %python-base < 3.11}
BuildRequires: %{python_module tomlkit >= 0.10.1}
BuildRequires: %{python_module typing-extensions >= 3.10 if %python-base < 3.10}
# /SECTION
# SECTION test deps
BuildRequires: %{python_module GitPython > 3}
BuildRequires: %{python_module pytest-rerunfailures}
BuildRequires: %{python_module pytest-timeout >= 2.2}
BuildRequires: %{python_module pytest-xdist}
BuildRequires: %{python_module pytest}
BuildRequires: %{python_module requests}
# /SECTION
%endif
Requires(post): update-alternatives
Requires(postun): update-alternatives
BuildArch: noarch
%python_subpackages
%description
Pylint analyzes Python source code looking for bugs and signs of poor
quality.
Pylint is a python tool that checks if a module satisfies a coding
standard. Pylint can be seen as another PyChecker since nearly all
tests you can do with PyChecker can also be done with Pylint. But
Pylint offers some more features, like checking line-code's length,
checking if variable names are well-formed according to your coding
standard, or checking if declared interfaces are truly implemented, and
much more (see the complete check list).
The big advantage with Pylint is that it is highly configurable,
customizable, and you can easily write a small plugin to add a personal
feature.
%prep
%autosetup -p1 -n pylint-%{version}
sed -i '1{/^#!/ d}' pylint/__main__.py
%build
export LC_ALL="en_US.UTF-8"
%pyproject_wheel
%install
export LC_ALL="en_US.UTF-8"
%pyproject_install
for p in pylint pyreverse symilar pylint-config ; do
%python_clone -a %{buildroot}%{_bindir}/$p
done
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%if %{with tests}
%check
export LC_ALL="en_US.UTF-8"
# reruns: tests/pyreverse is incredibly non-deterministic in failures
donttest="test_linter_with_unpickleable_plugins_is_pickleable"
# Fails with pytest-8 gh#pylint-dev/pylint#9545
donttest+=" or recursion_error_3159"
# Fails with python 3.12
donttest+=" or test_functional_relation_extraction"
# Broken upstream
donttest+=" or test_functional"
%pytest -n auto --ignore tests/benchmark --reruns 5 -rsfER -k "not ($donttest)"
%endif
%post
%python_install_alternative pylint pyreverse symilar pylint-config
%postun
%python_uninstall_alternative pylint
%files %{python_files}
%license LICENSE
%doc README.rst
%doc examples/
%python_alternative %{_bindir}/pylint
%python_alternative %{_bindir}/pylint-config
%python_alternative %{_bindir}/pyreverse
%python_alternative %{_bindir}/symilar
%{python_sitelib}/pylint/
%{python_sitelib}/pylint-%{version}.dist-info
%changelog