2009-09-09 16:57:28 +00:00
|
|
|
#
|
2014-02-24 02:22:25 +00:00
|
|
|
# spec file for package python-pylint
|
2009-09-09 16:57:28 +00:00
|
|
|
#
|
2020-03-18 19:38:24 +00:00
|
|
|
# Copyright (c) 2020 SUSE LLC
|
2009-09-09 16:57:28 +00:00
|
|
|
#
|
|
|
|
# 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.
|
|
|
|
|
2018-09-18 10:12:19 +00:00
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
2009-09-09 16:57:28 +00:00
|
|
|
#
|
|
|
|
|
|
|
|
|
2019-01-02 13:20:31 +00:00
|
|
|
%{?!python_module:%define python_module() python3-%{**}}
|
2020-05-19 08:55:26 +00:00
|
|
|
%bcond_without tests
|
2018-09-18 10:12:19 +00:00
|
|
|
%define skip_python2 1
|
2016-01-13 10:21:11 +00:00
|
|
|
Name: python-pylint
|
2020-06-09 06:47:59 +00:00
|
|
|
Version: 2.5.3
|
2014-02-24 02:22:25 +00:00
|
|
|
Release: 0
|
2009-09-09 16:57:28 +00:00
|
|
|
Summary: Syntax and style checker for Python code
|
2018-07-16 12:50:03 +00:00
|
|
|
License: GPL-2.0-or-later
|
2009-09-09 16:57:28 +00:00
|
|
|
Group: Development/Languages/Python
|
2018-07-16 12:50:03 +00:00
|
|
|
URL: https://github.com/pycqa/pylint
|
2020-05-19 08:55:26 +00:00
|
|
|
Source: https://files.pythonhosted.org/packages/source/p/pylint/pylint-%{version}.tar.gz
|
2020-07-13 22:42:29 +00:00
|
|
|
# PATCH-FIX-UPSTREAM both_isort_4_5.patch gh#PyCQA/pylint#3725 mcepl@suse.com
|
|
|
|
# allow using both isort 4 and 5
|
|
|
|
Patch0: both_isort_4_5.patch
|
2020-05-19 08:55:26 +00:00
|
|
|
BuildRequires: %{python_module setuptools}
|
2017-03-15 15:33:32 +00:00
|
|
|
BuildRequires: fdupes
|
2018-01-24 13:02:51 +00:00
|
|
|
BuildRequires: python-rpm-macros
|
2020-05-19 08:55:26 +00:00
|
|
|
Requires: python-astroid >= 2.4.0
|
2018-01-24 13:02:51 +00:00
|
|
|
Requires: python-editdistance
|
|
|
|
Requires: python-isort >= 4.2.5
|
2019-03-06 13:16:33 +00:00
|
|
|
Requires: python-mccabe >= 0.6
|
2020-05-19 08:55:26 +00:00
|
|
|
Requires: python-toml >= 0.7.1
|
|
|
|
%if %{with tests}
|
|
|
|
BuildRequires: %{python_module astroid >= 2.4.0}
|
|
|
|
BuildRequires: %{python_module editdistance}
|
|
|
|
BuildRequires: %{python_module isort >= 4.2.5}
|
|
|
|
BuildRequires: %{python_module mccabe >= 0.6}
|
|
|
|
BuildRequires: %{python_module pytest-benchmark}
|
|
|
|
BuildRequires: %{python_module pytest-runner}
|
|
|
|
BuildRequires: %{python_module pytest-xdist}
|
|
|
|
BuildRequires: %{python_module pytest}
|
|
|
|
BuildRequires: %{python_module toml >= 0.7.1}
|
|
|
|
%endif
|
2018-01-24 13:02:51 +00:00
|
|
|
Requires(post): update-alternatives
|
|
|
|
Requires(postun): update-alternatives
|
|
|
|
BuildArch: noarch
|
2017-03-15 15:33:32 +00:00
|
|
|
%python_subpackages
|
2009-09-09 16:57:28 +00:00
|
|
|
|
|
|
|
%description
|
|
|
|
Pylint analyzes Python source code looking for bugs and signs of poor
|
|
|
|
quality.
|
|
|
|
|
2014-02-24 02:22:25 +00:00
|
|
|
Pylint is a python tool that checks if a module satisfies a coding
|
2009-09-09 16:57:28 +00:00
|
|
|
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
|
2020-05-19 08:55:26 +00:00
|
|
|
%setup -q -n pylint-%{version}
|
2020-07-13 22:42:29 +00:00
|
|
|
%autopatch -p1
|
|
|
|
|
2020-05-19 08:55:26 +00:00
|
|
|
# fix test: ignore unexpected message gh#PyCQA/pylint#3635
|
|
|
|
sed -i 's/import matplotlib.pyplot as plt/& # pylint: disable=no-name-in-module/' tests/functional/u/undefined_variable.py
|
2009-09-09 16:57:28 +00:00
|
|
|
|
|
|
|
%build
|
2020-03-18 19:38:24 +00:00
|
|
|
export LC_ALL="en_US.UTF-8"
|
2017-03-15 15:33:32 +00:00
|
|
|
%python_build
|
2009-09-09 16:57:28 +00:00
|
|
|
|
|
|
|
%install
|
2020-03-18 19:38:24 +00:00
|
|
|
export LC_ALL="en_US.UTF-8"
|
2017-03-15 15:33:32 +00:00
|
|
|
%python_install
|
|
|
|
for p in pylint epylint pyreverse symilar ; do
|
|
|
|
%python_clone -a %{buildroot}%{_bindir}/$p
|
2016-01-13 10:21:11 +00:00
|
|
|
done
|
2014-02-24 02:22:25 +00:00
|
|
|
|
2018-12-06 14:35:47 +00:00
|
|
|
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
2017-03-15 15:33:32 +00:00
|
|
|
|
2014-02-24 02:22:25 +00:00
|
|
|
%post
|
2017-03-15 15:33:32 +00:00
|
|
|
%python_install_alternative pylint epylint pyreverse symilar
|
|
|
|
|
2017-03-29 14:03:31 +00:00
|
|
|
%postun
|
2017-03-15 15:33:32 +00:00
|
|
|
%python_uninstall_alternative pylint
|
|
|
|
|
2020-05-19 08:55:26 +00:00
|
|
|
%if %{with tests}
|
2017-03-15 15:33:32 +00:00
|
|
|
%check
|
2020-03-18 19:38:24 +00:00
|
|
|
export LC_ALL="en_US.UTF-8"
|
2020-06-23 16:45:24 +00:00
|
|
|
# this tests needs the local source dir for imports,
|
|
|
|
# gh#openSUSE/python-rpm-macros#48
|
|
|
|
export PYTHONPATH=$(pwd)
|
|
|
|
%pytest -k test_version
|
|
|
|
# others must not import from local source dir
|
|
|
|
# gh#PyCQA/pylint#3636
|
|
|
|
export PYTHONPATH=""
|
|
|
|
%pytest -k "not test_version" --benchmark-disable
|
2020-05-19 08:55:26 +00:00
|
|
|
%endif
|
2017-03-15 15:33:32 +00:00
|
|
|
|
|
|
|
%files %{python_files}
|
2018-07-16 12:50:03 +00:00
|
|
|
%license COPYING
|
|
|
|
%doc ChangeLog README.rst
|
2016-01-13 10:21:11 +00:00
|
|
|
%doc examples/
|
2017-03-15 15:33:32 +00:00
|
|
|
%python_alternative %{_bindir}/pylint
|
|
|
|
%python_alternative %{_bindir}/epylint
|
|
|
|
%python_alternative %{_bindir}/pyreverse
|
|
|
|
%python_alternative %{_bindir}/symilar
|
2016-01-13 10:21:11 +00:00
|
|
|
%{python_sitelib}/pylint/
|
2018-01-24 13:02:51 +00:00
|
|
|
%{python_sitelib}/pylint-%{version}-py*.egg-info
|
2009-09-09 16:57:28 +00:00
|
|
|
|
|
|
|
%changelog
|