forked from pool/python-pylint
- Update to 2.9.6 * Fix a false positive undefined-variable when variable name in decoration matches function argument - Many more release notes from 2.9.0 to 2.9.5: * https://github.com/PyCQA/pylint/releases * Added time.clock to deprecated functions/methods for python 3.3 * No longer emit consider-using-with for ThreadPoolExecutor and ProcessPoolExecutor as they have legitimate use cases without a with block. * The similarity checker no longer add three trailing whitespaces for empty lines in its report. * Python 3.10 is now supported. * Added various deprecated functions/methods for python 3.10, 3.7, 3.6 and 3.3 * setuptools_scm has been removed and replaced by tbump in order to not have hidden runtime dependencies to setuptools - Drop pylint-pr4450-import-init.patch - Add pylint-pr4816-astroid27.patch * gh#PyCQA/pylint#4816 * remove astroid upper bound -- the previous pin broke a lot of packages through the pkg_resources check OBS-URL: https://build.opensuse.org/request/show/913328 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pylint?expand=0&rev=126
121 lines
4.3 KiB
RPMSpec
121 lines
4.3 KiB
RPMSpec
#
|
|
# spec file for package python-pylint
|
|
#
|
|
# Copyright (c) 2021 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/
|
|
#
|
|
|
|
|
|
%{?!python_module:%define python_module() python3-%{**}}
|
|
%bcond_without tests
|
|
%define skip_python2 1
|
|
Name: python-pylint
|
|
Version: 2.9.6
|
|
Release: 0
|
|
Summary: Syntax and style checker for Python code
|
|
License: GPL-2.0-or-later
|
|
Group: Development/Languages/Python
|
|
URL: https://github.com/pycqa/pylint
|
|
# Tests are no longer packaged in the PyPI sdist, use GitHub archive
|
|
Source: https://github.com/PyCQA/pylint/archive/refs/tags/v%{version}.tar.gz#/pylint-%{version}-gh.tar.gz
|
|
# PATCH-FIX-UPSTREAM pylint-pr4816-astroid27.patch - gh#PyCQA/pylint#4816 + removed upper bound
|
|
Patch0: pylint-pr4816-astroid27.patch
|
|
BuildRequires: %{python_module setuptools}
|
|
BuildRequires: fdupes
|
|
BuildRequires: python-rpm-macros
|
|
Requires: python-astroid >= 2.7
|
|
Requires: python-isort >= 4.2.5
|
|
Requires: python-mccabe >= 0.6
|
|
Requires: python-toml >= 0.7.1
|
|
%if %{with tests}
|
|
BuildRequires: %{python_module astroid >= 2.7}
|
|
BuildRequires: %{python_module isort >= 4.2.5}
|
|
BuildRequires: %{python_module mccabe >= 0.6}
|
|
BuildRequires: %{python_module pytest-benchmark}
|
|
BuildRequires: %{python_module pytest-xdist}
|
|
BuildRequires: %{python_module pytest}
|
|
BuildRequires: %{python_module toml >= 0.7.1}
|
|
%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"
|
|
%python_build
|
|
|
|
%install
|
|
export LC_ALL="en_US.UTF-8"
|
|
%python_install
|
|
for p in pylint epylint pyreverse symilar ; 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"
|
|
# The test suite tampers with the PYTHONPATH, e.g. upstreams fix for
|
|
# https://github.com/PyCQA/pylint/issues/3636
|
|
# so make sure that the macro set PYTHONPATH does not result in conflicting imports
|
|
mv pylint pylint.tmp
|
|
# numpy inference in python39 and python38 broken -- https://github.com/PyCQA/pylint/issues/4877
|
|
python39_donttest=("-k" "not (test_functional and (len_checks or nan_comparison_check))")
|
|
python38_donttest=("${python39_donttest[@]}")
|
|
%pytest --benchmark-disable --ignore tests/test_epylint.py "${$python_donttest[@]}"
|
|
# result of the mentioned tampering: other tests must not have pwd in PYTHONPATH, but test_epylint needs it
|
|
export PYTHONPATH=$PWD
|
|
%pytest --benchmark-disable tests/test_epylint.py
|
|
mv pylint.tmp pylint
|
|
%endif
|
|
|
|
%post
|
|
%python_install_alternative pylint epylint pyreverse symilar
|
|
|
|
%postun
|
|
%python_uninstall_alternative pylint
|
|
|
|
%files %{python_files}
|
|
%license LICENSE
|
|
%doc ChangeLog README.rst
|
|
%doc examples/
|
|
%python_alternative %{_bindir}/pylint
|
|
%python_alternative %{_bindir}/epylint
|
|
%python_alternative %{_bindir}/pyreverse
|
|
%python_alternative %{_bindir}/symilar
|
|
%{python_sitelib}/pylint/
|
|
%{python_sitelib}/pylint-%{version}-py*.egg-info
|
|
|
|
%changelog
|