14
0
forked from pool/python-pylint

Accepting request 999571 from home:bnavigator:branches:devel:languages:python

- Update to version 2.15.0
  * In pylint 2.15.0, we added a new check missing-timeout to warn
    of default timeout values that could cause a program to be
    hanging indefinitely.
  * We improved pylint's handling of namespace packages. More
    packages should be linted without resorting to using the
    --recursive=y option.
- Release highlights from 2.14
  * With 2.14 pylint only supports Python version 3.7.2 and above.
  * We introduced several new checks among which duplicate-value
    for sets, comparison-of-constants, and checks related to
    lambdas. We removed no-init and made no-self-use optional as
    they were too opinionated. We also added an option to generate
    a toml configuration: --generate-toml-config.
  * We migrated to argparse from optparse and refactored the
    configuration handling thanks to Daniël van Noord. On the user
    side it should change the output of the --help command, and
    some inconsistencies and bugs should disappear. The behavior
    between options set in a config file versus on the command line
    will be more consistent. For us, it will permit to maintain
    this part of the code easily in the future and anticipate
    optparse's removal in Python 3.12.
  * As a result of the refactor there are a lot of internal
    deprecations. If you're a library maintainer that depends on
    pylint, please verify that you're ready for pylint 3.0 by
    activating deprecation warnings.
  * We continued the integration of pylint-error and are now at
    33%!. We still welcome any community effort to help review,
    integrate, and add good/bad examples
    <https://github.com/PyCQA/pylint/issues/5953>`_. This should be
    doable without any pylint or astroid knowledge, so this is the
    perfect entrypoint if you want to contribute to pylint or open
    source without any experience with our code!
- Release highlights from 2.13
  * In 2.13, we introduced a new check to deal with unicode
    security issues. On top of that a lot of work was done inside
    the unicode checker by @CarliJoy. We also introduced a new
    check when importing private name and for unnecessary ellipsis
    among other.
  * We fixed long standing issues related to duplicate code that
    could not be disabled, line numbers that were not accurate some
    of the time, and added the ability to lint all files in a
    directory without specifying each one. One of the most
    anticipated issue from the repository. Thank you @matusvalo !
  * A lot of undefined-variables and used-before-assignment issues
    were resolved thanks to @jacobtylerwalls.
  * We started integrating pylint-error the documentation created
    by @vald-phoenix a developer from Hlyniane, Ukraine. We hope
    he's doing well despite the current situation. The deployment
    is set up but there's still a lot to do so we welcome any
    community effort help to review, integrate, and add good/bad
    examples. This should be doable without any pylint or astroid
    knowledge, so this is the perfect entrypoint if you want to
    contribute to pylint without investing any time learning the
    internals.
  * This release is the last one to support interpreter below
    3.7.2, 3.6 end of life was reached in december 2021.
- Add pylint-pr7367-pythonpathtest.patch
  * gh#PyCQA/pylint#7367

OBS-URL: https://build.opensuse.org/request/show/999571
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pylint?expand=0&rev=129
This commit is contained in:
2022-09-04 08:48:58 +00:00
committed by Git OBS Bridge
parent c205dc705d
commit f63e1b4b88
5 changed files with 163 additions and 34 deletions

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:411308682f3d4578bb769e7fa549c8f34edf1033871d2e8cd5c3ce16a5741c59
size 1032702

3
pylint-2.15.0-gh.tar.gz Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:8613db371f99fdb9ae7c7f851d3115d6824186dc844e9998fe37d38049cd7e27
size 1304038

View File

@@ -0,0 +1,59 @@
diff --git a/tests/testutils/test_testutils_utils.py b/tests/testutils/test_testutils_utils.py
index 79f4e2a81..943a3479e 100644
--- a/tests/testutils/test_testutils_utils.py
+++ b/tests/testutils/test_testutils_utils.py
@@ -6,6 +6,8 @@ import os
import sys
from pathlib import Path
+import pytest
+
from pylint.testutils.utils import _test_cwd, _test_environ_pythonpath, _test_sys_path
@@ -50,22 +52,27 @@ def test__test_cwd(tmp_path: Path) -> None:
assert os.getcwd() == cwd
-def test__test_environ_pythonpath_no_arg() -> None:
- python_path = os.environ.get("PYTHONPATH")
- with _test_environ_pythonpath():
- assert os.environ.get("PYTHONPATH") == python_path
- new_pythonpath = "./whatever/:"
- os.environ["PYTHONPATH"] = new_pythonpath
- assert os.environ.get("PYTHONPATH") == new_pythonpath
- assert os.environ.get("PYTHONPATH") == python_path
-
+@pytest.mark.parametrize("old_pythonpath", ["./oldpath/:", None])
+def test__test_environ_pythonpath_no_arg(old_pythonpath: str) -> None:
+ real_pythonpath = os.environ.get("PYTHONPATH")
+ with _test_environ_pythonpath(old_pythonpath):
+ with _test_environ_pythonpath():
+ assert os.environ.get("PYTHONPATH") is None
+ new_pythonpath = "./whatever/:"
+ os.environ["PYTHONPATH"] = new_pythonpath
+ assert os.environ.get("PYTHONPATH") == new_pythonpath
+ assert os.environ.get("PYTHONPATH") == old_pythonpath
+ assert os.environ.get("PYTHONPATH") == real_pythonpath
-def test__test_environ_pythonpath() -> None:
- python_path = os.environ.get("PYTHONPATH")
- new_pythonpath = "./whatever/:"
- with _test_environ_pythonpath(new_pythonpath):
- assert os.environ.get("PYTHONPATH") == new_pythonpath
- newer_pythonpath = "./something_else/:"
- os.environ["PYTHONPATH"] = newer_pythonpath
- assert os.environ.get("PYTHONPATH") == newer_pythonpath
- assert os.environ.get("PYTHONPATH") == python_path
+@ pytest.mark.parametrize("old_pythonpath", ["./oldpath/:", None])
+def test__test_environ_pythonpath(old_pythonpath: str) -> None:
+ real_pythonpath = os.environ.get("PYTHONPATH")
+ with _test_environ_pythonpath(old_pythonpath):
+ new_pythonpath = "./whatever/:"
+ with _test_environ_pythonpath(new_pythonpath):
+ assert os.environ.get("PYTHONPATH") == new_pythonpath
+ newer_pythonpath = "./something_else/:"
+ os.environ["PYTHONPATH"] = newer_pythonpath
+ assert os.environ.get("PYTHONPATH") == newer_pythonpath
+ assert os.environ.get("PYTHONPATH") == old_pythonpath
+ assert os.environ.get("PYTHONPATH") == real_pythonpath

View File

