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

MessagesHandlerMixIn has been removed in 2.12 #11

Closed
DanielNoord opened this issue Dec 3, 2021 · 7 comments
Closed

MessagesHandlerMixIn has been removed in 2.12 #11

DanielNoord opened this issue Dec 3, 2021 · 7 comments

Comments

@DanielNoord
Copy link

pylint contributor here:

One of our issues got tagged in another project, but the actual problem was in this project. With 2.12 we removed MessagesHandlerMixIn and merged it into the general PyLinter class. pylint-ignore is importing it and this is creating crashes. A quick search showed me that you're using it to patch certain functions. Perhaps there is anything we could do to provide you the things you need from pylint directly?

The issue I'm referring to is wapiti-scanner/wapiti#199
I'm tagging @JulienTD as you might be interested to see when this is fixed so you can remove the pin on pylint 😄

@mbarkhau
Copy link
Owner

mbarkhau commented Dec 3, 2021

We can pin our pylint dependency to <2.12 as a short term measure.

@mbarkhau
Copy link
Owner

mbarkhau commented Dec 5, 2021

A quick search showed me that you're using it to patch certain functions. Perhaps there is anything we could do to provide you the things you need from pylint directly?

The basic functionality pylint-ignore needs is to be able to selectively enable/disable individual messages.

@mbarkhau mbarkhau changed the title MessagesHandlerMixIn has been removed in 2.12 MessagesHandlerMixIn has been removed in 2.12 Dec 5, 2021
@DanielNoord
Copy link
Author

is_message_enabled and add_message are now defined on PyLinter. Since PyLinter subclasses MessagesHandlerMixIn on < 2.12 couldn't you patch it on PyLinter and then be compatible with both versions?

@mbarkhau
Copy link
Owner

mbarkhau commented Dec 8, 2021

couldn't you patch it on PyLinter and then be compatible with both versions?

Should be possible yes, there is already such fallback code for even older versions of pylint.

@RedHoodedWraith
Copy link

Hi,

I thought this might be relevant. I am have installed pylint-ignore on my Mac Mini (2018) running macOS Version 12.0.1. I can not even start pylint-ignore at all.

% pylint-ignore --version
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/pylint_ignore/__main__.py", line 44, in <module>
    from pylint.message.message_handler_mix_in import MessagesHandlerMixIn
ModuleNotFoundError: No module named 'pylint.message.message_handler_mix_in'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/bin/pylint-ignore", line 5, in <module>
    from pylint_ignore.__main__ import main
  File "/usr/local/lib/python3.9/site-packages/pylint_ignore/__main__.py", line 46, in <module>
    from pylint.utils import MessagesHandlerMixIn
ImportError: cannot import name 'MessagesHandlerMixIn' from 'pylint.utils' (/usr/local/lib/python3.9/site-packages/pylint/utils/__init__.py)

@mbarkhau
Copy link
Owner

Fixed with pylint-ignore==2021.1021.

@DanielNoord
Copy link
Author

I just saw you actually fixed the underlying issue and lifted the version restriction. Thanks for this, that also potentially decreases the number of issues raised against us 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants