Compare commits

...

10 Commits

Author SHA1 Message Date
openeuler-ci-bot
197bb39a9b
!32 fix changelog version
From: @wk333 
Reviewed-by: @caodongxia 
Signed-off-by: @caodongxia
2024-01-09 01:26:58 +00:00
wk333
5b76118fc6 fix changelog version 2024-01-04 11:26:03 +08:00
openeuler-ci-bot
c100849938
!28 Fix "similar -d args" not recognized
From: @wk333 
Reviewed-by: @caodongxia 
Signed-off-by: @caodongxia
2024-01-04 02:57:22 +00:00
wk333
8c999f3383 Fix "similar -d args" not recognized 2024-01-03 16:35:32 +08:00
openeuler-ci-bot
fa81edb1e3 !10 [sync] PR-9: Init with 2.2.2 to support OpenStack Train
From: @openeuler-sync-bot
Reviewed-by: @zhuchunyi
Signed-off-by: @zhuchunyi
2021-11-18 03:43:51 +00:00
huangtianhua
31703ab91b Init with 2.2.2 to support OpenStack Train
(cherry picked from commit c5620bcba6948c1a3d6394abb5a70317e1d16231)
2021-11-12 15:29:36 +08:00
openeuler-ci-bot
6a1bd50508 !4 update pylint package for openstack wallaby
From: @liksh
Reviewed-by: 
Signed-off-by:
2021-08-12 11:09:40 +00:00
liksh
b654543ffd update to 2.6.0 2021-08-11 16:50:34 +08:00
openeuler-ci-bot
93c5f19fa7 !3 Package upgrade
Merge pull request !3 from 成子晗/master
2020-06-28 14:37:20 +08:00
chengzihan2
ae80a2ced0 Package upgrade 2020-06-24 19:59:51 +08:00
5 changed files with 72 additions and 96 deletions

BIN
.pylint.spec_liksh.swp Normal file

Binary file not shown.

Binary file not shown.

BIN
pylint-2.2.2.tar.gz Normal file

Binary file not shown.

View File

@ -1,53 +0,0 @@
diff -Naur pylint-2.1.1/pylint/checkers/utils.py pylint-2.1.1.fixed/pylint/checkers/utils.py
--- pylint-2.1.1/pylint/checkers/utils.py 2018-08-06 14:41:29.000000000 +0200
+++ pylint-2.1.1.fixed/pylint/checkers/utils.py 2018-11-09 18:29:38.845605148 +0100
@@ -1005,7 +1005,7 @@
:returns: True if node_a is derived from node_b. False otherwise.
:rtype: bool
"""
- if not any(isinstance(node, astroid.ClassDef) for node in (node_a, node_b)):
+ if not all(isinstance(node, astroid.ClassDef) for node in (node_a, node_b)):
return False
return node_b.name in {base.name for base in node_a.bases}
diff -Naur pylint-2.1.1/pylint/test/unittest_checkers_utils.py pylint-2.1.1.fixed/pylint/test/unittest_checkers_utils.py
--- pylint-2.1.1/pylint/test/unittest_checkers_utils.py 2018-08-06 14:41:29.000000000 +0200
+++ pylint-2.1.1.fixed/pylint/test/unittest_checkers_utils.py 2018-11-09 18:30:55.653912141 +0100
@@ -102,3 +102,37 @@
assert not utils.node_ignores_exception(nodes[1], ZeroDivisionError)
assert not utils.node_ignores_exception(nodes[2], ZeroDivisionError)
assert not utils.node_ignores_exception(nodes[3], ZeroDivisionError)
+
+
+def test_is_sublcass_of_node_b_derived_from_node_a():
+ nodes = astroid.extract_node("""
+ class Superclass: #@
+ pass
+ class Subclass(Superclass): #@
+ pass
+ """)
+ assert utils.is_subclass_of(nodes[1], nodes[0])
+
+
+def test_is_sublcass_of_node_b_not_derived_from_node_a():
+ nodes = astroid.extract_node("""
+ class OneClass: #@
+ pass
+ class AnotherClass: #@
+ pass
+ """)
+ assert not utils.is_subclass_of(nodes[1], nodes[0])
+
+
+def test_is_sublcass_of_one_param_is_not_classdef():
+ node = astroid.extract_node("""
+ class OneClass: #@
+ pass
+ """)
+ assert not utils.is_subclass_of(None, node)
+ assert not utils.is_subclass_of(node, None)
+
+
+def test_is_sublcass_of_both_params_are_not_classdef():
+ assert not utils.is_subclass_of(None, None)
+

View File

@ -1,47 +1,65 @@
Name: pylint
Version: 2.1.1
Release: 4
Summary: Python static code analysis tool looking for programming errors
Version: 2.2.2
Release: 2
Summary: Analyzes Python code looking for bugs and signs of poor quality
License: GPLv2+
URL: http://pylint.pycqa.org
Source0: https://github.com/PyCQA/%{name}/archive/%{name}-%{version}.tar.gz
Patch0001: pylint-Fix_is_subclass_of_when_one_param_is_not_ClassDef.patch
URL: http://www.pylint.org/
Source0: https://files.pythonhosted.org/packages/92/8e/e86eb8dbc10ee845b1c04ed9eaeafb981331f6db5dc05ba21555fcbe7595/pylint-2.2.2.tar.gz
BuildArch: noarch
BuildRequires: python3-devel python3-setuptools python3-astroid >= 2.0.2 python3-isort
BuildRequires: python3-mccabe python3-pytest python3-pytest-runner
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: python3-toml
# For tests
BuildRequires: python3-astroid
BuildRequires: python3-isort
BuildRequires: python3-mccabe
BuildRequires: python3-pytest
BuildRequires: python3-pytest-runner
# For the main pylint package
Requires: python3-%{name} = %{version}-%{release}
%description
Pylint is a Python static code analysis tool which looks for programming errors,
helps enforcing a coding standard, sniffs for code smells and offers simple refactoring suggestions.
It's highly configurable, having special pragmas to control its errors and warnings from within
your code, as well as from an extensive configuration file. It is also possible to write your own
plugins for adding your own checks or for extending pylint in one way or another.
Pylint is a Python source code analyzer which looks for programming
errors, helps enforcing a coding standard and sniffs for some code
smells (as defined in Martin Fowler's Refactoring book).
Pylint can be seen as another PyChecker since nearly all tests you
can do with PyChecker can also be done with Pylint. However, Pylint
offers some more features, like checking length of lines of code,
checking if variable names are well-formed according to your coding
standard, or checking if declared interfaces are truly implemented,
and much more.
Additionally, it is possible to write plugins to add your own checks.
%package -n python3-%{name}
Summary: Python static code analysis tool looking for programming errors
Requires: python3-astroid >= 2.0.2 python3-setuptools python3-mccabe python3-isort
Summary: %{summary}
Requires: python3-astroid
Requires: python3-setuptools
Requires: python3-mccabe
Requires: python3-isort
Obsoletes: python3-pylint-gui < 1.7
%python_provide python3-%{name}
%{?python_provide:%python_provide python3-%{name}}
%description -n python3-%{name}
Pylint is a Python static code analysis tool which looks for programming errors,
helps enforcing a coding standard, sniffs for code smells and offers simple refactoring suggestions.
It's highly configurable, having special pragmas to control its errors and warnings from within
your code, as well as from an extensive configuration file. It is also possible to write your own
plugins for adding your own checks or for extending pylint in one way or another.
%package help
Summary: Help documentation of pylint package
%description help
Help documentation of pylint package.
Pylint is a Python source code analyzer which looks for programming
errors, helps enforcing a coding standard and sniffs for some code
smells (as defined in Martin Fowler's Refactoring book).
Pylint can be seen as another PyChecker since nearly all tests you
can do with PyChecker can also be done with Pylint. However, Pylint
offers some more features, like checking length of lines of code,
checking if variable names are well-formed according to your coding
standard, or checking if declared interfaces are truly implemented,
and much more.
Additionally, it is possible to write plugins to add your own checks.
%prep
%autosetup -n pylint-pylint-%{version} -p1
%autosetup -n pylint-%{version}
# Convert DOS line endings to Unix
sed -i 's/\r//g' README.rst
# Fix "similar -d args" not recognized
sed -i 's/s_opts = "hdi"/s_opts = "hd:i"/g' pylint/checkers/similar.py
%build
%py3_build
@ -50,9 +68,10 @@ sed -i 's/\r//g' README.rst
%py3_install
rm -rf %{buildroot}%{python3_sitelib}/pylint/test
install -dm 755 %{buildroot}%{_mandir}/man1
mkdir -pm 755 %{buildroot}%{_mandir}/man1
install -pm 644 man/*.1 %{buildroot}%{_mandir}/man1/
# Add -%%{python3_version} to the binaries and manpages for backwards compatibility
for NAME in epylint pylint pyreverse symilar; do
mv %{buildroot}%{_bindir}/{$NAME,${NAME}-%{python3_version}}
ln -s ${NAME}-%{python3_version} %{buildroot}%{_bindir}/${NAME}-3
@ -62,27 +81,37 @@ for NAME in epylint pylint pyreverse symilar; do
ln -s ${NAME}-%{python3_version}.1 %{buildroot}%{_mandir}/man1/${NAME}.1
done
%check
export PYTHONPATH=%{buildroot}%{python3_sitelib}
%{__python3} bin/pylint -rn --rcfile=pylintrc --load-plugins=pylint.extensions.docparams, pylint.extensions.mccabe pylint || :
%{__python3} -m pytest -v -k "not (test_functional or test_good_comprehension_checks)"
# Skip failing tests.
%{__python3} -m pytest -v -k "not (test_baseline_benchmark_j1 or test_baseline_lots_of_files_j1 or test_baseline_lots_of_files_j10 \
or test_baseline_benchmark_check_parallel_j10 or test_by_module_statement_value or import_outside_toplevel)"
%files
%doc README.rst ChangeLog examples elisp COPYING
%{_bindir}/{epylint,pylint,pyreverse,symilar}
%doc README.rst ChangeLog examples elisp
%license COPYING
%{_bindir}/epylint
%{_bindir}/pylint
%{_bindir}/pyreverse
%{_bindir}/symilar
%{_mandir}/man1/epylint.1*
%{_mandir}/man1/pylint.1*
%{_mandir}/man1/pyreverse.1*
%{_mandir}/man1/symilar.1*
%files -n python3-%{name}
%doc COPYING
%license COPYING
%{python3_sitelib}/pylint*
%{_bindir}/{*-3,*-%{python3_version}}
%files help
%{_mandir}/man1/*
# backwards compatible versioned executables and manpages:
%{_bindir}/*-3
%{_bindir}/*-%{python3_version}
%{_mandir}/man1/*-3.1*
%{_mandir}/man1/*-%{python3_version}.1*
%changelog
* Fri Feb 28 2020 daiqianwen <daiqianwen@huawei.com> - 2.1.1-4
- modify spec
* Wed Jan 03 2024 wangkai <13474090681@163.com> - 2.2.2-2
- Fix "similar -d args" not recognized
* Mon Feb 17 2020 daiqianwen <daiqianwen@huawei.com> - 2.1.1-3
- package init
* Tue Nov 09 2021 huangtianhua <huangtianhua@huawei.com> - 2.2.2-1
- package init for OpenStack Train