@@ -1,3 +1,66 @@
-------------------------------------------------------------------
Sat Aug 27 10:01:43 UTC 2022 - Ben Greiner <code@bnavigator.de>
- Update to version 2.15.0
* In pylint 2.15.0, we added a new check missing-timeout to warn
of default timeout values that could cause a program to be
hanging indefinitely.
* We improved pylint's handling of namespace packages. More
packages should be linted without resorting to using the
--recursive=y option.
- Release highlights from 2.14
* With 2.14 pylint only supports Python version 3.7.2 and above.
* We introduced several new checks among which duplicate-value
for sets, comparison-of-constants, and checks related to
lambdas. We removed no-init and made no-self-use optional as
they were too opinionated. We also added an option to generate
a toml configuration: --generate-toml-config.
* We migrated to argparse from optparse and refactored the
configuration handling thanks to Daniël van Noord. On the user
side it should change the output of the --help command, and
some inconsistencies and bugs should disappear. The behavior
between options set in a config file versus on the command line
will be more consistent. For us, it will permit to maintain
this part of the code easily in the future and anticipate
optparse's removal in Python 3.12.
* As a result of the refactor there are a lot of internal
deprecations. If you're a library maintainer that depends on
pylint, please verify that you're ready for pylint 3.0 by
activating deprecation warnings.
* We continued the integration of pylint-error and are now at
33%!. We still welcome any community effort to help review,
integrate, and add good/bad examples
<https://github.com/PyCQA/pylint/issues/5953>`_. This should be
doable without any pylint or astroid knowledge, so this is the
perfect entrypoint if you want to contribute to pylint or open
source without any experience with our code!
- Release highlights from 2.13
* In 2.13, we introduced a new check to deal with unicode
security issues. On top of that a lot of work was done inside
the unicode checker by @CarliJoy. We also introduced a new
check when importing private name and for unnecessary ellipsis
among other.
* We fixed long standing issues related to duplicate code that
could not be disabled, line numbers that were not accurate some
of the time, and added the ability to lint all files in a
directory without specifying each one. One of the most
anticipated issue from the repository. Thank you @matusvalo !
* A lot of undefined-variables and used-before-assignment issues
were resolved thanks to @jacobtylerwalls.
* We started integrating pylint-error the documentation created
by @vald-phoenix a developer from Hlyniane, Ukraine. We hope
he's doing well despite the current situation. The deployment
is set up but there's still a lot to do so we welcome any
community effort help to review, integrate, and add good/bad
examples. This should be doable without any pylint or astroid
knowledge, so this is the perfect entrypoint if you want to
contribute to pylint without investing any time learning the
internals.
* This release is the last one to support interpreter below
3.7.2, 3.6 end of life was reached in december 2021.
- Add pylint-pr7367-pythonpathtest.patch
* gh#PyCQA/pylint#7367
------------------------------------------------------------------- -------------------------------------------------------------------
Sat Dec 11 14:54:24 UTC 2021 - Ben Greiner <code@bnavigator.de> Sat Dec 11 14:54:24 UTC 2021 - Ben Greiner <code@bnavigator.de>

View File

