-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
python 3.13.0rc3 and collections.abc #10000
Comments
I've just seen almost exactly the same problem today, with On a Github Ubuntu machine and local Devuan machine. |
Yep, it looks like the static analysis can't follow the runtime-swap-a-dee-doo that's now happening when |
Fixed in astroid 3.3.5 if anyone needs this right away. |
Yep, works for us now- thanks for the quick fix and release! |
Also update some versions
Hello I got the same (I think) i.e. I'm using f.i. Callable (from typing import Callable) and pylint ask to replace by collections.abc.Callable but that module seems to not exists. I'm using a Docker base image Python 3.13.0. Pylint seems to be up to date (i've fired pip install --upgrade), can you guide me please? What should I do to be able to respect suggestions from pylint? Thanks! |
Not sure what the problem is but I think it exists since python 3.9 ; https://docs.python.org/3.9/library/collections.abc.html#collections.abc.Callable (also in 3.13 : https://docs.python.org/3.13/library/collections.abc.html#collections.abc.Callable) |
What is your version of astroid? You would need 3.3.5 to get this fix. There has not yet been a patch release of pylint to enforce that. |
So fast, thanks ! Ok so perhaps my editor is incorrectly configured. Vscode throws that error while editing my .py script. I should admit that i've trust him (not fired the script in my console, will do tomorrow). I got the error for Callable and for Sequence too... If it helps, i'm using a .pylintrc file and start pylint in my console. Thanks for any suggestions... |
Oh sorry i'm in a train (back to home) and was trying to find ressources so I can continue on this tomorrow... I'm not sure about the version of astroid (will check tomorrow) and more didn't know what astroid is (i'm a junior in python's world). I'm using python 3.13.0 (docker image) and i've installed pylint days ago with pip install pylint. |
Try doing something like |
Hi all Here is my current configuration: > /usr/local/bin/python3 --version
Python 3.13.0 > pylint --version
pylint 3.3.1
astroid 3.3.5
Python 3.13.0 (main, Nov 12 2024, 02:27:08) [GCC 12.2.0] (just to be sure, I've well fired By running pylint on the command line here is some errors I got:
Then, I edit that file and replace My trouble comes from VSCode: I'm using the latest version of Pylint addon i.e. v2024.1.13171016 (last updated: 2024-11-13, 08:01:24). Perhaps a setting in VSCode; I'll search in that direction. |
Solved. It was well a setting to add in my vscode Thanks for the support guys! |
Update pylint to the latest upstream version, to fix a false positive with Python 3.13, that was resolved in `astroid` dependency in version `3.3.5`. In order to update the dependency, the `pylint` version itself needs to be bumped to at least version `3.0.0`. The error was: test/run/test_stages.py:21:0: E0611: No name 'Mapping' in module 'collections.abc' (no-name-in-module) More details: pylint-dev/pylint#10000 Signed-off-by: Tomáš Hozza <thozza@redhat.com>
Update pylint to the latest upstream version, to fix a false positive with Python 3.13, that was resolved in `astroid` dependency in version `3.3.5`. In order to update the dependency, the `pylint` version itself needs to be bumped to at least version `3.0.0`. The error was: test/run/test_stages.py:21:0: E0611: No name 'Mapping' in module 'collections.abc' (no-name-in-module) More details: pylint-dev/pylint#10000 Signed-off-by: Tomáš Hozza <thozza@redhat.com>
Update pylint to the latest upstream version, to fix a false positive with Python 3.13, that was resolved in `astroid` dependency in version `3.3.5`. In order to update the dependency, the `pylint` version itself needs to be bumped to at least version `3.0.0`. The error was: test/run/test_stages.py:21:0: E0611: No name 'Mapping' in module 'collections.abc' (no-name-in-module) More details: pylint-dev/pylint#10000 Signed-off-by: Tomáš Hozza <thozza@redhat.com>
Update pylint to the latest upstream version, to fix a false positive with Python 3.13, that was resolved in `astroid` dependency in version `3.3.5`. In order to update the dependency, the `pylint` version itself needs to be bumped to at least version `3.0.0`. The error was: test/run/test_stages.py:21:0: E0611: No name 'Mapping' in module 'collections.abc' (no-name-in-module) More details: pylint-dev/pylint#10000 Signed-off-by: Tomáš Hozza <thozza@redhat.com>
Update pylint to the latest upstream version, to fix a false positive with Python 3.13, that was resolved in `astroid` dependency in version `3.3.5`. In order to update the dependency, the `pylint` version itself needs to be bumped to at least version `3.0.0`. The error was: test/run/test_stages.py:21:0: E0611: No name 'Mapping' in module 'collections.abc' (no-name-in-module) More details: pylint-dev/pylint#10000 Signed-off-by: Tomáš Hozza <thozza@redhat.com>
Update pylint to the latest upstream version, to fix a false positive with Python 3.13, that was resolved in `astroid` dependency in version `3.3.5`. In order to update the dependency, the `pylint` version itself needs to be bumped to at least version `3.0.0`. The error was: test/run/test_stages.py:21:0: E0611: No name 'Mapping' in module 'collections.abc' (no-name-in-module) More details: pylint-dev/pylint#10000 Signed-off-by: Tomáš Hozza <thozza@redhat.com>
Update pylint to the latest upstream version, to fix a false positive with Python 3.13, that was resolved in `astroid` dependency in version `3.3.5`. In order to update the dependency, the `pylint` version itself needs to be bumped to at least version `3.0.0`. The error was: test/run/test_stages.py:21:0: E0611: No name 'Mapping' in module 'collections.abc' (no-name-in-module) More details: pylint-dev/pylint#10000 Signed-off-by: Tomáš Hozza <thozza@redhat.com>
Without this change, running `pre-commit` inside a Python 3.13 venv results in errors as described in pylint-dev/pylint#10000 e.g.: ``` ************* Module telegram._bot telegram/_bot.py:26:0: E0611: No name 'Sequence' in module 'collections.abc' (no-name-in-module) ``` Bumping this hook required ignoring a new check added in pylint 3.3.0: `too-many-positional-arguments` as there's a significant amount of violations and picking a value for `--max-positional-arguments` seems non-trivial as there are functions with 80+ args (e.g., `Message::__init__()` in `telegram/_message.py`)
Seems like it stopped working in 3.13.1 (Release date: 2024-12-03) again :( public repo jobs:
python changelog shows 2 collections-related changes:
|
Can confirm that something changed in 3.13.1.
import astroid
ast = astroid.MANAGER.ast_from_string("from collections import abc")
import_node = list(ast.get_children())[0]
import_node.do_import_module("collections").import_module("abc", relative_only=True) I'm doing some custom linting and now I have to set |
Yep, we're tracking the new problem in #10112 |
Bug description
False positive error of missing name in
collections.abc
.For example linting over the code:
reports:
This error started with updating
Python
from3.13.0rc2
to3.13.0rc3
.Most likely caused by python/cpython#124735
Command used
pylint
Pylint output
No name 'MutableMapping' in module 'collections.abc' (no-name-in-module)
Expected behavior
No error
Pylint version
Python 3.13.0rc3
astroid-3.3.4
pylint-3.3.1
The text was updated successfully, but these errors were encountered: