Closed sbrunner closed 2 years ago
I have this same error and output using Python 3.9.9 with pip 21.3.1, installed only with prospector, black, pipenv, and all their respective dependencies. I use prospector with integration with vscode, so I am providing below a detailed error-message json, if it helps.
[{
"owner": "python",
"code": "failure",
"severity": 8,
"message": "Tool pylint failed to run (exception was raised, re-run prospector with -X to see the stacktrace)",
"source": "prospector - pylint",
"startLineNumber": 1,
"startColumn": 1,
"endLineNumber": 1,
"endColumn": 1
}]
below is my variation of this error:
% prospector -X
Traceback (most recent call last):
File "/usr/local/bin/prospector", line 8, in <module>
sys.exit(main())
File "/usr/local/lib/python3.9/site-packages/prospector/run.py", line 183, in main
prospector.execute()
File "/usr/local/lib/python3.9/site-packages/prospector/run.py", line 69, in execute
messages += tool.run(found_files)
File "/usr/local/lib/python3.9/site-packages/prospector/tools/pylint/__init__.py", line 259, in run
self._linter.check(self._args)
File "/usr/local/lib/python3.9/site-packages/pylint/lint/pylinter.py", line 996, in check
self._check_files(
File "/usr/local/lib/python3.9/site-packages/pylint/lint/pylinter.py", line 1031, in _check_files
with self._astroid_module_checker() as check_astroid_module:
File "/usr/local/Cellar/python@3.9/3.9.9/Frameworks/Python.framework/Versions/3.9/lib/python3.9/contextlib.py", line 119, in __enter__
return next(self.gen)
File "/usr/local/lib/python3.9/site-packages/pylint/lint/pylinter.py", line 1150, in _astroid_module_checker
checker.open()
File "/usr/local/lib/python3.9/site-packages/pylint/checkers/typecheck.py", line 918, in open
self._py310_plus = py_version >= (3, 10)
TypeError: '>=' not supported between instances of 'NoneType' and 'tuple'
and the freeze:
astroid==2.9.0
backports.entry-points-selectable==1.1.1
black==21.11b1
certifi==2021.10.8
click==8.0.3
distlib==0.3.3
dodgy==0.2.1
filelock==3.4.0
flake8==3.9.2
flake8-polyfill==1.0.2
isort==5.10.1
lazy-object-proxy==1.6.0
mccabe==0.6.1
mypy-extensions==0.4.3
pathspec==0.9.0
pep8-naming==0.10.0
pipenv==2021.11.23
platformdirs==2.4.0
prospector==1.5.1
pycodestyle==2.7.0
pydocstyle==6.1.1
pyflakes==2.3.1
pylint==2.12.1
pylint-celery==0.3
pylint-django==2.4.4
pylint-flask==0.6
pylint-plugin-utils==0.6
PyYAML==6.0
regex==2021.11.10
requirements-detector==0.7
setoptconf-tmp==0.3.1
six==1.16.0
snowballstemmer==2.2.0
toml==0.10.2
tomli==1.2.2
typing_extensions==4.0.0
virtualenv==20.10.0
virtualenv-clone==0.5.7
wrapt==1.13.3
pip install 'pylint<2.12.0'
What about releasing bugfix version of prospector with frozen pylint
dependency?
Working on it :) I'll make a bugfix first, then make a proper release later to fix compatibility.
(Note to self : this was also reported in pylint
- https://github.com/PyCQA/pylint/issues/5424)
1.5.2
is on PyPI now, just pinning the version.
CC @Pierre-Sassoulas you've self-assigned this - do you want to work on the compatibility fix? I just made the bugfix release so far to fix people's CI pipelines (hopefully). I'm happy to do it instead if you don't want to, but I don't want to step on your toes!
Thank you for doing the hot fix ! :)
I'm happy to do it instead if you don't want to, but I don't want to step on your toes!
I assigned it to me because it looked like a missing call to super() in a class prospector inherit and as I know pylint I could probably fix it without too much effort. And I did not expect you to show up 😉 But I did not have the time to work on it yet. This is a busy week, MR for pylint 2.13 are piling up. I'm relieved to see you stepped up honestly 😄
@Pierre-Sassoulas This appears to fix it- https://github.com/PyCQA/prospector/commit/380972f410dfe9ed7a7de15cd0d6ad8670da3213
For context that reset_options
was created a long time ago when if I remember correctly, it was necessary because it clashed with prospector trying to override pylint configuration options.
I've tested it locally, it seems to work fine now with latest pylint so I just removed this legacy code.
Have a quick look in case there's anything you think I'm missing, but it seems that the problem was that pylint now gathers information about the environment it runs in that prospector was then resetting, leaving pylint to break later.
I'll create a dev0 release for this and let people test it before making it a real release.
I forgot to comment this after I posted my last comment, but I have some results.
I changed my interpreter to python 3.10.0 with the same packages installed as above to experiment, and it worked just fine. I didn't get the same error and it showed the linting warnings for my code as it should.
Sorry if I'm just stating the obvious, just wanted to post this so everyone knows that prospector works with python 3.10
Prospector version 1.5.3.dev0
is now on pypi, as a pre-release. That should work fine, it's still just a pre-release while people can test it.
CC @sbrunner @maallaard @Pierre-Sassoulas
@carlio Just tested and that looks good, Thanks :-)
Closing, as 1.5.3 is now a full release which appears to fix this issue.
@carlio 1.5.3 does not fix this issue. we are still pinning < 2.12, not <= 2.12
Done (properly!) in 1.5.3.1
Describe the bug Just not working with the last version of PyLint
To Reproduce Steps to reproduce the behavior:
prospector -X
in an empty folder=>
Expected behavior No output, no error
Screenshots not applicable
Environment (please complete the following information):
Additional context python3.8 -m pip freeze: