Skip to content
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

Pylint crashes with ImportError after upgrade from 2.17.7 to 3.0.1 #9163

Closed
dan-constantinescu opened this issue Oct 18, 2023 · 3 comments
Closed
Labels
Downstream Bug 🪲 The problem happens in a lib depending on pylint, not pylint

Comments

@dan-constantinescu
Copy link

Bug description

Pylint crashes with ImportError: cannot import name 'IAstroidChecker' from 'pylint.interfaces' after updating from 2.17.7 (was working ok) to 3.0.1 (crash).

Configuration

[pylint.master]
load-plugins = pylint_quotes
string-quote = double-avoid-escape
triple-quote = double
docstring-quote = double

[pylint.messages control]
disable =
    locally-disabled,
    fixme,
    import-error,
    no-name-in-module,
    no-member,
    too-few-public-methods,
    inherit-non-class,
    inconsistent-return-statements,
    logging-fstring-interpolation

[pylint.basic]
good-names = n, x, y, i, ip, id, dp, ui, p1, fp, e
module-rgx = ([a-z_][a-z0-9_]{2,30}|.*Library|.*TestEnv)$

[pylint.design]
max-parents=15

[pylint.format]
max-line-length = 150
expected-line-ending-format=LF

[pylint.typecheck]
ignored-modules = selenium

[pylint.imports]
known-third-party = yaml
[pylint.reports]
reports = no

[pylint.similarities]
ignore-comments=yes
ignore-docstrings=yes
ignore-imports=yes
min-similarity-lines=20

Command used

pylint .\src\

Pylint output

(minerva) PS C:\Projects\minerva> pylint .\src\
Traceback (most recent call last):
  File "c:\tools\scoop\apps\python38\current\lib\runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "c:\tools\scoop\apps\python38\current\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\Users\P3700831\Documents\venv\minerva-HxN7TDJb\Scripts\pylint.exe\__main__.py", line 7, in <module>
  File "C:\Users\P3700831\Documents\venv\minerva-HxN7TDJb\lib\site-packages\pylint\__init__.py", line 34, in run_pylint
    PylintRun(argv or sys.argv[1:])
  File "C:\Users\P3700831\Documents\venv\minerva-HxN7TDJb\lib\site-packages\pylint\lint\run.py", line 162, in __init__
    args = _config_initialization(
  File "C:\Users\P3700831\Documents\venv\minerva-HxN7TDJb\lib\site-packages\pylint\config\config_initialization.py", line 61, in _config_initialization
    linter.load_plugin_modules(utils._splitstrip(config_data["load-plugins"]))
  File "C:\Users\P3700831\Documents\venv\minerva-HxN7TDJb\lib\site-packages\pylint\lint\pylinter.py", line 380, in load_plugin_modules
    module = astroid.modutils.load_module_from_name(modname)
  File "C:\Users\P3700831\Documents\venv\minerva-HxN7TDJb\lib\site-packages\astroid\modutils.py", line 194, in load_module_from_name
    module = importlib.import_module(dotted_name)
  File "c:\tools\scoop\apps\python38\current\lib\importlib\__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 848, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "C:\Users\P3700831\Documents\venv\minerva-HxN7TDJb\lib\site-packages\pylint_quotes\__init__.py", line 5, in <module>
    from pylint_quotes import checker, plugin  # noqa: F401
  File "C:\Users\P3700831\Documents\venv\minerva-HxN7TDJb\lib\site-packages\pylint_quotes\checker.py", line 8, in <module>
    from pylint.interfaces import IAstroidChecker, ITokenChecker
ImportError: cannot import name 'IAstroidChecker' from 'pylint.interfaces' (C:\Users\P3700831\Documents\venv\minerva-HxN7TDJb\lib\site-packages\pylint\interfaces.py)

Expected behavior

no crash

Pylint version

pylint 3.0.1
astroid 3.0.1
Python 3.8.10 (tags/v3.8.10:3d8993a, May  3 2021, 11:48:03) [MSC v.1928 64 bit (AMD64)]

OS / Environment

Windows 11

Additional dependencies

[packages]
Flask = "*"
Flask-Bcrypt = "*"
Flask-Login = "*"
Flask-SQLAlchemy = "*"
Flask-WTF = "*"
Werkzeug = "2.3"
WTForms = "*"
requests = "*"
PyJWT = "*"

[dev-packages]
pylint = "*"
pylint-quotes = "*"
pydocstyle = "*"
flake8 = "*"
flake8-docstrings = "*"
@dan-constantinescu dan-constantinescu added the Needs triage 📥 Just created, needs acknowledgment, triage, and proper labelling label Oct 18, 2023
@DanielNoord
Copy link
Collaborator

This is an issue in the pylint_quotes plugin, not with pylint. You'll need to raise the issue with them.

@DanielNoord DanielNoord closed this as not planned Won't fix, can't repro, duplicate, stale Oct 18, 2023
@DanielNoord DanielNoord added Downstream Bug 🪲 The problem happens in a lib depending on pylint, not pylint and removed Needs triage 📥 Just created, needs acknowledgment, triage, and proper labelling labels Oct 18, 2023
@dan-constantinescu
Copy link
Author

Thank you for the response and for pointing me in the right direction. Checked the pylint-quotes open issues and this one was already reported there: edaniszewski/pylint-quotes#29.

@Pierre-Sassoulas
Copy link
Member

Fixed in edaniszewski/pylint-quotes#28

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Downstream Bug 🪲 The problem happens in a lib depending on pylint, not pylint
Projects
None yet
Development

No branches or pull requests

3 participants