1
0
forked from pool/python-pylint

18 Commits

Author SHA256 Message Date
a3de6ac720 Accepting request 1318121 from devel:languages:python
- Update to 4.0.3:
  * Add Enum dunder methods _generate_next_value_, _missing_, _numeric_repr_,
    _add_alias_, and _add_value_alias_ to the list passed to
    --good-dunder-names.
  * Fixed false positive for invalid-name with typing.Annotated.
  * Fix false positive for f-string-without-interpolation with template
    strings when using format spec.
  * Fix a false positive when an UPPER_CASED class attribute was raising an
    invalid-name when typed with Final.
  * Fix a false positive for unbalanced-tuple-unpacking when a tuple is
    assigned to a function call and the structure of the function's return
    value is ambiguous.
  * Make 'ignore' option work as expected again.
  * Fix crash for consider-using-assignment-expr when a variable annotation
    without assignment is used as the if test expression.
  * Fix crash for prefer-typing-namedtuple and consider-math-not-float when
    a slice object is called.
  * Fix false positive for invalid-name on a partially uninferable
    module-level constant.
  * Fix a false positive for invalid-name on exclusive module-level
    assignments composed of three or more branches.
  * Fix false positive for invalid-name for TypedDict instances.
  * Fix false-positive for bare-name-capture-pattern if a case guard is used.
  * Check enums created with the Enum() functional syntax to pass against the
    --class-rgx for the  invalid-name check, like other enums.
  * Pylint now supports Python 3.14.
  * Pylint's inference engine (astroid) is now much more precise,
    understanding implicit booleanness and ternary expressions. The required
    astroid version is now 4.0.0.
  * Handling of invalid-name at the module level was patchy. Now,

OBS-URL: https://build.opensuse.org/request/show/1318121
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-pylint?expand=0&rev=51
2025-11-18 14:33:38 +00:00
e86f27dafe - Update to 4.0.3:
* Add Enum dunder methods _generate_next_value_, _missing_, _numeric_repr_,
    _add_alias_, and _add_value_alias_ to the list passed to
    --good-dunder-names.
  * Fixed false positive for invalid-name with typing.Annotated.
  * Fix false positive for f-string-without-interpolation with template
    strings when using format spec.
  * Fix a false positive when an UPPER_CASED class attribute was raising an
    invalid-name when typed with Final.
  * Fix a false positive for unbalanced-tuple-unpacking when a tuple is
    assigned to a function call and the structure of the function's return
    value is ambiguous.
  * Make 'ignore' option work as expected again.
  * Fix crash for consider-using-assignment-expr when a variable annotation
    without assignment is used as the if test expression.
  * Fix crash for prefer-typing-namedtuple and consider-math-not-float when
    a slice object is called.
  * Fix false positive for invalid-name on a partially uninferable
    module-level constant.
  * Fix a false positive for invalid-name on exclusive module-level
    assignments composed of three or more branches.
  * Fix false positive for invalid-name for TypedDict instances.
  * Fix false-positive for bare-name-capture-pattern if a case guard is used.
  * Check enums created with the Enum() functional syntax to pass against the
    --class-rgx for the  invalid-name check, like other enums.
  * Pylint now supports Python 3.14.
  * Pylint's inference engine (astroid) is now much more precise,
    understanding implicit booleanness and ternary expressions. The required
    astroid version is now 4.0.0.
  * Handling of invalid-name at the module level was patchy. Now,

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pylint?expand=0&rev=179
2025-11-17 04:34:22 +00:00
dd5c9f277c Accepting request 1304654 from devel:languages:python
- update to 3.3.8:
  * Fix false positives for `possibly-used-before-assignment`
    when variables are exhaustively assigned within a `match` block.
  * Fix false positive for `missing-raises-doc` and `missing-
    yield-doc` when the method length is less than docstring-min-
    length.
  * Fix a false positive for ``unused-variable`` when multiple
    except handlers bind the same name under a try block.
  * Fix false-negative for ``used-before-assignment`` with ``from
    __future__ import annotations`` in function definitions.
  * Fix a bug in Pyreverse where aggregations and associations
    were included in diagrams regardless of the selected
    --filter-mode (such as PUB_ONLY, ALL, etc.).
  * Fix double underscores erroneously rendering as bold in
    pyreverse's Mermaid output.

OBS-URL: https://build.opensuse.org/request/show/1304654
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-pylint?expand=0&rev=50
2025-09-15 17:52:06 +00:00
47142cb9a1 - update to 3.3.8:
* Fix false positives for `possibly-used-before-assignment`
    when variables are exhaustively assigned within a `match` block.
  * Fix false positive for `missing-raises-doc` and `missing-
    yield-doc` when the method length is less than docstring-min-
    length.
  * Fix a false positive for ``unused-variable`` when multiple
    except handlers bind the same name under a try block.
  * Fix false-negative for ``used-before-assignment`` with ``from
    __future__ import annotations`` in function definitions.
  * Fix a bug in Pyreverse where aggregations and associations
    were included in diagrams regardless of the selected
    --filter-mode (such as PUB_ONLY, ALL, etc.).
  * Fix double underscores erroneously rendering as bold in
    pyreverse's Mermaid output.

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pylint?expand=0&rev=177
2025-09-14 18:18:33 +00:00
81c1d0998d Accepting request 1302173 from devel:languages:python
Automatic submission by obs-autosubmit

