From 995570109a3edaa76606558df8758451ec2d85c8 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 4 Dec 2024 05:46:50 +0100 Subject: [PATCH 1/6] Fix 'use-implicit-booleaness' wrongly emitted for generators. (#10107) (#10109) Co-authored-by: Nedelcu Co-authored-by: Pierre Sassoulas (cherry picked from commit a4e91d7f116fc46307e0aa007ad965980cfa9a4d) Co-authored-by: Nedelcu Ioan-Andrei <138256980+nedelcu-ioan@users.noreply.github.com> --- doc/whatsnew/fragments/10100.false_positive | 4 ++++ .../refactoring/implicit_booleaness_checker.py | 10 ++-------- .../u/use/use_implicit_booleaness_not_len.py | 6 +++++- .../u/use/use_implicit_booleaness_not_len.txt | 1 - 4 files changed, 11 insertions(+), 10 deletions(-) create mode 100644 doc/whatsnew/fragments/10100.false_positive diff --git a/doc/whatsnew/fragments/10100.false_positive b/doc/whatsnew/fragments/10100.false_positive new file mode 100644 index 0000000000..2f3572bf55 --- /dev/null +++ b/doc/whatsnew/fragments/10100.false_positive @@ -0,0 +1,4 @@ +Fix a false positive for `use-implicit-booleaness-not-len`. No lint should be emitted for +generators (`len` is not defined for generators). + +Refs #10100 diff --git a/pylint/checkers/refactoring/implicit_booleaness_checker.py b/pylint/checkers/refactoring/implicit_booleaness_checker.py index 4d3d47cf9f..7522faeb1c 100644 --- a/pylint/checkers/refactoring/implicit_booleaness_checker.py +++ b/pylint/checkers/refactoring/implicit_booleaness_checker.py @@ -125,14 +125,8 @@ def visit_call(self, node: nodes.Call) -> None: if not utils.is_test_condition(node, parent): return len_arg = node.args[0] - generator_or_comprehension = ( - nodes.ListComp, - nodes.SetComp, - nodes.DictComp, - nodes.GeneratorExp, - ) - if isinstance(len_arg, generator_or_comprehension): - # The node is a generator or comprehension as in len([x for x in ...]) + if isinstance(len_arg, (nodes.ListComp, nodes.SetComp, nodes.DictComp)): + # The node is a comprehension as in len([x for x in ...]) self.add_message( "use-implicit-booleaness-not-len", node=node, diff --git a/tests/functional/u/use/use_implicit_booleaness_not_len.py b/tests/functional/u/use/use_implicit_booleaness_not_len.py index 1261aa3014..4a1063e757 100644 --- a/tests/functional/u/use/use_implicit_booleaness_not_len.py +++ b/tests/functional/u/use/use_implicit_booleaness_not_len.py @@ -125,7 +125,7 @@ class ChildClassWithoutBool(ClassWithoutBool): assert len(ChildClassWithoutBool()) # [use-implicit-booleaness-not-len] assert len(range(0)) # [use-implicit-booleaness-not-len] assert len([t + 1 for t in []]) # [use-implicit-booleaness-not-len] - assert len(u + 1 for u in []) # [use-implicit-booleaness-not-len] + assert len(u + 1 for u in []) # Should be fine assert len({"1":(v + 1) for v in {}}) # [use-implicit-booleaness-not-len] assert len(set((w + 1) for w in set())) # [use-implicit-booleaness-not-len] @@ -189,3 +189,7 @@ def github_issue_4215(): if len('TEST'): pass + +def github_issue_10100(): + if len((x for x in [1, 2, 3])): # Should be fine + print("yay!") diff --git a/tests/functional/u/use/use_implicit_booleaness_not_len.txt b/tests/functional/u/use/use_implicit_booleaness_not_len.txt index 85917de828..868e746bfb 100644 --- a/tests/functional/u/use/use_implicit_booleaness_not_len.txt +++ b/tests/functional/u/use/use_implicit_booleaness_not_len.txt @@ -18,7 +18,6 @@ use-implicit-booleaness-not-len:124:11:124:34:github_issue_1879:Do not use `len( use-implicit-booleaness-not-len:125:11:125:39:github_issue_1879:Do not use `len(SEQUENCE)` without comparison to determine if a sequence is empty:INFERENCE use-implicit-booleaness-not-len:126:11:126:24:github_issue_1879:Do not use `len(SEQUENCE)` without comparison to determine if a sequence is empty:INFERENCE use-implicit-booleaness-not-len:127:11:127:35:github_issue_1879:Do not use `len(SEQUENCE)` without comparison to determine if a sequence is empty:HIGH -use-implicit-booleaness-not-len:128:11:128:33:github_issue_1879:Do not use `len(SEQUENCE)` without comparison to determine if a sequence is empty:HIGH use-implicit-booleaness-not-len:129:11:129:41:github_issue_1879:Do not use `len(SEQUENCE)` without comparison to determine if a sequence is empty:HIGH use-implicit-booleaness-not-len:130:11:130:43:github_issue_1879:Do not use `len(SEQUENCE)` without comparison to determine if a sequence is empty:INFERENCE use-implicit-booleaness-not-len:171:11:171:42:github_issue_1879:Do not use `len(SEQUENCE)` without comparison to determine if a sequence is empty:INFERENCE From 90cb29df77bf8abde79671dd59e740eeaf063deb Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 8 Dec 2024 08:59:25 -0500 Subject: [PATCH 2/6] [mypy] Use type-setuptools instead of types-pkg-resources (#10120) Closes #10117 (cherry picked from commit fa0012691408e1dda289dc030abbf67ab379a479) Co-authored-by: Pierre Sassoulas --- .pre-commit-config.yaml | 2 +- requirements_test.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 2a3712cc7a..ceee345834 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -140,7 +140,7 @@ repos: "platformdirs==2.2.0", "py==1.11", "tomlkit>=0.10.1", - "types-pkg_resources==0.1.3", + "types-setuptools==75.6.0.20241126", ] exclude: tests(/\w*)*/functional/|tests/input|tests(/.*)+/conftest.py|doc/data/messages|tests(/\w*)*data/ - repo: https://github.com/rbubley/mirrors-prettier diff --git a/requirements_test.txt b/requirements_test.txt index 955c620062..8d79c90767 100644 --- a/requirements_test.txt +++ b/requirements_test.txt @@ -6,5 +6,5 @@ pytest-cov~=5.0 pytest-xdist~=3.6 six # Type packages for mypy -types-pkg_resources==0.1.3 +types-setuptools==75.6.0.20241126 tox>=3 From a7202b145b81e86bed9ddcddf54439cccc73d4f3 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 21 Dec 2024 12:52:32 -0800 Subject: [PATCH 3/6] Fix Python 3.12 generic type syntax (#10135) (#10146) (cherry picked from commit be1968e6aa59c8de19a778c280b192e53471a96f) Co-authored-by: Marzuk Rashid --- doc/whatsnew/fragments/9335.false_positive | 4 ++++ pylint/checkers/variables.py | 16 +++++++++++++++- tests/functional/g/generic_class_syntax_py312.py | 4 ++-- .../functional/g/generic_class_syntax_py312.txt | 2 -- .../u/undefined/undefined_variable_py312.py | 3 ++- 5 files changed, 23 insertions(+), 6 deletions(-) create mode 100644 doc/whatsnew/fragments/9335.false_positive delete mode 100644 tests/functional/g/generic_class_syntax_py312.txt diff --git a/doc/whatsnew/fragments/9335.false_positive b/doc/whatsnew/fragments/9335.false_positive new file mode 100644 index 0000000000..ec02e2196d --- /dev/null +++ b/doc/whatsnew/fragments/9335.false_positive @@ -0,0 +1,4 @@ +Fix false positives for ``undefined-variable`` for classes using Python 3.12 +generic type syntax. + +Closes #9335 diff --git a/pylint/checkers/variables.py b/pylint/checkers/variables.py index d293e77de7..35d6d7ce0c 100644 --- a/pylint/checkers/variables.py +++ b/pylint/checkers/variables.py @@ -1768,6 +1768,11 @@ def _should_node_be_skipped( if utils.is_ancestor_name(consumer.node, node) or ( not is_start_index and self._ignore_class_scope(node) ): + if any( + node.name == param.name.name for param in consumer.node.type_params + ): + return False + return True # Ignore inner class scope for keywords in class definition @@ -1978,7 +1983,9 @@ def _check_consumer( ) return (VariableVisitConsumerAction.RETURN, found_nodes) - elif isinstance(defstmt, nodes.ClassDef): + elif ( + isinstance(defstmt, nodes.ClassDef) and defnode not in defframe.type_params + ): return self._is_first_level_self_reference(node, defstmt, found_nodes) elif isinstance(defnode, nodes.NamedExpr): @@ -2357,6 +2364,13 @@ def _is_variable_violation( maybe_before_assign = defnode.value is node or any( anc is defnode.value for anc in node.node_ancestors() ) + elif ( + isinstance(defframe, nodes.ClassDef) + and defnode in defframe.type_params + ): + # Generic on parent class: + # class Child[_T](Parent[_T]) + maybe_before_assign = False return maybe_before_assign, annotation_return, use_outer_definition diff --git a/tests/functional/g/generic_class_syntax_py312.py b/tests/functional/g/generic_class_syntax_py312.py index bbfff1c6ad..bd5d1ba838 100644 --- a/tests/functional/g/generic_class_syntax_py312.py +++ b/tests/functional/g/generic_class_syntax_py312.py @@ -2,7 +2,7 @@ class Entity[_T: float]: last_update: int | None = None - def __init__(self, data: _T) -> None: # [undefined-variable] # false-positive + def __init__(self, data: _T) -> None: self.data = data @@ -28,6 +28,6 @@ def __init__(self): self.update_interval = 0 -class Child[_T](Parent[_T]): # [undefined-variable] # false-positive +class Child[_T](Parent[_T]): def func(self): self.update_interval = None diff --git a/tests/functional/g/generic_class_syntax_py312.txt b/tests/functional/g/generic_class_syntax_py312.txt deleted file mode 100644 index bd5fbbe7ee..0000000000 --- a/tests/functional/g/generic_class_syntax_py312.txt +++ /dev/null @@ -1,2 +0,0 @@ -undefined-variable:5:29:5:31:Entity.__init__:Undefined variable '_T':UNDEFINED -undefined-variable:31:23:31:25:Child:Undefined variable '_T':UNDEFINED diff --git a/tests/functional/u/undefined/undefined_variable_py312.py b/tests/functional/u/undefined/undefined_variable_py312.py index 0ca2475eb9..88a5426539 100644 --- a/tests/functional/u/undefined/undefined_variable_py312.py +++ b/tests/functional/u/undefined/undefined_variable_py312.py @@ -4,4 +4,5 @@ def f[T](a: T) -> T: print(a) class ChildClass[T, *Ts, **P]: - ... + def __init__(self, value: T): + self.value = value From 96d13034cfcd021f73572115781f4eaa55257ff3 Mon Sep 17 00:00:00 2001 From: Jacob Walls Date: Mon, 23 Dec 2024 17:26:26 -0800 Subject: [PATCH 4/6] Bump actions/cache from 4.1.2 to 4.2.0 (#10123) (#10154) Bumps [actions/cache](https://github.com/actions/cache) from 4.1.2 to 4.2.0. - [Release notes](https://github.com/actions/cache/releases) - [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md) - [Commits](https://github.com/actions/cache/compare/v4.1.2...v4.2.0) --- updated-dependencies: - dependency-name: actions/cache dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> (cherry picked from commit 0c5091699ae6ef12f7ce0e36bbef1a6bf414f0ae) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/changelog.yml | 2 +- .github/workflows/checks.yaml | 12 ++++++------ .github/workflows/primer-test.yaml | 4 ++-- .github/workflows/primer_comment.yaml | 2 +- .github/workflows/primer_run_main.yaml | 8 ++++---- .github/workflows/primer_run_pr.yaml | 8 ++++---- .github/workflows/tests.yaml | 12 ++++++------ 7 files changed, 24 insertions(+), 24 deletions(-) diff --git a/.github/workflows/changelog.yml b/.github/workflows/changelog.yml index 84252fc147..856ab0d423 100644 --- a/.github/workflows/changelog.yml +++ b/.github/workflows/changelog.yml @@ -41,7 +41,7 @@ jobs: $GITHUB_OUTPUT - name: Restore Python virtual environment id: cache-venv - uses: actions/cache@v4.0.2 + uses: actions/cache@v4.2.0 with: path: venv key: >- diff --git a/.github/workflows/checks.yaml b/.github/workflows/checks.yaml index 2d21945cd2..8668ab6ab5 100644 --- a/.github/workflows/checks.yaml +++ b/.github/workflows/checks.yaml @@ -49,7 +49,7 @@ jobs: $GITHUB_OUTPUT - name: Restore Python virtual environment id: cache-venv - uses: actions/cache@v4.0.2 + uses: actions/cache@v4.2.0 with: path: venv key: >- @@ -71,7 +71,7 @@ jobs: hashFiles('.pre-commit-config.yaml') }}" >> $GITHUB_OUTPUT - name: Restore pre-commit environment id: cache-precommit - uses: actions/cache@v4.0.2 + uses: actions/cache@v4.2.0 with: path: ${{ env.PRE_COMMIT_CACHE }} key: >- @@ -98,7 +98,7 @@ jobs: check-latest: true - name: Restore Python virtual environment id: cache-venv - uses: actions/cache@v4.0.2 + uses: actions/cache@v4.2.0 with: path: venv fail-on-cache-miss: true @@ -107,7 +107,7 @@ jobs: needs.prepare-base.outputs.python-key }} - name: Restore pre-commit environment id: cache-precommit - uses: actions/cache@v4.0.2 + uses: actions/cache@v4.2.0 with: path: ${{ env.PRE_COMMIT_CACHE }} fail-on-cache-miss: true @@ -139,7 +139,7 @@ jobs: check-latest: true - name: Restore Python virtual environment id: cache-venv - uses: actions/cache@v4.0.2 + uses: actions/cache@v4.2.0 with: path: venv fail-on-cache-miss: true @@ -167,7 +167,7 @@ jobs: check-latest: true - name: Restore Python virtual environment id: cache-venv - uses: actions/cache@v4.0.2 + uses: actions/cache@v4.2.0 with: path: venv fail-on-cache-miss: true diff --git a/.github/workflows/primer-test.yaml b/.github/workflows/primer-test.yaml index 6536a34404..980f556407 100644 --- a/.github/workflows/primer-test.yaml +++ b/.github/workflows/primer-test.yaml @@ -51,7 +51,7 @@ jobs: $GITHUB_OUTPUT - name: Restore Python virtual environment id: cache-venv - uses: actions/cache@v4.0.2 + uses: actions/cache@v4.2.0 with: path: venv key: >- @@ -84,7 +84,7 @@ jobs: check-latest: true - name: Restore Python virtual environment id: cache-venv - uses: actions/cache@v4.0.2 + uses: actions/cache@v4.2.0 with: path: venv fail-on-cache-miss: true diff --git a/.github/workflows/primer_comment.yaml b/.github/workflows/primer_comment.yaml index 67a88ff416..e2b6232635 100644 --- a/.github/workflows/primer_comment.yaml +++ b/.github/workflows/primer_comment.yaml @@ -41,7 +41,7 @@ jobs: # Restore cached Python environment - name: Restore Python virtual environment id: cache-venv - uses: actions/cache@v4.0.2 + uses: actions/cache@v4.2.0 with: path: venv key: diff --git a/.github/workflows/primer_run_main.yaml b/.github/workflows/primer_run_main.yaml index 257dafaa2d..7027b1407b 100644 --- a/.github/workflows/primer_run_main.yaml +++ b/.github/workflows/primer_run_main.yaml @@ -45,7 +45,7 @@ jobs: # Create a re-usable virtual environment - name: Restore Python virtual environment cache id: cache-venv - uses: actions/cache/restore@v4.0.2 + uses: actions/cache/restore@v4.2.0 with: path: venv key: @@ -63,7 +63,7 @@ jobs: # Save cached Python environment (explicit because cancel-in-progress: true) - name: Save Python virtual environment to cache if: steps.cache-venv.outputs.cache-hit != 'true' - uses: actions/cache/save@v4.0.2 + uses: actions/cache/save@v4.2.0 with: path: venv key: @@ -82,7 +82,7 @@ jobs: echo "commitstring=$output" >> $GITHUB_OUTPUT - name: Restore projects cache id: cache-projects - uses: actions/cache/restore@v4.0.2 + uses: actions/cache/restore@v4.2.0 with: path: tests/.pylint_primer_tests/ key: >- @@ -95,7 +95,7 @@ jobs: python tests/primer/__main__.py prepare --clone - name: Save projects cache if: steps.cache-projects.outputs.cache-hit != 'true' - uses: actions/cache/save@v4.0.2 + uses: actions/cache/save@v4.2.0 with: path: tests/.pylint_primer_tests/ key: >- diff --git a/.github/workflows/primer_run_pr.yaml b/.github/workflows/primer_run_pr.yaml index 2b4970a86f..9b813c45c4 100644 --- a/.github/workflows/primer_run_pr.yaml +++ b/.github/workflows/primer_run_pr.yaml @@ -56,7 +56,7 @@ jobs: # Restore cached Python environment - name: Restore Python virtual environment id: cache-venv - uses: actions/cache/restore@v4.0.2 + uses: actions/cache/restore@v4.2.0 with: path: venv key: @@ -75,7 +75,7 @@ jobs: # Save cached Python environment (explicit because cancel-in-progress: true) - name: Save Python virtual environment if: steps.cache-venv.outputs.cache-hit != 'true' - uses: actions/cache/save@v4.0.2 + uses: actions/cache/save@v4.2.0 with: path: venv key: @@ -151,7 +151,7 @@ jobs: echo "commitstring=$output" >> $GITHUB_OUTPUT - name: Restore projects cache id: cache-projects - uses: actions/cache/restore@v4.0.2 + uses: actions/cache/restore@v4.2.0 with: path: tests/.pylint_primer_tests/ key: >- @@ -164,7 +164,7 @@ jobs: python tests/primer/__main__.py prepare --clone - name: Save projects cache if: steps.cache-projects.outputs.cache-hit != 'true' - uses: actions/cache/save@v4.0.2 + uses: actions/cache/save@v4.2.0 with: path: tests/.pylint_primer_tests/ key: >- diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 1c05882335..5559f2b89c 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -52,7 +52,7 @@ jobs: $GITHUB_OUTPUT - name: Restore Python virtual environment id: cache-venv - uses: actions/cache@v4.0.2 + uses: actions/cache@v4.2.0 with: path: venv key: >- @@ -98,7 +98,7 @@ jobs: check-latest: true - name: Restore Python virtual environment id: cache-venv - uses: actions/cache@v4.0.2 + uses: actions/cache@v4.2.0 with: path: venv fail-on-cache-miss: true @@ -138,7 +138,7 @@ jobs: check-latest: true - name: Restore Python virtual environment id: cache-venv - uses: actions/cache@v4.0.2 + uses: actions/cache@v4.2.0 with: path: venv fail-on-cache-miss: true @@ -199,7 +199,7 @@ jobs: }}" >> $env:GITHUB_OUTPUT - name: Restore Python virtual environment id: cache-venv - uses: actions/cache@v4.0.2 + uses: actions/cache@v4.2.0 with: path: venv key: >- @@ -245,7 +245,7 @@ jobs: }}" >> $GITHUB_OUTPUT - name: Restore Python virtual environment id: cache-venv - uses: actions/cache@v4.0.2 + uses: actions/cache@v4.2.0 with: path: venv key: >- @@ -289,7 +289,7 @@ jobs: }}" >> $GITHUB_OUTPUT - name: Restore Python virtual environment id: cache-venv - uses: actions/cache@v4.0.2 + uses: actions/cache@v4.2.0 with: path: venv key: >- From 1f9b947768ca8dc15deaf1b70e102ccb27621c08 Mon Sep 17 00:00:00 2001 From: Jacob Walls Date: Mon, 23 Dec 2024 18:19:45 -0800 Subject: [PATCH 5/6] Bump astroid from 3.3.5 to 3.3.8 (#10125) (#10155) (cherry picked from commit 31e7674ad44c9cbd3120e7e42497bf8af911df79) --- doc/whatsnew/fragments/10112.bugfix | 3 +++ pyproject.toml | 2 +- requirements_test_min.txt | 2 +- tests/functional/n/no/no_member_imports.py | 4 ++-- tests/functional/n/no/no_member_imports.rc | 2 +- 5 files changed, 8 insertions(+), 5 deletions(-) create mode 100644 doc/whatsnew/fragments/10112.bugfix diff --git a/doc/whatsnew/fragments/10112.bugfix b/doc/whatsnew/fragments/10112.bugfix new file mode 100644 index 0000000000..9a442696c3 --- /dev/null +++ b/doc/whatsnew/fragments/10112.bugfix @@ -0,0 +1,3 @@ +Fix ``Unable to import 'collections.abc' (import-error)`` on Python 3.13.1. + +Closes #10112 diff --git a/pyproject.toml b/pyproject.toml index 4dfbd99dfe..8d56ce3a7b 100644 --- a/pyproject.toml +++ b/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.3.5,<=3.4.0-dev0", + "astroid>=3.3.8,<=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'", diff --git a/requirements_test_min.txt b/requirements_test_min.txt index c14b34b837..68ce269740 100644 --- a/requirements_test_min.txt +++ b/requirements_test_min.txt @@ -1,6 +1,6 @@ .[testutils,spelling] # astroid dependency is also defined in pyproject.toml -astroid==3.3.5 # Pinned to a specific version for tests +astroid==3.3.8 # Pinned to a specific version for tests typing-extensions~=4.12 py~=1.11.0 pytest~=8.3 diff --git a/tests/functional/n/no/no_member_imports.py b/tests/functional/n/no/no_member_imports.py index ead6d93352..225a215f2f 100644 --- a/tests/functional/n/no/no_member_imports.py +++ b/tests/functional/n/no/no_member_imports.py @@ -33,9 +33,9 @@ def test_ignored_modules_root_one_applies_as_well() -> None: def test_ignored_modules_patterns() -> None: - import collections + import importlib - collections.abc.THIS_does_not_EXIST + importlib.metadata.THIS_does_not_EXIST def test_ignored_classes_no_recursive_pattern() -> None: diff --git a/tests/functional/n/no/no_member_imports.rc b/tests/functional/n/no/no_member_imports.rc index 59db427c27..55b91f9fda 100644 --- a/tests/functional/n/no/no_member_imports.rc +++ b/tests/functional/n/no/no_member_imports.rc @@ -1,3 +1,3 @@ [TYPECHECK] -ignored-modules=argparse,xml.etree.,collections.abc* +ignored-modules=argparse,xml.etree.,importlib.metadata* ignored-classes=sys*,optparse.Values,Option From c28580be76fe1ec55a6cac41833c0bd68070d2f7 Mon Sep 17 00:00:00 2001 From: Jacob Walls Date: Mon, 23 Dec 2024 18:23:47 -0800 Subject: [PATCH 6/6] Bump pylint to 3.3.3, update changelog --- doc/whatsnew/3/3.3/index.rst | 29 +++++++++++++++++++++ doc/whatsnew/fragments/10100.false_positive | 4 --- doc/whatsnew/fragments/10112.bugfix | 3 --- doc/whatsnew/fragments/9335.false_positive | 4 --- pylint/__pkginfo__.py | 2 +- tbump.toml | 2 +- towncrier.toml | 2 +- 7 files changed, 32 insertions(+), 14 deletions(-) delete mode 100644 doc/whatsnew/fragments/10100.false_positive delete mode 100644 doc/whatsnew/fragments/10112.bugfix delete mode 100644 doc/whatsnew/fragments/9335.false_positive diff --git a/doc/whatsnew/3/3.3/index.rst b/doc/whatsnew/3/3.3/index.rst index 179f6e8d9c..775afd7065 100644 --- a/doc/whatsnew/3/3.3/index.rst +++ b/doc/whatsnew/3/3.3/index.rst @@ -14,6 +14,35 @@ Summary -- Release highlights .. towncrier release notes start +What's new in Pylint 3.3.3? +--------------------------- +Release date: 2024-12-23 + + +False Positives Fixed +--------------------- + +- Fix false positives for ``undefined-variable`` for classes using Python 3.12 + generic type syntax. + + Closes #9335 (`#9335 `_) + +- Fix a false positive for `use-implicit-booleaness-not-len`. No lint should be emitted for + generators (`len` is not defined for generators). + + Refs #10100 (`#10100 `_) + + + +Other Bug Fixes +--------------- + +- Fix ``Unable to import 'collections.abc' (import-error)`` on Python 3.13.1. + + Closes #10112 (`#10112 `_) + + + What's new in Pylint 3.3.2? --------------------------- Release date: 2024-12-01 diff --git a/doc/whatsnew/fragments/10100.false_positive b/doc/whatsnew/fragments/10100.false_positive deleted file mode 100644 index 2f3572bf55..0000000000 --- a/doc/whatsnew/fragments/10100.false_positive +++ /dev/null @@ -1,4 +0,0 @@ -Fix a false positive for `use-implicit-booleaness-not-len`. No lint should be emitted for -generators (`len` is not defined for generators). - -Refs #10100 diff --git a/doc/whatsnew/fragments/10112.bugfix b/doc/whatsnew/fragments/10112.bugfix deleted file mode 100644 index 9a442696c3..0000000000 --- a/doc/whatsnew/fragments/10112.bugfix +++ /dev/null @@ -1,3 +0,0 @@ -Fix ``Unable to import 'collections.abc' (import-error)`` on Python 3.13.1. - -Closes #10112 diff --git a/doc/whatsnew/fragments/9335.false_positive b/doc/whatsnew/fragments/9335.false_positive deleted file mode 100644 index ec02e2196d..0000000000 --- a/doc/whatsnew/fragments/9335.false_positive +++ /dev/null @@ -1,4 +0,0 @@ -Fix false positives for ``undefined-variable`` for classes using Python 3.12 -generic type syntax. - -Closes #9335 diff --git a/pylint/__pkginfo__.py b/pylint/__pkginfo__.py index 9ed79f3d4a..625eeee1b0 100644 --- a/pylint/__pkginfo__.py +++ b/pylint/__pkginfo__.py @@ -9,7 +9,7 @@ from __future__ import annotations -__version__ = "3.3.2" +__version__ = "3.3.3" def get_numversion_from_version(v: str) -> tuple[int, int, int]: diff --git a/tbump.toml b/tbump.toml index a07de7ba04..05075f6e2e 100644 --- a/tbump.toml +++ b/tbump.toml @@ -1,7 +1,7 @@ github_url = "https://github.com/pylint-dev/pylint" [version] -current = "3.3.2" +current = "3.3.3" regex = ''' ^(?P0|[1-9]\d*) \. diff --git a/towncrier.toml b/towncrier.toml index e289bc8ffc..7975e71f3c 100644 --- a/towncrier.toml +++ b/towncrier.toml @@ -1,5 +1,5 @@ [tool.towncrier] -version = "3.3.2" +version = "3.3.3" directory = "doc/whatsnew/fragments" filename = "doc/whatsnew/3/3.3/index.rst" template = "doc/whatsnew/fragments/_template.rst"