@@ -1,7 +1,7 @@
# #
# spec file for package python-pylint # spec file for package python-pylint
# #
# Copyright (c) 2021 SUSE LLC # Copyright (c) 2022 SUSE LLC
# #
# All modifications and additions to the file contributed by third parties # All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed # remain the property of their copyright owners, unless otherwise agreed
@@ -16,11 +16,9 @@
# #
%{?!python_module:%define python_module() python3-%{**}}
%bcond_without tests %bcond_without tests
%define skip_python2 1
Name: python-pylint Name: python-pylint
Version: 2.12.2 Version: 2.15.0
Release: 0 Release: 0
Summary: Syntax and style checker for Python code Summary: Syntax and style checker for Python code
License: GPL-2.0-or-later License: GPL-2.0-or-later
@@ -28,28 +26,46 @@ Group: Development/Languages/Python
URL: https://github.com/pycqa/pylint URL: https://github.com/pycqa/pylint
# Tests are no longer packaged in the PyPI sdist, use GitHub archive # 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 Source: https://github.com/PyCQA/pylint/archive/refs/tags/v%{version}.tar.gz#/pylint-%{version}-gh.tar.gz
# PATCH-FIX-UPSTREAM gh#PyCQA/pylint#7367
Patch0: pylint-pr7367-pythonpathtest.patch
BuildRequires: %{python_module base >= 3.7.2}
BuildRequires: %{python_module pip}
BuildRequires: %{python_module setuptools} BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module wheel}
BuildRequires: fdupes BuildRequires: fdupes
BuildRequires: python-rpm-macros BuildRequires: python-rpm-macros
Requires: python-astroid >= 2.9 Requires: python-dill >= 0.2
Requires: python-isort >= 4.2.5
Requires: python-mccabe >= 0.6
Requires: python-platformdirs >= 2.2 Requires: python-platformdirs >= 2.2
Requires: python-toml >= 0.9.2 Requires: python-tomlkit >= 0.10.1
Requires: (python-astroid >= 2.12.4 with python-astroid < 2.14.0~dev0)
Requires: (python-isort >= 4.2.5 with python-isort < 6)
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 %if 0%{?python_version_nodots} < 310
Requires: python-typing-extensions >= 3.10 Requires: python-typing-extensions >= 3.10
%endif %endif
%if %{with tests} %if %{with tests}
BuildRequires: %{python_module GitPython > 3} # SECTION pylint deps
BuildRequires: %{python_module astroid >= 2.9} BuildRequires: %{python_module astroid >= 2.12.4 with %python-astroid < 2.14.0~dev0}
BuildRequires: %{python_module isort >= 4.2.5} BuildRequires: %{python_module dill >= 0.2}
BuildRequires: %{python_module mccabe >= 0.6} BuildRequires: %{python_module isort >= 4.2.5 with %python-isort < 6}
BuildRequires: %{python_module mccabe >= 0.6 with %python-mccabe < 0.8}
BuildRequires: %{python_module platformdirs >= 2.2} 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}
# typing-extensions for python310 required for tests only, same as gh#PyCQA/astroid#1585
BuildRequires: %{python_module typing-extensions >= 3.10}
# /SECTION
# SECTION test deps
BuildRequires: %{python_module GitPython > 3}
BuildRequires: %{python_module pytest-benchmark} BuildRequires: %{python_module pytest-benchmark}
BuildRequires: %{python_module pytest-timeout}
BuildRequires: %{python_module pytest-xdist} BuildRequires: %{python_module pytest-xdist}
BuildRequires: %{python_module pytest} BuildRequires: %{python_module pytest}
BuildRequires: %{python_module toml >= 0.9.2} BuildRequires: %{python_module requests}
BuildRequires: %{python_module typing-extensions >= 3.10 if %python-base < 3.10} # /SECTION
%endif %endif
Requires(post): update-alternatives Requires(post): update-alternatives
Requires(postun):update-alternatives Requires(postun):update-alternatives
@@ -75,17 +91,15 @@ feature.
%prep %prep
%autosetup -p1 -n pylint-%{version} %autosetup -p1 -n pylint-%{version}
sed -i '1{/^#!/ d}' pylint/__main__.py sed -i '1{/^#!/ d}' pylint/__main__.py
# unpin upper bounds for astroid and mccabe
sed -i -e 's/\(mccabe>=.*\),<.*/\1/' -e 's/\(astroid>=.*\),<.*/\1/' setup.cfg
%build %build
export LC_ALL="en_US.UTF-8" export LC_ALL="en_US.UTF-8"
%python_build %pyproject_wheel
%install %install
export LC_ALL="en_US.UTF-8" export LC_ALL="en_US.UTF-8"
%python_install %pyproject_install
for p in pylint epylint pyreverse symilar ; do for p in pylint epylint pyreverse symilar pylint-config ; do
%python_clone -a %{buildroot}%{_bindir}/$p %python_clone -a %{buildroot}%{_bindir}/$p
done done
%python_expand %fdupes %{buildroot}%{$python_sitelib} %python_expand %fdupes %{buildroot}%{$python_sitelib}
@@ -93,32 +107,25 @@ done
%if %{with tests} %if %{with tests}
%check %check
export LC_ALL="en_US.UTF-8" export LC_ALL="en_US.UTF-8"
# The test suite tampers with the PYTHONPATH, e.g. upstreams fix for %pytest --benchmark-disable
# 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
%pytest --benchmark-disable --ignore tests/test_epylint.py
# 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 %endif
%post %post
%python_install_alternative pylint epylint pyreverse symilar %python_install_alternative pylint epylint pyreverse symilar pylint-config
%postun %postun
%python_uninstall_alternative pylint %python_uninstall_alternative pylint
%files %{python_files} %files %{python_files}
%license LICENSE %license LICENSE
%doc ChangeLog README.rst %doc README.rst
%doc examples/ %doc examples/
%python_alternative %{_bindir}/pylint %python_alternative %{_bindir}/pylint
%python_alternative %{_bindir}/pylint-config
%python_alternative %{_bindir}/epylint %python_alternative %{_bindir}/epylint
%python_alternative %{_bindir}/pyreverse %python_alternative %{_bindir}/pyreverse
%python_alternative %{_bindir}/symilar %python_alternative %{_bindir}/symilar
%{python_sitelib}/pylint/ %{python_sitelib}/pylint/
%{python_sitelib}/pylint-%{version}-py*.egg-info %{python_sitelib}/pylint-%{version}*-info
%changelog %changelog