OBS-URL: https://build.opensuse.org/request/show/1302173
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-pylint?expand=0&rev=49
2025-09-01 15:18:30 +00:00
b9f15d3b52 - Convert to libalternatives on SLE-16-based and newer systems
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pylint?expand=0&rev=175
2025-08-25 09:57:18 +00:00
7bda9832a3 Accepting request 1285157 from devel:languages:python
Fix .changes file, osc service runall source_validator

OBS-URL: https://build.opensuse.org/request/show/1285157
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-pylint?expand=0&rev=48
2025-06-12 14:47:00 +00:00
68125fbbf2 Fix .changes file, osc service runall source_validator
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pylint?expand=0&rev=173
2025-06-12 12:41:56 +00:00
e09e013026 Accepting request 1277673 from devel:languages:python
OBS-URL: https://build.opensuse.org/request/show/1277673
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-pylint?expand=0&rev=47
2025-05-15 15:02:25 +00:00
bd44e7f673 - Update to 3.3.7
* Comparisons between two calls to `type()` won't raise an
    ``unidiomatic-typecheck`` warning anymore, consistent with
    the behavior applied only for ``==`` previously.
  * Fixed a crash when importing a class decorator that did not
    exist with the same name as a class attribute after the class
    definition.
  * Fix a crash caused by malformed format strings when using
    `.format` with keyword arguments.
  * Using a slice as a class decorator now raises a ``not-callable``
    message instead of crashing. A lot of checks that dealt with
    decorators (too many to list) are now shortcut if the decorator
    can't immediately be inferred to a function or class definition.
  * The algorithm used for ``no-member`` suggestions is now more
    efficient and cuts the calculation when the distance score is
    already above the threshold.

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pylint?expand=0&rev=171
2025-05-15 09:40:12 +00:00
35e536ea68 Accepting request 1267802 from devel:languages:python
- 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/request/show/1267802
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-pylint?expand=0&rev=46
2025-04-16 18:39:15 +00:00
334ede9612 - 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
073c74274e Accepting request 1203869 from devel:languages:python
OBS-URL: https://build.opensuse.org/request/show/1203869
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-pylint?expand=0&rev=45
2024-09-26 16:54:18 +00:00
2361d41a06 - Revert restriction to python3.
If the aithor of previous "fix" actually had thought about the error to be fixed ...

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pylint?expand=0&rev=167
2024-09-26 11:52:10 +00:00
af411f4a00 Accepting request 1203565 from devel:languages:python
OBS-URL: https://build.opensuse.org/request/show/1203565
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-pylint?expand=0&rev=44
2024-09-25 19:54:19 +00:00
9597abcbdc - Fix build error under Leap.
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pylint?expand=0&rev=165
2024-09-25 12:26:24 +00:00
bcbbc76402 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pylint?expand=0&rev=164 2024-09-24 13:51:54 +00:00
0d8b11f5f3 - update to 3.3.1:
* Fix regression causing some f-strings to not be inferred as
    strings.
- update to 3.3.0:
  * We migrated ``symilar`` to argparse, from getopt, so the
    error and help output changed (for the better).
    We exit with 2 instead of sometime 1, sometime 2.
    The error output is not captured by the runner anymore.
    It's not possible to use a value for the boolean options
    anymore (``--ignore-comments 1`` should become
    ``--ignore-comments``).
  * Add new `declare-non-slot` error which reports when a class
    has a `__slots__` member and a type hint on the class is not
    present in `__slots__`.
  * Added `too-many-positional-arguments` to allow distinguishing
    the configuration for too many total arguments
    (with keyword-only params specified after `*`) from the
    configuration for too many positional-or-keyword or
    positional-only arguments.
  * Add `using-exception-group-in-unsupported-version` and
    `using-generic-type-syntax-in-unsupported-version` for uses
    of Python 3.11+ or 3.12+ features on lower supported versions
    provided with `--py-version`.
  * Add `using-assignment-expression-in-unsupported-version` for
    uses of `:=` (walrus operator) on Python versions below 3.8
    provided with `--py-version`.
  * Add `using-positional-only-args-in-unsupported-version` for
    uses of positional-only args on Python versions below 3.8
    provided with `--py-version`.
  * Add ``unnecessary-default-type-args`` to the ``typing``

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pylint?expand=0&rev=163
2024-09-24 13:50:18 +00:00
6 changed files with 329 additions and 268 deletions

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:66c917c27c74b84d44aecacd9725defeb3ef51bdf916213e52c647f5545dda75
size 1447684

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

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

View File

@@ -1,206 +0,0 @@
Index: pylint-3.2.6/pylint/testutils/configuration_test.py
===================================================================
--- pylint-3.2.6.orig/pylint/testutils/configuration_test.py
+++ pylint-3.2.6/pylint/testutils/configuration_test.py
@@ -12,7 +12,6 @@ import logging
import unittest
from pathlib import Path
from typing import Any, Dict
-from unittest.mock import Mock
from pylint.lint import Run
@@ -135,18 +134,15 @@ def get_expected_output(
def run_using_a_configuration_file(
configuration_path: Path | str, file_to_lint: str = __file__
-) -> tuple[Mock, Mock, Run]:
+) -> Run:
"""Simulate a run with a configuration without really launching the checks."""
configuration_path = str(configuration_path)
args = ["--rcfile", configuration_path, file_to_lint]
- # We do not capture the `SystemExit` as then the `runner` variable
- # would not be accessible outside the `with` block.
- with unittest.mock.patch("sys.exit") as mocked_exit:
- # Do not actually run checks, that could be slow. We don't mock
- # `PyLinter.check`: it calls `PyLinter.initialize` which is
- # needed to properly set up messages inclusion/exclusion
- # in `_msg_states`, used by `is_message_enabled`.
- check = "pylint.lint.pylinter.check_parallel"
- with unittest.mock.patch(check) as mocked_check_parallel:
- runner = Run(args)
- return mocked_exit, mocked_check_parallel, runner
+ # Do not actually run checks, that could be slow. We don't mock
+ # `PyLinter.check`: it calls `PyLinter.initialize` which is
+ # needed to properly set up messages inclusion/exclusion
+ # in `_msg_states`, used by `is_message_enabled`.
+ check = "pylint.lint.pylinter.check_parallel"
+ with unittest.mock.patch(check):
+ runner = Run(args, exit=False)
+ return runner
Index: pylint-3.2.6/requirements_test_min.txt
===================================================================
--- pylint-3.2.6.orig/requirements_test_min.txt
+++ pylint-3.2.6/requirements_test_min.txt
@@ -3,7 +3,7 @@
astroid==3.2.4 # Pinned to a specific version for tests
typing-extensions~=4.11
py~=1.11.0
-pytest~=7.4
+pytest~=8.2
pytest-benchmark~=4.0
pytest-timeout~=2.3
towncrier~=23.11
Index: pylint-3.2.6/tests/config/test_config.py
===================================================================
--- pylint-3.2.6.orig/tests/config/test_config.py
+++ pylint-3.2.6/tests/config/test_config.py
@@ -55,10 +55,8 @@ reports = "yes"
)
env_var = "tmp_path_env"
os.environ[env_var] = str(config_file)
- mock_exit, _, runner = run_using_a_configuration_file(
- f"${env_var}", file_to_lint_path
- )
- mock_exit.assert_called_once_with(0)
+ runner = run_using_a_configuration_file(f"${env_var}", file_to_lint_path)
+ assert runner.linter.msg_status == 0
check_configuration_file_reader(runner)
@@ -226,7 +224,7 @@ def test_disable_before_enable_all_takes
runner = Run(["--disable=fixme", "--enable=all", str(FIXME_MODULE)], exit=False)
assert not runner.linter.stats.by_msg
- _, _, toml_runner = run_using_a_configuration_file(
+ toml_runner = run_using_a_configuration_file(
HERE
/ "functional"
/ "toml"
@@ -239,7 +237,7 @@ def test_enable_before_disable_all_takes
runner = Run(["--enable=fixme", "--disable=all", str(FIXME_MODULE)], exit=False)
assert runner.linter.stats.by_msg
- _, _, toml_runner = run_using_a_configuration_file(
+ toml_runner = run_using_a_configuration_file(
HERE
/ "functional"
/ "toml"
Index: pylint-3.2.6/tests/config/test_functional_config_loading.py
===================================================================
--- pylint-3.2.6.orig/tests/config/test_functional_config_loading.py
+++ pylint-3.2.6/tests/config/test_functional_config_loading.py
@@ -57,10 +57,8 @@ def default_configuration(
) -> PylintConfiguration:
empty_pylintrc = tmp_path / "pylintrc"
empty_pylintrc.write_text("")
- mock_exit, _, runner = run_using_a_configuration_file(
- str(empty_pylintrc), file_to_lint_path
- )
- mock_exit.assert_called_once_with(0)
+ runner = run_using_a_configuration_file(str(empty_pylintrc), file_to_lint_path)
+ assert runner.linter.msg_status == 0
return runner.linter.config.__dict__
@@ -88,10 +86,8 @@ def test_functional_config_loading(
warnings.filterwarnings(
"ignore", message="The use of 'MASTER'.*", category=UserWarning
)
- mock_exit, _, runner = run_using_a_configuration_file(
- configuration_path, file_to_lint_path
- )
- mock_exit.assert_called_once_with(expected_code)
+ runner = run_using_a_configuration_file(configuration_path, file_to_lint_path)
+ assert runner.linter.msg_status == expected_code
out, err = capsys.readouterr()
# 'rstrip()' applied, so we can have a final newline in the expected test file
assert expected_output.rstrip() == out.rstrip(), msg
Index: pylint-3.2.6/tests/lint/unittest_lint.py
===================================================================
--- pylint-3.2.6.orig/tests/lint/unittest_lint.py
+++ pylint-3.2.6/tests/lint/unittest_lint.py
@@ -20,6 +20,7 @@ from pathlib import Path
from shutil import copy, rmtree
from unittest import mock
+import astroid
import platformdirs
import pytest
from astroid import nodes
@@ -1053,7 +1054,9 @@ def test_finds_pyi_file() -> None:
exit=False,
)
assert run.linter.current_file is not None
- assert run.linter.current_file.endswith("foo.pyi")
+ assert run.linter.current_file.endswith(
+ "a_module_that_we_definitely_dont_use_in_the_functional_tests.pyi"
+ )
def test_recursive_finds_pyi_file() -> None:
@@ -1068,7 +1071,9 @@ def test_recursive_finds_pyi_file() -> N
exit=False,
)
assert run.linter.current_file is not None
- assert run.linter.current_file.endswith("foo.pyi")
+ assert run.linter.current_file.endswith(
+ "a_module_that_we_definitely_dont_use_in_the_functional_tests.pyi"
+ )
def test_no_false_positive_from_pyi_stub() -> None:
@@ -1126,6 +1131,9 @@ def test_recursive_ignore(ignore_paramet
):
module = os.path.abspath(join(REGRTEST_DATA_DIR, *regrtest_data_module))
assert module in linted_file_paths
+ # We lint the modules in `regrtest` in other tests as well. Prevent test pollution by
+ # explicitly clearing the astroid caches.
+ astroid.MANAGER.clear_cache()
def test_source_roots_globbing() -> None:
Index: pylint-3.2.6/tests/regrtest_data/pyi/a_module_that_we_definitely_dont_use_in_the_functional_tests.pyi
===================================================================
--- /dev/null
+++ pylint-3.2.6/tests/regrtest_data/pyi/a_module_that_we_definitely_dont_use_in_the_functional_tests.pyi
@@ -0,0 +1,5 @@
+# This module is named in a particular way to prevent test pollution. It was previously named 'foo' and
+# all mentions of 'foo' were wrongly resolved to this stub file.
+foo = 1
+
+def three_item_iterable(): ...
Index: pylint-3.2.6/tests/regrtest_data/pyi/foo.pyi
===================================================================
--- pylint-3.2.6.orig/tests/regrtest_data/pyi/foo.pyi
+++ /dev/null
@@ -1,4 +0,0 @@
-foo = 1
-
-def three_item_iterable():
- ...
Index: pylint-3.2.6/tests/regrtest_data/uses_module_with_stub.py
===================================================================
--- pylint-3.2.6.orig/tests/regrtest_data/uses_module_with_stub.py
+++ pylint-3.2.6/tests/regrtest_data/uses_module_with_stub.py
@@ -1,5 +1,5 @@
"""If the stub is preferred over the .py, this might emit not-an-iterable"""
-from pyi.foo import three_item_iterable
+from pyi.a_module_that_we_definitely_dont_use_in_the_functional_tests import three_item_iterable
for val in three_item_iterable():
print(val)
Index: pylint-3.2.6/tests/regrtest_data/pyi/a_module_that_we_definitely_dont_use_in_the_functional_tests.py
===================================================================
--- /dev/null
+++ pylint-3.2.6/tests/regrtest_data/pyi/a_module_that_we_definitely_dont_use_in_the_functional_tests.py
@@ -0,0 +1,2 @@
+def three_item_iterable():
+ return [1, 2, 3]
Index: pylint-3.2.6/tests/regrtest_data/pyi/foo.py
===================================================================
--- pylint-3.2.6.orig/tests/regrtest_data/pyi/foo.py
+++ /dev/null
@@ -1,2 +0,0 @@
-def three_item_iterable():
- return [1, 2, 3]

View File

@@ -1,3 +1,297 @@
-------------------------------------------------------------------
Mon Nov 17 04:33:49 UTC 2025 - Steve Kowalik <steven.kowalik@suse.com>
- Update to 4.0.3:
* Add Enum dunder methods _generate_next_value_, _missing_, _numeric_repr_,
_add_alias_, and _add_value_alias_ to the list passed to
--good-dunder-names.
* Fixed false positive for invalid-name with typing.Annotated.
* Fix false positive for f-string-without-interpolation with template
strings when using format spec.
* Fix a false positive when an UPPER_CASED class attribute was raising an
invalid-name when typed with Final.
* Fix a false positive for unbalanced-tuple-unpacking when a tuple is
assigned to a function call and the structure of the function's return
value is ambiguous.
* Make 'ignore' option work as expected again.
* Fix crash for consider-using-assignment-expr when a variable annotation
without assignment is used as the if test expression.
* Fix crash for prefer-typing-namedtuple and consider-math-not-float when
a slice object is called.
* Fix false positive for invalid-name on a partially uninferable
module-level constant.
* Fix a false positive for invalid-name on exclusive module-level
assignments composed of three or more branches.
* Fix false positive for invalid-name for TypedDict instances.
* Fix false-positive for bare-name-capture-pattern if a case guard is used.
* Check enums created with the Enum() functional syntax to pass against the
--class-rgx for the invalid-name check, like other enums.
* Pylint now supports Python 3.14.
* Pylint's inference engine (astroid) is now much more precise,
understanding implicit booleanness and ternary expressions. The required
astroid version is now 4.0.0.
* Handling of invalid-name at the module level was patchy. Now,
module-level constants that are reassigned are treated as variables and
checked against --variable-rgx rather than --const-rgx. Module-level
lists, sets, and objects can pass against either regex.
* invalid-name now distinguishes module-level constants that are assigned
only once from those that are reassigned and now applies --variable-rgx
to the latter.
* The unused pylintrc argument to PyLinter.__init__() is deprecated and
will be removed.
* pyreverse Run was changed to no longer call sys.exit() in its __init__.
* The suggestion-mode option was removed, as pylint now always emits
user-friendly hints instead of false-positive error messages.
* The async.py checker module has been renamed to async_checker.py since
async is a Python keyword and cannot be imported directly. This allows
for better testing and extensibility of the async checker functionality.
* The message-id of continue-in-finally was changed from E0116 to W0136.
The warning is now emitted for every Python version since it will raise a
syntax warning in Python 3.14.
* Removed support for nmp.NaN alias for numpy.NaN being recognized in
nan-comparison.
* Version requirement for isort has been bumped to >=5.0.0.
* comparison-of-constants now uses the unicode from the ast instead of
reformatting from the node's values preventing some bad formatting due to
utf-8 limitation.
* The use-implicit-booleaness-not-x checks now distinguish between
comparisons used in boolean contexts and those that are not, enabling
them to provide more accurate refactoring suggestions.
* The verbose option now outputs the filenames of the files that have been
checked.
* colorized reporter now colorizes messages/categories that have been
configured as fail-on in red inverse.
* Enhanced support for @property decorator in pyreverse to correctly
display return types of annotated properties when generating class
diagrams.
* Handle deferred evaluation of annotations in Python 3.14.
* pyreverse: add support for colorized output when using output format mmd
(MermaidJS) and html.
* pypy 3.11 is now officially supported.
* Add support for Python 3.14.
* Add naming styles for ParamSpec and TypeVarTuple that align with the
TypeVar style.
* Add match-statements checker and the following message:
bare-name-capture-pattern.
* Add new check async-context-manager-with-regular-with to detect async
context managers used with regular with statements instead of async with.
* Add break-in-finally warning. Using break inside the finally clause will
raise a syntax warning in Python 3.14.
* Add new checks for invalid uses of class patterns in match.
* Add additional checks for suboptimal uses of class patterns in match.
* Add a consider-math-not-float message. float("nan") and float("inf") are
slower than their counterpart math.inf and math.nan by a factor of 4
(notwithstanding the initial import of math) and they are also not well
typed when using mypy.
* Fix a false positive for used-before-assignment when a variable defined
under an if and via a named expression (walrus operator) is used later
when guarded under the same if test.
* Fix no-name-in-module for members of concurrent.futures with Python 3.14.
* Fix false negative for used-before-assignment when a TYPE_CHECKING import
is used as a type annotation prior to erroneous usage.
* Match cases are now counted as edges in the McCabe graph and will
increase the complexity accordingly.
* Check module-level constants with type annotations for invalid-name.
* Fix false negative where function-redefined (E0102) was not reported for
functions with a leading underscore.
* We now raise a logging-too-few-args for format string with no
interpolation arguments at all.
* Fix false negative for used-before-assignment when a function is defined
inside a TYPE_CHECKING guard block and used later.
* Fix a false negative for possibly-used-before-assignment when a variable
is conditionally defined and later assigned to a type-annotated variable.
* Fix false negative for deprecated-module when a __import__ method is used
instead of import sentence.
* Remove support for launching pylint with Python 3.9.
* Fix used-before-assignment for PEP 695 type aliases and parameters.
* No longer flag undeprecated functions in importlib.resources as
deprecated.
* Fix false positive inconsistent-return-statements when using quit() or
exit() functions.
* Fix false positive undefined-variable (E0602) for for-loop variable
shadowing patterns like for item in item: when the variable was
previously defined.
* Fixed crash in 'unnecessary-list-index-lookup' when starting an
enumeration using minus the length of an iterable inside a dict
comprehension when the len call was only made in this dict comprehension,
and not elsewhere.
-------------------------------------------------------------------
Sun Sep 14 18:17:44 UTC 2025 - Dirk Müller <dmueller@suse.com>
- update to 3.3.8:
* Fix false positives for `possibly-used-before-assignment`
when variables are exhaustively assigned within a `match` block.
* Fix false positive for `missing-raises-doc` and `missing-
yield-doc` when the method length is less than docstring-min-
length.
* Fix a false positive for ``unused-variable`` when multiple
except handlers bind the same name under a try block.
* Fix false-negative for ``used-before-assignment`` with ``from
__future__ import annotations`` in function definitions.
* Fix a bug in Pyreverse where aggregations and associations
were included in diagrams regardless of the selected
--filter-mode (such as PUB_ONLY, ALL, etc.).
* Fix double underscores erroneously rendering as bold in
pyreverse's Mermaid output.
-------------------------------------------------------------------
Mon Aug 25 09:53:38 UTC 2025 - Markéta Machová <mmachova@suse.com>
- Convert to libalternatives on SLE-16-based and newer systems
-------------------------------------------------------------------
Thu May 15 08:56:07 UTC 2025 - John Paul Adrian Glaubitz <adrian.glaubitz@suse.com>
- Update to 3.3.7
* Comparisons between two calls to `type()` won't raise an
``unidiomatic-typecheck`` warning anymore, consistent with
the behavior applied only for ``==`` previously.
* Fixed a crash when importing a class decorator that did not
exist with the same name as a class attribute after the class
definition.
* Fix a crash caused by malformed format strings when using
`.format` with keyword arguments.
* Using a slice as a class decorator now raises a ``not-callable``
message instead of crashing. A lot of checks that dealt with
decorators (too many to list) are now shortcut if the decorator
can't immediately be inferred to a function or class definition.
* The algorithm used for ``no-member`` suggestions is now more
efficient and cuts the calculation when the distance score is
already above the threshold.
-------------------------------------------------------------------
Tue Apr 8 03:29:21 UTC 2025 - Steve Kowalik <steven.kowalik@suse.com>
- 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).
-------------------------------------------------------------------
Thu Sep 26 09:24:16 UTC 2024 - Ben Greiner <code@bnavigator.de>
- Revert restriction to python3.
-------------------------------------------------------------------
Wed Sep 25 11:52:49 UTC 2024 - ecsos <ecsos@opensuse.org>
- Fix build error under Leap.
-------------------------------------------------------------------
Tue Sep 24 13:46:18 UTC 2024 - Dirk Müller <dmueller@suse.com>
- update to 3.3.1:
* Fix regression causing some f-strings to not be inferred as
strings.
- update to 3.3.0:
* We migrated ``symilar`` to argparse, from getopt, so the
error and help output changed (for the better).
We exit with 2 instead of sometime 1, sometime 2.
The error output is not captured by the runner anymore.
It's not possible to use a value for the boolean options
anymore (``--ignore-comments 1`` should become
``--ignore-comments``).
* Add new `declare-non-slot` error which reports when a class
has a `__slots__` member and a type hint on the class is not
present in `__slots__`.
* Added `too-many-positional-arguments` to allow distinguishing
the configuration for too many total arguments
(with keyword-only params specified after `*`) from the
configuration for too many positional-or-keyword or
positional-only arguments.
* Add `using-exception-group-in-unsupported-version` and
`using-generic-type-syntax-in-unsupported-version` for uses
of Python 3.11+ or 3.12+ features on lower supported versions
provided with `--py-version`.
* Add `using-assignment-expression-in-unsupported-version` for
uses of `:=` (walrus operator) on Python versions below 3.8
provided with `--py-version`.
* Add `using-positional-only-args-in-unsupported-version` for
uses of positional-only args on Python versions below 3.8
provided with `--py-version`.
* Add ``unnecessary-default-type-args`` to the ``typing``
extension to detect the use of unnecessary default type args
for ``typing.Generator`` and ``typing.AsyncGenerator``.
* Fix computation of never-returning function: `Never` is
handled in addition to `NoReturn`, and priority is given to
the explicit `--never-returning-functions` option.
* Fix a false negative for `await-outside-async` when await is
inside Lambda.
* Fix a false negative for ``duplicate-argument-name`` by
including ``positional-only``, ``*args`` and ``**kwargs``
arguments in the check.
* Fix false negative for `multiple-statements` when multiple
statements are present on `else` and `finally` lines of
`try`.
* Fix false negatives when `isinstance` does not have exactly
two arguments.
* pylint now emits a `too-many-function-args` or `no-value-for-
parameter` appropriately for `isinstance` calls.
* `--enable` with `--disable=all` now produces an error, when
an unknown msg code is used. Internal `pylint` messages are
no longer affected by `--disable=all`.
* Impossible to compile regexes for paths in the configuration
or argument given to pylint won't crash anymore but raise an
argparse error and display the error message from
``re.compile`` instead.
* Fix a bug where a ``tox.ini`` file with pylint configuration
was ignored and it exists in the current directory.
* ``.cfg`` and ``.ini`` files containing a ``Pylint``
configuration may now use a section named ``[pylint]``. This
enhancement impacts the scenario where these file types are
used as defaults when they are present and have not been
explicitly referred to, using the ``--rcfile`` option.
* Improve file discovery for directories that are not python
packages.
* Remove support for launching pylint with Python 3.8.
* Code that supports Python 3.8 can still be linted with the
``--py-version=3.8`` setting.
* Add support for Python 3.13.
* All variables, classes, functions and file names containing
the word 'similar', when it was, in fact, referring to
'symilar' (the standalone program for the duplicate-code
check) were renamed to 'symilar'.
* Remove old-style classes (Python 2) code and remove check for
new-style class since everything is new-style in Python 3.
Updated doc for exception checker to remove reference to new
style class.
- update to 3.2.7:
* Fixed a false positive `unreachable` for `NoReturn` coroutine
functions.
* Fix crash in refactoring checker when calling a lambda bound
as a method.
* Fix a crash in ``undefined-loop-variable`` when providing the
``iterable`` argument to ``enumerate()``.
* Fix to address indeterminacy of error message in case a
module name is same as another in a separate namespace.
- drop support-astroid-3.3.patch pytest-8.patch: upstream
------------------------------------------------------------------- -------------------------------------------------------------------
Mon Aug 12 06:12:36 UTC 2024 - Steve Kowalik <steven.kowalik@suse.com> Mon Aug 12 06:12:36 UTC 2024 - Steve Kowalik <steven.kowalik@suse.com>
@@ -2615,4 +2909,3 @@ Sun Jul 17 15:17:57 CEST 2005 - garloff@suse.de
- Initial creation of package pylint-0.7.0. - Initial creation of package pylint-0.7.0.
-------------------------------------------------------------------

View File

@@ -1,7 +1,7 @@
# #
# spec file for package python-pylint # spec file for package python-pylint
# #
# Copyright (c) 2024 SUSE LLC # Copyright (c) 2025 SUSE LLC and contributors
# #
# 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,46 +16,51 @@
# #
%{?sle15_python_module_pythons}
%bcond_without tests %bcond_without tests
%if 0%{?suse_version} > 1500
%bcond_without libalternatives
%else
%bcond_with libalternatives
%endif
%{?sle15_python_module_pythons}
Name: python-pylint Name: python-pylint
Version: 3.2.6 Version: 4.0.3
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
URL: https://github.com/pylint-dev/pylint URL: https://github.com/pylint-dev/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/pylint-dev/pylint/archive/refs/tags/v%{version}.tar.gz#/pylint-%{version}-gh.tar.gz Source: https://github.com/pylint-dev/pylint/archive/refs/tags/v%{version}.tar.gz#/pylint-%{version}-gh.tar.gz
# PATCH-FIX-UPSTREAM pytest-8.patch gh#pylint-dev/pylint#9576 BuildRequires: %{python_module base >= 3.10}
Patch0: pytest-8.patch
# PATCH-FIX-UPSTREAM One commit of gh#pylint-dev/pylint#9851
Patch1: support-astroid-3.3.patch
BuildRequires: %{python_module base >= 3.7.2}
BuildRequires: %{python_module pip} BuildRequires: %{python_module pip}
BuildRequires: %{python_module setuptools} BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module wheel} BuildRequires: %{python_module wheel}
BuildRequires: fdupes BuildRequires: fdupes
BuildRequires: python-rpm-macros BuildRequires: python-rpm-macros
Requires: python-dill >= 0.3.6 Requires: python-dill >= 0.3.7
Requires: python-platformdirs >= 2.2 Requires: python-platformdirs >= 2.2
Requires: python-tomlkit >= 0.10.1 Requires: python-tomlkit >= 0.10.1
Requires: (python-astroid >= 3.3.0 with python-astroid < 3.4.0~dev0) Requires: (python-astroid >= 4.0.2 with python-astroid < 4.1.0~dev0)
Requires: (python-isort >= 4.2.5 with python-isort < 6) Requires: (python-isort >= 5 with python-isort < 8)
Requires: (python-mccabe >= 0.6 with python-mccabe < 0.8) Requires: (python-mccabe >= 0.6 with python-mccabe < 0.8)
BuildArch: noarch
%if 0%{?python_version_nodots} < 311 %if 0%{?python_version_nodots} < 311
Requires: python-tomli >= 1.1.0 Requires: python-tomli >= 1.1.0
%endif %endif
Requires: python-typing-extensions >= 4.9 %if 0%{?python_version_nodots} < 310
Requires: python-typing-extensions >= 3.10
%endif
%if %{with tests} %if %{with tests}
# SECTION pylint deps # SECTION pylint deps
BuildRequires: %{python_module astroid >= 3.3.0 with %python-astroid < 3.4.0~dev0} BuildRequires: %{python_module astroid >= 4.0.2 with %python-astroid < 4.1.0~dev0}
BuildRequires: %{python_module dill >= 0.3.6} BuildRequires: %{python_module dill >= 0.3.7}
BuildRequires: %{python_module isort >= 4.2.5 with %python-isort < 6} BuildRequires: %{python_module enchant}
BuildRequires: %{python_module isort >= 5 with %python-isort < 8}
BuildRequires: %{python_module mccabe >= 0.6 with %python-mccabe < 0.8} 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 tomli >= 1.1.0 if %python-base < 3.11}
BuildRequires: %{python_module tomlkit >= 0.10.1} BuildRequires: %{python_module tomlkit >= 0.10.1}
BuildRequires: %{python_module typing-extensions >= 4.9} BuildRequires: %{python_module typing-extensions >= 3.10 if %python-base < 3.10}
# /SECTION # /SECTION
# SECTION test deps # SECTION test deps
BuildRequires: %{python_module GitPython > 3} BuildRequires: %{python_module GitPython > 3}
@@ -66,9 +71,13 @@ BuildRequires: %{python_module pytest}
BuildRequires: %{python_module requests} BuildRequires: %{python_module requests}
# /SECTION # /SECTION
%endif %endif
%if %{with libalternatives}
BuildRequires: alts
Requires: alts
%else
Requires(post): update-alternatives Requires(post): update-alternatives
Requires(postun): update-alternatives Requires(postun): update-alternatives
BuildArch: noarch %endif
%python_subpackages %python_subpackages
%description %description
@@ -101,6 +110,7 @@ export LC_ALL="en_US.UTF-8"
for p in pylint pyreverse symilar pylint-config ; do for p in pylint pyreverse symilar pylint-config ; do
%python_clone -a %{buildroot}%{_bindir}/$p %python_clone -a %{buildroot}%{_bindir}/$p
done done
%python_group_libalternatives pylint pyreverse symilar pylint-config
%python_expand %fdupes %{buildroot}%{$python_sitelib} %python_expand %fdupes %{buildroot}%{$python_sitelib}
%if %{with tests} %if %{with tests}
@@ -108,15 +118,14 @@ done
export LC_ALL="en_US.UTF-8" export LC_ALL="en_US.UTF-8"
# reruns: tests/pyreverse is incredibly non-deterministic in failures # reruns: tests/pyreverse is incredibly non-deterministic in failures
donttest="test_linter_with_unpickleable_plugins_is_pickleable" 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 # Broken upstream
donttest+=" or test_functional" donttest+=" or test_functional or test_progress_reporting"
%pytest -n auto --ignore tests/benchmark --reruns 5 -rsfER -k "not ($donttest)" %pytest -vv -n auto --ignore tests/benchmark --reruns 5 -rsfER -k "not ($donttest)"
%endif %endif
%pre
%python_libalternatives_reset_alternative pylint
%post %post
%python_install_alternative pylint pyreverse symilar pylint-config %python_install_alternative pylint pyreverse symilar pylint-config

View File

@@ -1,35 +0,0 @@
From 8afd218a922b9b572c508ada228b7ed27a607014 Mon Sep 17 00:00:00 2001
From: Jacob Walls <jacobtylerwalls@gmail.com>
Date: Sun, 4 Aug 2024 11:46:21 -0400
Subject: [PATCH 2/4] Bump astroid to 3.3.0
---
pyproject.toml | 2 +-
requirements_test_min.txt | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
Index: pylint-3.2.6/pyproject.toml
===================================================================
--- pylint-3.2.6.orig/pyproject.toml
+++ pylint-3.2.6/pyproject.toml
@@ -41,7 +41,7 @@ dependencies = [
# Also upgrade requirements_test_min.txt.
# Pinned to dev of second minor update to allow editable installs and fix primer issues,
# see https://github.com/pylint-dev/astroid/issues/1341
- "astroid>=3.2.4,<=3.3.0-dev0",
+ "astroid>=3.3.0,<=3.4.0-dev0",
"isort>=4.2.5,<6,!=5.13.0",
"mccabe>=0.6,<0.8",
"tomli>=1.1.0;python_version<'3.11'",
Index: pylint-3.2.6/requirements_test_min.txt
===================================================================
--- pylint-3.2.6.orig/requirements_test_min.txt
+++ pylint-3.2.6/requirements_test_min.txt
@@ -1,6 +1,6 @@
.[testutils,spelling]
# astroid dependency is also defined in pyproject.toml
-astroid==3.2.4 # Pinned to a specific version for tests
+astroid==3.3.0 # Pinned to a specific version for tests
typing-extensions~=4.11
py~=1.11.0
pytest~=8.2