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 01/15] 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 fa0012691408e1dda289dc030abbf67ab379a479 Mon Sep 17 00:00:00 2001 From: Pierre Sassoulas Date: Sun, 8 Dec 2024 14:04:52 +0100 Subject: [PATCH 02/15] [mypy] Use type-setuptools instead of types-pkg-resources Closes #10117 --- .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 adb5b2a324..ae6f433fb6 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 0d5d80b1c9..fbf9313cc7 100644 --- a/requirements_test.txt +++ b/requirements_test.txt @@ -6,5 +6,5 @@ pytest-cov~=6.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 cb125773cfd83005455ed55d0710e375720b1ff9 Mon Sep 17 00:00:00 2001 From: Jacob Walls Date: Sun, 8 Dec 2024 08:46:44 -0500 Subject: [PATCH 03/15] [skip ci] Add python 3.13 to tox configuration --- .../contributor_guide/tests/launching_test.rst | 2 +- tox.ini | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/development_guide/contributor_guide/tests/launching_test.rst b/doc/development_guide/contributor_guide/tests/launching_test.rst index 48c3a0649b..7eb2abdcd7 100644 --- a/doc/development_guide/contributor_guide/tests/launching_test.rst +++ b/doc/development_guide/contributor_guide/tests/launching_test.rst @@ -30,7 +30,7 @@ tox You can also *optionally* install tox_ and run our tests using the tox_ package, as in:: python -m tox - python -m tox -epy312 # for Python 3.12 suite only + python -m tox -epy313 # for Python 3.13 suite only python -m tox -epylint # for running Pylint over Pylint's codebase python -m tox -eformatting # for running formatting checks over Pylint's codebase diff --git a/tox.ini b/tox.ini index e44d81759f..b5730ea9e3 100644 --- a/tox.ini +++ b/tox.ini @@ -1,6 +1,6 @@ [tox] minversion = 3.0 -envlist = formatting, py39, py310, py311, py312, pypy, benchmark +envlist = formatting, py39, py310, py311, py312, py313, pypy, benchmark skip_missing_interpreters = true requires = pip >=21.3.1 isolated_build = true 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 04/15] [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 be1968e6aa59c8de19a778c280b192e53471a96f Mon Sep 17 00:00:00 2001 From: Marzuk Rashid Date: Sat, 21 Dec 2024 14:32:51 -0600 Subject: [PATCH 05/15] Fix Python 3.12 generic type syntax (#10135) --- 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 584d5d5f70..9064bd120c 100644 --- a/pylint/checkers/variables.py +++ b/pylint/checkers/variables.py @@ -1742,6 +1742,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 @@ -1952,7 +1957,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): @@ -2334,6 +2341,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 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 06/15] 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 d222b42c3f92c1031cc9398b96213873135661c6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 23 Dec 2024 06:11:04 -0800 Subject: [PATCH 07/15] Bump actions/upload-artifact from 4.4.3 to 4.5.0 (#10151) --- .github/workflows/primer_run_main.yaml | 4 ++-- .github/workflows/primer_run_pr.yaml | 6 +++--- .github/workflows/tests.yaml | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/primer_run_main.yaml b/.github/workflows/primer_run_main.yaml index 1b7b1c3d8f..d8512e1d19 100644 --- a/.github/workflows/primer_run_main.yaml +++ b/.github/workflows/primer_run_main.yaml @@ -102,7 +102,7 @@ jobs: ${{ runner.os }}-${{ matrix.python-version }}-${{ steps.commitstring.outputs.commitstring }}-primer - name: Upload commit string - uses: actions/upload-artifact@v4.4.3 + uses: actions/upload-artifact@v4.5.0 if: matrix.batchIdx == 0 with: name: primer_commitstring_${{ matrix.python-version }} @@ -123,7 +123,7 @@ jobs: then echo "::warning ::$WARNINGS" fi - name: Upload output - uses: actions/upload-artifact@v4.4.3 + uses: actions/upload-artifact@v4.5.0 with: name: primer_output_main_${{ matrix.python-version }}_batch${{ matrix.batchIdx }} diff --git a/.github/workflows/primer_run_pr.yaml b/.github/workflows/primer_run_pr.yaml index 44c40b5d59..54a3bfabe7 100644 --- a/.github/workflows/primer_run_pr.yaml +++ b/.github/workflows/primer_run_pr.yaml @@ -197,7 +197,7 @@ jobs: then echo "::warning ::$WARNINGS" fi - name: Upload output of PR - uses: actions/upload-artifact@v4.4.3 + uses: actions/upload-artifact@v4.5.0 with: name: primer_output_pr_${{ matrix.python-version }}_batch${{ matrix.batchIdx }} @@ -205,7 +205,7 @@ jobs: tests/.pylint_primer_tests/output_${{ matrix.python-version }}_pr_batch${{ matrix.batchIdx }}.txt - name: Upload output of 'main' - uses: actions/upload-artifact@v4.4.3 + uses: actions/upload-artifact@v4.5.0 with: name: primer_output_main_${{ matrix.python-version }}_batch${{ matrix.batchIdx }} @@ -218,7 +218,7 @@ jobs: - name: Upload PR number if: startsWith(steps.python.outputs.python-version, '3.9') && matrix.batchIdx == 0 - uses: actions/upload-artifact@v4.4.3 + uses: actions/upload-artifact@v4.5.0 with: name: pr_number path: pr_number.txt diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 162173efa5..b84d756d84 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -76,7 +76,7 @@ jobs: pip list | grep 'astroid\|pylint' python -m pytest -vv --minimal-messages-config tests/test_functional.py - name: Upload coverage artifact - uses: actions/upload-artifact@v4.4.3 + uses: actions/upload-artifact@v4.5.0 with: name: coverage-${{ matrix.python-version }} include-hidden-files: true @@ -161,7 +161,7 @@ jobs: run: >- echo "datetime="$(date "+%Y%m%d_%H%M") >> $GITHUB_OUTPUT - name: Upload benchmark artifact - uses: actions/upload-artifact@v4.4.3 + uses: actions/upload-artifact@v4.5.0 with: name: benchmark-${{ runner.os }}-${{ matrix.python-version }}_${{ From 5cae0910feda2fe934a648b4c0858093a188bc3c Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 23 Dec 2024 06:14:37 -0800 Subject: [PATCH 08/15] [pre-commit.ci] pre-commit autoupdate (#10126) --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index ae6f433fb6..2471d71ae4 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -20,7 +20,7 @@ repos: doc/data/messages/m/missing-final-newline/bad/crlf.py )$ - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.8.1" + rev: "v0.8.3" hooks: - id: ruff args: ["--fix"] @@ -144,7 +144,7 @@ repos: ] exclude: tests(/\w*)*/functional/|tests/input|tests(/.*)+/conftest.py|doc/data/messages|tests(/\w*)*data/ - repo: https://github.com/rbubley/mirrors-prettier - rev: v3.4.1 + rev: v3.4.2 hooks: - id: prettier args: [--prose-wrap=always, --print-width=88] From c3b507bf6adf8ec84cf1e9309c6e76fe1c7ffd66 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 23 Dec 2024 14:26:47 -0800 Subject: [PATCH 09/15] Bump types-setuptools from 75.6.0.20241126 to 75.6.0.20241223 (#10150) Bumps [types-setuptools](https://github.com/python/typeshed) from 75.6.0.20241126 to 75.6.0.20241223. - [Commits](https://github.com/python/typeshed/commits) --- updated-dependencies: - dependency-name: types-setuptools dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- requirements_test.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements_test.txt b/requirements_test.txt index fbf9313cc7..c286d14702 100644 --- a/requirements_test.txt +++ b/requirements_test.txt @@ -6,5 +6,5 @@ pytest-cov~=6.0 pytest-xdist~=3.6 six # Type packages for mypy -types-setuptools==75.6.0.20241126 +types-setuptools==75.6.0.20241223 tox>=3 From 0c5091699ae6ef12f7ce0e36bbef1a6bf414f0ae Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 23 Dec 2024 16:56:57 -0800 Subject: [PATCH 10/15] Bump actions/cache from 4.1.2 to 4.2.0 (#10123) 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> --- .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 cb16f9fdfb..b73c7e3f33 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.1.2 + uses: actions/cache@v4.2.0 with: path: venv key: >- diff --git a/.github/workflows/checks.yaml b/.github/workflows/checks.yaml index a2a5c86a61..04011e280a 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.1.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.1.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.1.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.1.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.1.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.1.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 ba9d79ce0f..33794c0757 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.1.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.1.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 e904be0b00..e273986c01 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.1.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 d8512e1d19..030fabb712 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.1.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.1.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.1.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.1.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 54a3bfabe7..3861474a70 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.1.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.1.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.1.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.1.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 b84d756d84..55181d3b7a 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.1.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.1.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.1.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.1.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.1.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.1.2 + uses: actions/cache@v4.2.0 with: path: venv key: >- From 3478208d72fb2e3eb65026bea08fd63e6dfd6ca9 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 23 Dec 2024 17:20:24 -0800 Subject: [PATCH 11/15] [pre-commit.ci] pre-commit autoupdate (#10153) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/astral-sh/ruff-pre-commit: v0.8.3 → v0.8.4](https://github.com/astral-sh/ruff-pre-commit/compare/v0.8.3...v0.8.4) - [github.com/pre-commit/mirrors-mypy: v1.13.0 → v1.14.0](https://github.com/pre-commit/mirrors-mypy/compare/v1.13.0...v1.14.0) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 2471d71ae4..21c3d7bea9 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -20,7 +20,7 @@ repos: doc/data/messages/m/missing-final-newline/bad/crlf.py )$ - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.8.3" + rev: "v0.8.4" hooks: - id: ruff args: ["--fix"] @@ -125,7 +125,7 @@ repos: files: ^(doc/(.*/)*.*\.rst) additional_dependencies: [Sphinx==7.4.3] - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.13.0 + rev: v1.14.0 hooks: - id: mypy name: mypy From 96d13034cfcd021f73572115781f4eaa55257ff3 Mon Sep 17 00:00:00 2001 From: Jacob Walls Date: Mon, 23 Dec 2024 17:26:26 -0800 Subject: [PATCH 12/15] 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 31e7674ad44c9cbd3120e7e42497bf8af911df79 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 23 Dec 2024 17:59:34 -0800 Subject: [PATCH 13/15] Bump astroid from 3.3.5 to 3.3.8 (#10125) --- 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 5a91247410..c1fa465e4a 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,<=4.0.0-dev0", + "astroid>=3.3.8,<=4.0.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 11505dbeee..3fd42d5f69 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 1f9b947768ca8dc15deaf1b70e102ccb27621c08 Mon Sep 17 00:00:00 2001 From: Jacob Walls Date: Mon, 23 Dec 2024 18:19:45 -0800 Subject: [PATCH 14/15] 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 15/15] 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"