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

Is this project dead? [a.k.a. Internal pylint version check throws exception] #24

Closed
mkielar opened this issue Apr 28, 2021 · 4 comments

Comments

@mkielar
Copy link

mkielar commented Apr 28, 2021

Python 3.8.3
pylint==2.8.2
pylint-quotes==0.2.1

See pylintrc in attached pylint_bug.zip

Running this configuration on a file containing:

foo = "bar"

results in an exception:

Traceback (most recent call last):
  File "/c/tmp/pylint_bug/venv/bin/pylint", line 10, in <module>
    sys.exit(run_pylint())
  File "/c/tmp/pylint_bug/venv/lib64/python3.8/site-packages/pylint/__init__.py", line 24, in run_pylint
    PylintRun(sys.argv[1:])
  File "/c/tmp/pylint_bug/venv/lib64/python3.8/site-packages/pylint/lint/run.py", line 381, in __init__
    linter.check(args)
  File "/c/tmp/pylint_bug/venv/lib64/python3.8/site-packages/pylint/lint/pylinter.py", line 873, in check
    self._check_files(
  File "/c/tmp/pylint_bug/venv/lib64/python3.8/site-packages/pylint/lint/pylinter.py", line 907, in _check_files
    self._check_file(get_ast, check_astroid_module, name, filepath, modname)
  File "/c/tmp/pylint_bug/venv/lib64/python3.8/site-packages/pylint/lint/pylinter.py", line 933, in _check_file
    check_astroid_module(ast_node)
  File "/c/tmp/pylint_bug/venv/lib64/python3.8/site-packages/pylint/lint/pylinter.py", line 1067, in check_astroid_module
    retval = self._check_astroid_module(
  File "/c/tmp/pylint_bug/venv/lib64/python3.8/site-packages/pylint/lint/pylinter.py", line 1110, in _check_astroid_module
    checker.process_tokens(tokens)
  File "/c/tmp/pylint_bug/venv/lib64/python3.8/site-packages/pylint_quotes/checker.py", line 259, in process_tokens
    self._process_string_token(token, start_row, start_col)
  File "/c/tmp/pylint_bug/venv/lib64/python3.8/site-packages/pylint_quotes/checker.py", line 295, in _process_string_token
    self._invalid_string_quote(
  File "/c/tmp/pylint_bug/venv/lib64/python3.8/site-packages/pylint_quotes/checker.py", line 341, in _invalid_string_quote
    **self.get_offset(col)
  File "/c/tmp/pylint_bug/venv/lib64/python3.8/site-packages/pylint_quotes/checker.py", line 360, in get_offset
    if (2, 2, 2) < pylint_version:
TypeError: '<' not supported between instances of 'int' and 'str'

Steps to reproduce:

python -m venv venv
. venv/bin/activate
pip install -r requirements.txt
pylint --rcfile pylintrc demo.py

Probable cause:

  1. pylint seems to have just changed versioning scheme: pylint-dev/pylint@pylint-2.8.1...v2.8.2
  2. Which broke this line: https://github.com/edaniszewski/pylint-quotes/blob/master/pylint_quotes/checker.py#L360
@rkhwaja
Copy link

rkhwaja commented May 3, 2021

It's broken with pylint 2.8.0 as well, 2.7.4 seems to work

@mkielar mkielar changed the title Internal pylint version check throws exception Internal pylint version check throws exception [a.k.a. Is this project dead?] May 20, 2021
@mkielar mkielar changed the title Internal pylint version check throws exception [a.k.a. Is this project dead?] Is this project dead? [a.k.a. Internal pylint version check throws exception] May 20, 2021
@mkielar
Copy link
Author

mkielar commented May 20, 2021

I'm just going to leave this here for anytone looking for a solution:

  1. pylint promised to reintroduce numeric versions in 2.8.3 to keep unmaintained zombies like this project pretend to still be alive. This was 3 weeks ago and 2.8.3 is still not out, and there's zero activity on this project to provide any fix.
  2. For anyone interested, there's also flake8 and its flake8-quotes, which will do the same if you wish to introduce another linter or replace pylint with flake8. Mind that flake8-quotes starts to look a bit like pylint-quotes with its maintainers stating that work's "halted for now due to lack of time"

We have moved on to using pylint's built-in check-quote-consistency. It's more lax, as it does not enforce single quotes everywhere, but it checks for quoting consistency, and that's still something.

@edaniszewski
Copy link
Owner

To answer the title of the issue, the project is not wholly dead, but similar to the quote in a subsequent comment made by flake8-quotes, I do have a lack of time to maintain this project with any sense of urgency.

While unfortunate, such is the life of an open source maintianer who also works a day job and experiences burn out. I'm working through this and hopefully will have a fix in place for this in within the day.

@edaniszewski
Copy link
Owner

Okay, just released a 0.2.2 version which should fix this. Sorry again for the delay, but thanks for the extensive write up + providing solutions in the intrim. Closing this out, but if the issue still persists with the 0.2.2 release, feel free to reopen / open a new issue!

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