Closed valeriupredoi closed 1 day ago
Hi there, thank you for the report, I will add it to my TODO list along with https://github.com/pylint-dev/pylint-django/issues/405 to handle some small changes needed to support the pylint3 release
Good man, Carl! Cheers :beer:
Is there anything I can do to help resolve this? I'm still running into the issue originally noted in #651.
The pipeline is broken on main, there's a potential fix in https://github.com/landscapeio/prospector/pull/658, you can review that, or propose another approach. Then https://github.com/landscapeio/prospector/pull/645 is addressing this issue directly and could be merged after a rebase.
@ryancausey cheers, mate! That's what my take is too - also, one clue is that workaround in #658 is needed only for when tests run on Github Actions, local tests run fine without it - beats me what changes in the file that the test runs on GA, but I suspect that's just a minor change like a trailing white space or some newline char, that gets picked up by the pyroma
test
658 seems like a reasonable workaround to get 3.12 support out the door, but I'm also not an expert in prospector or pyroma. Assuming there are other pyroma tests in the suite, there should be some confidence that it doesn't actually break prospector's integration with pyroma.
@Pierre-Sassoulas was my review above of any use?
Anything more I can do to help move this along?
Sorry that I have been absent for a while, I will try to get onto this in the next few days...
very happy to see you back @carlio - we was getting concerned :beer:
hey @carlio, any status update on this?
@carlio anything I can do to help move this along?
Sorry to ask again, but @carlio is there anything I can do to help resolve this? Prospector is currently the only dependency blocking me from moving a lot of projects to Python 3.12.
Sorry to ask again, but @carlio is there anything I can do to help resolve this? Prospector is currently the only dependency blocking me from moving a lot of projects to Python 3.12.
I am in the same boat. Any updates on this?
Hey @Pierre-Sassoulas , is this something that can be picked up by another contributor in @carlio 's absence? Or is there any perspective/ETA on this? Should the community start looking for alternatives? Thanks
As far as I remember the blocker is a review for https://github.com/landscapeio/prospector/pull/658 where I don't have enough knowledge in prospector to decide if this is the right way to fix the pipeline or not. After that a lot of pipeline will be able to be rebased and merged/upgraded once the pipeline is green.
The new blocker for pylint 3.0+ is requirements detector that is incompatible with it because it requires astroid between 2 and 3 and pylint requires astroid 3+.
This MR needs to be merged and released: https://github.com/landscapeio/requirements-detector/pull/49, and I can't do it
@Pierre-Sassoulas Thanks for the release, it makes Prospector compatible with Python 3.12
Hi @Pierre-Sassoulas
Thank you for giving it your best to get this moving along!
Went and done some testing at my end this morning, now on python 3.12 and prospector on 1.11.0 without being fully successful.
A full on error on astroid, but i suppose that is related to your statements around astroid, as well as false positives relating to native django. In the case of those files, they are not even explicitly importing those files. But i guess that may also have been dealt with in pylint 3.
I guess now we wait again.
REDACTED_PATH.py
Line: 1
pylint: astroid-error / /REDACTED_PATH.py: Fatal error while checking '/REDACTED_PATH'. Please open an issue in our bug tracker so we address this. There is a pre-filled template that you can use in '/home/REDACTED/.cache/pylint/pylint-crash-2024-10-04-10-03-12.txt'.
pylint: ungrouped-imports / Imports from package django are not grouped
pylint: wrong-import-order / third party import "from django.conf import settings" should be placed before "from app.REDACTED import REDACTED"
pylint: wrong-import-position / Import "from django.conf import settings" should be placed at the top of the module
Line: 3
pylint: ungrouped-imports / Imports from package app are not grouped
pylint: wrong-import-position / Import "from app.REDACTED import REDACTED" should be placed at the top of the module
Hey @robertalexa do you mind showing the content of /home/REDACTED/.cache/pylint/pylint-crash-2024-10-04-10-03-12.txt
, please ? (At least the traceback without the code)
Hi @Pierre-Sassoulas
See below traceback. I have omitted the code completely, but if this becomes mandatory i will do my best to provide a non-sensitive version of it.
Thanks for the effort you are putting in to support us with this transition!
pylint crashed with a AstroidError
and with the following stacktrace:
Traceback (most recent call last):
File "/home/REDACTED/.local/lib/python3.12/site-packages/pylint/checkers/utils.py", line 1390, in safe_infer
value = next(infer_gen)
^^^^^^^^^^^^^^^
File "/home/REDACTED/.local/lib/python3.12/site-packages/astroid/nodes/node_ng.py", line 171, in infer
yield from self._infer(context=context, **kwargs)
File "/home/REDACTED/.local/lib/python3.12/site-packages/astroid/decorators.py", line 143, in raise_if_nothing_inferred
yield next(generator)
^^^^^^^^^^^^^^^
File "/home/REDACTED/.local/lib/python3.12/site-packages/astroid/decorators.py", line 112, in wrapped
for res in _func(node, context, **kwargs):
File "/home/REDACTED/.local/lib/python3.12/site-packages/astroid/bases.py", line 177, in _infer_stmts
for inf in stmt.infer(context=context):
File "/home/REDACTED/.local/lib/python3.12/site-packages/astroid/nodes/node_ng.py", line 184, in infer
for i, result in enumerate(self._infer(context=context, **kwargs)):
File "/home/REDACTED/.local/lib/python3.12/site-packages/astroid/decorators.py", line 143, in raise_if_nothing_inferred
yield next(generator)
^^^^^^^^^^^^^^^
File "/home/REDACTED/.local/lib/python3.12/site-packages/astroid/decorators.py", line 112, in wrapped
for res in _func(node, context, **kwargs):
File "/home/REDACTED/.local/lib/python3.12/site-packages/astroid/bases.py", line 177, in _infer_stmts
for inf in stmt.infer(context=context):
File "/home/REDACTED/.local/lib/python3.12/site-packages/astroid/nodes/node_ng.py", line 184, in infer
for i, result in enumerate(self._infer(context=context, **kwargs)):
File "/home/REDACTED/.local/lib/python3.12/site-packages/astroid/decorators.py", line 143, in raise_if_nothing_inferred
yield next(generator)
^^^^^^^^^^^^^^^
File "/home/REDACTED/.local/lib/python3.12/site-packages/astroid/decorators.py", line 112, in wrapped
for res in _func(node, context, **kwargs):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/REDACTED/.local/lib/python3.12/site-packages/astroid/inference.py", line 334, in infer_import_from
module = self.do_import_module()
^^^^^^^^^^^^^^^^^^^^^^^
File "/home/REDACTED/.local/lib/python3.12/site-packages/astroid/nodes/_base_nodes.py", line 146, in do_import_module
return mymodule.import_module(
^^^^^^^^^^^^^^^^^^^^^^^
File "/home/REDACTED/.local/lib/python3.12/site-packages/astroid/nodes/scoped_nodes/scoped_nodes.py", line 530, in import_module
return AstroidManager().ast_from_module_name(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/REDACTED/.local/lib/python3.12/site-packages/astroid/manager.py", line 246, in ast_from_module_name
return self.ast_from_file(found_spec.location, modname, fallback=False)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/REDACTED/.local/lib/python3.12/site-packages/astroid/manager.py", line 138, in ast_from_file
return AstroidBuilder(self).file_build(filepath, modname)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/REDACTED/.local/lib/python3.12/site-packages/astroid/builder.py", line 145, in file_build
return self._post_build(module, builder, encoding)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/REDACTED/.local/lib/python3.12/site-packages/astroid/builder.py", line 169, in _post_build
self.delayed_assattr(delayed)
File "/home/REDACTED/.local/lib/python3.12/site-packages/astroid/builder.py", line 240, in delayed_assattr
for inferred in node.expr.infer():
File "/home/REDACTED/.local/lib/python3.12/site-packages/astroid/nodes/node_ng.py", line 171, in infer
yield from self._infer(context=context, **kwargs)
File "/home/REDACTED/.local/lib/python3.12/site-packages/astroid/decorators.py", line 143, in raise_if_nothing_inferred
yield next(generator)
^^^^^^^^^^^^^^^
File "/home/REDACTED/.local/lib/python3.12/site-packages/astroid/decorators.py", line 112, in wrapped
for res in _func(node, context, **kwargs):
File "/home/REDACTED/.local/lib/python3.12/site-packages/astroid/bases.py", line 177, in _infer_stmts
for inf in stmt.infer(context=context):
File "/home/REDACTED/.local/lib/python3.12/site-packages/astroid/nodes/node_ng.py", line 184, in infer
for i, result in enumerate(self._infer(context=context, **kwargs)):
File "/home/REDACTED/.local/lib/python3.12/site-packages/astroid/decorators.py", line 143, in raise_if_nothing_inferred
yield next(generator)
^^^^^^^^^^^^^^^
File "/home/REDACTED/.local/lib/python3.12/site-packages/astroid/decorators.py", line 112, in wrapped
for res in _func(node, context, **kwargs):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/REDACTED/.local/lib/python3.12/site-packages/astroid/inference.py", line 1162, in infer_assign
stmts = list(self.assigned_stmts(context=context))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/REDACTED/.local/lib/python3.12/site-packages/astroid/protocols.py", line 412, in _arguments_infer_argname
is_metaclass = isinstance(cls, nodes.ClassDef) and cls.type == "metaclass"
^^^^^^^^
File "/home/REDACTED/.local/lib/python3.12/site-packages/astroid/nodes/scoped_nodes/scoped_nodes.py", line 1874, in _class_type
if _is_metaclass(klass):
^^^^^^^^^^^^^^^^^^^^
File "/home/REDACTED/.local/lib/python3.12/site-packages/astroid/nodes/scoped_nodes/scoped_nodes.py", line 1845, in _is_metaclass
for baseobj in base.infer():
File "/home/REDACTED/.local/lib/python3.12/site-packages/astroid/nodes/node_ng.py", line 171, in infer
yield from self._infer(context=context, **kwargs)
File "/home/REDACTED/.local/lib/python3.12/site-packages/astroid/decorators.py", line 143, in raise_if_nothing_inferred
yield next(generator)
^^^^^^^^^^^^^^^
File "/home/REDACTED/.local/lib/python3.12/site-packages/astroid/decorators.py", line 112, in wrapped
for res in _func(node, context, **kwargs):
File "/home/REDACTED/.local/lib/python3.12/site-packages/astroid/inference.py", line 358, in infer_attribute
for owner in self.expr.infer(context):
File "/home/REDACTED/.local/lib/python3.12/site-packages/astroid/nodes/node_ng.py", line 184, in infer
for i, result in enumerate(self._infer(context=context, **kwargs)):
File "/home/REDACTED/.local/lib/python3.12/site-packages/astroid/decorators.py", line 143, in raise_if_nothing_inferred
yield next(generator)
^^^^^^^^^^^^^^^
File "/home/REDACTED/.local/lib/python3.12/site-packages/astroid/decorators.py", line 112, in wrapped
for res in _func(node, context, **kwargs):
File "/home/REDACTED/.local/lib/python3.12/site-packages/astroid/bases.py", line 177, in _infer_stmts
for inf in stmt.infer(context=context):
File "/home/REDACTED/.local/lib/python3.12/site-packages/astroid/nodes/node_ng.py", line 184, in infer
for i, result in enumerate(self._infer(context=context, **kwargs)):
File "/home/REDACTED/.local/lib/python3.12/site-packages/astroid/decorators.py", line 143, in raise_if_nothing_inferred
yield next(generator)
^^^^^^^^^^^^^^^
File "/home/REDACTED/.local/lib/python3.12/site-packages/astroid/decorators.py", line 112, in wrapped
for res in _func(node, context, **kwargs):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/REDACTED/.local/lib/python3.12/site-packages/astroid/inference.py", line 341, in infer_import_from
stmts = module.getattr(name, ignore_locals=module is self.root())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/REDACTED/.local/lib/python3.12/site-packages/astroid/nodes/scoped_nodes/scoped_nodes.py", line 414, in getattr
result = [self.import_module(name, relative_only=True)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/REDACTED/.local/lib/python3.12/site-packages/astroid/nodes/scoped_nodes/scoped_nodes.py", line 530, in import_module
return AstroidManager().ast_from_module_name(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/REDACTED/.local/lib/python3.12/site-packages/astroid/manager.py", line 246, in ast_from_module_name
return self.ast_from_file(found_spec.location, modname, fallback=False)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/REDACTED/.local/lib/python3.12/site-packages/astroid/manager.py", line 138, in ast_from_file
return AstroidBuilder(self).file_build(filepath, modname)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/REDACTED/.local/lib/python3.12/site-packages/astroid/builder.py", line 145, in file_build
return self._post_build(module, builder, encoding)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/REDACTED/.local/lib/python3.12/site-packages/astroid/builder.py", line 169, in _post_build
self.delayed_assattr(delayed)
File "/home/REDACTED/.local/lib/python3.12/site-packages/astroid/builder.py", line 240, in delayed_assattr
for inferred in node.expr.infer():
File "/home/REDACTED/.local/lib/python3.12/site-packages/astroid/nodes/node_ng.py", line 171, in infer
yield from self._infer(context=context, **kwargs)
File "/home/REDACTED/.local/lib/python3.12/site-packages/astroid/decorators.py", line 143, in raise_if_nothing_inferred
yield next(generator)
^^^^^^^^^^^^^^^
File "/home/REDACTED/.local/lib/python3.12/site-packages/astroid/decorators.py", line 112, in wrapped
for res in _func(node, context, **kwargs):
File "/home/REDACTED/.local/lib/python3.12/site-packages/astroid/bases.py", line 177, in _infer_stmts
for inf in stmt.infer(context=context):
File "/home/REDACTED/.local/lib/python3.12/site-packages/astroid/nodes/node_ng.py", line 184, in infer
for i, result in enumerate(self._infer(context=context, **kwargs)):
File "/home/REDACTED/.local/lib/python3.12/site-packages/astroid/decorators.py", line 143, in raise_if_nothing_inferred
yield next(generator)
^^^^^^^^^^^^^^^
File "/home/REDACTED/.local/lib/python3.12/site-packages/astroid/decorators.py", line 112, in wrapped
for res in _func(node, context, **kwargs):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/REDACTED/.local/lib/python3.12/site-packages/astroid/inference.py", line 1162, in infer_assign
stmts = list(self.assigned_stmts(context=context))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/REDACTED/.local/lib/python3.12/site-packages/astroid/protocols.py", line 412, in _arguments_infer_argname
is_metaclass = isinstance(cls, nodes.ClassDef) and cls.type == "metaclass"
^^^^^^^^
File "/home/REDACTED/.local/lib/python3.12/site-packages/astroid/nodes/scoped_nodes/scoped_nodes.py", line 1874, in _class_type
if _is_metaclass(klass):
^^^^^^^^^^^^^^^^^^^^
File "/home/REDACTED/.local/lib/python3.12/site-packages/astroid/nodes/scoped_nodes/scoped_nodes.py", line 1845, in _is_metaclass
for baseobj in base.infer():
File "/home/REDACTED/.local/lib/python3.12/site-packages/astroid/nodes/node_ng.py", line 171, in infer
yield from self._infer(context=context, **kwargs)
File "/home/REDACTED/.local/lib/python3.12/site-packages/astroid/decorators.py", line 143, in raise_if_nothing_inferred
yield next(generator)
^^^^^^^^^^^^^^^
File "/home/REDACTED/.local/lib/python3.12/site-packages/astroid/decorators.py", line 112, in wrapped
for res in _func(node, context, **kwargs):
File "/home/REDACTED/.local/lib/python3.12/site-packages/astroid/inference.py", line 431, in infer_subscript
for value in self.value.infer(context):
File "/home/REDACTED/.local/lib/python3.12/site-packages/astroid/nodes/node_ng.py", line 184, in infer
for i, result in enumerate(self._infer(context=context, **kwargs)):
File "/home/REDACTED/.local/lib/python3.12/site-packages/astroid/decorators.py", line 143, in raise_if_nothing_inferred
yield next(generator)
^^^^^^^^^^^^^^^
File "/home/REDACTED/.local/lib/python3.12/site-packages/astroid/decorators.py", line 112, in wrapped
for res in _func(node, context, **kwargs):
File "/home/REDACTED/.local/lib/python3.12/site-packages/astroid/bases.py", line 177, in _infer_stmts
for inf in stmt.infer(context=context):
File "/home/REDACTED/.local/lib/python3.12/site-packages/astroid/nodes/node_ng.py", line 184, in infer
for i, result in enumerate(self._infer(context=context, **kwargs)):
File "/home/REDACTED/.local/lib/python3.12/site-packages/astroid/decorators.py", line 143, in raise_if_nothing_inferred
yield next(generator)
^^^^^^^^^^^^^^^
File "/home/REDACTED/.local/lib/python3.12/site-packages/astroid/decorators.py", line 112, in wrapped
for res in _func(node, context, **kwargs):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/REDACTED/.local/lib/python3.12/site-packages/astroid/inference.py", line 334, in infer_import_from
module = self.do_import_module()
^^^^^^^^^^^^^^^^^^^^^^^
File "/home/REDACTED/.local/lib/python3.12/site-packages/astroid/nodes/_base_nodes.py", line 146, in do_import_module
return mymodule.import_module(
^^^^^^^^^^^^^^^^^^^^^^^
File "/home/REDACTED/.local/lib/python3.12/site-packages/astroid/nodes/scoped_nodes/scoped_nodes.py", line 530, in import_module
return AstroidManager().ast_from_module_name(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/REDACTED/.local/lib/python3.12/site-packages/astroid/manager.py", line 246, in ast_from_module_name
return self.ast_from_file(found_spec.location, modname, fallback=False)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/REDACTED/.local/lib/python3.12/site-packages/astroid/manager.py", line 138, in ast_from_file
return AstroidBuilder(self).file_build(filepath, modname)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/REDACTED/.local/lib/python3.12/site-packages/astroid/builder.py", line 144, in file_build
module, builder = self._data_build(data, modname, path)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/REDACTED/.local/lib/python3.12/site-packages/astroid/builder.py", line 204, in _data_build
module = builder.visit_module(node, modname, node_file, package)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/REDACTED/.local/lib/python3.12/site-packages/astroid/rebuilder.py", line 254, in visit_module
[self.visit(child, newnode) for child in node.body],
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/REDACTED/.local/lib/python3.12/site-packages/astroid/rebuilder.py", line 609, in visit
visit_method = getattr(self, visit_name)
^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'TreeRebuilder' object has no attribute 'visit_typealias'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/REDACTED/.local/lib/python3.12/site-packages/pylint/lint/pylinter.py", line 811, in _lint_file
check_astroid_module(module)
File "/home/REDACTED/.local/lib/python3.12/site-packages/pylint/lint/pylinter.py", line 1085, in check_astroid_module
retval = self._check_astroid_module(
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/REDACTED/.local/lib/python3.12/site-packages/pylint/lint/pylinter.py", line 1135, in _check_astroid_module
walker.walk(node)
File "/home/REDACTED/.local/lib/python3.12/site-packages/pylint/utils/ast_walker.py", line 94, in walk
self.walk(child)
File "/home/REDACTED/.local/lib/python3.12/site-packages/pylint/utils/ast_walker.py", line 94, in walk
self.walk(child)
File "/home/REDACTED/.local/lib/python3.12/site-packages/pylint/utils/ast_walker.py", line 91, in walk
callback(astroid)
File "/home/REDACTED/.local/lib/python3.12/site-packages/pylint/checkers/refactoring/refactoring_checker.py", line 1528, in visit_assign
self._append_context_managers_to_stack(node)
File "/home/REDACTED/.local/lib/python3.12/site-packages/pylint/checkers/refactoring/refactoring_checker.py", line 1583, in _append_context_managers_to_stack
inferred = utils.safe_infer(value.func)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/REDACTED/.local/lib/python3.12/site-packages/pylint/checkers/utils.py", line 1394, in safe_infer
raise AstroidError from e
astroid.exceptions.AstroidError
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/REDACTED/.local/lib/python3.12/site-packages/pylint/lint/pylinter.py", line 775, in _lint_files
self._lint_file(fileitem, module, check_astroid_module)
File "/home/REDACTED/.local/lib/python3.12/site-packages/pylint/lint/pylinter.py", line 813, in _lint_file
raise astroid.AstroidError from e
astroid.exceptions.AstroidError
Ha ! pip only finds a match for pylint < 3 for python 3.12 (2.17.7) because there's a problem with pylint metadata. We assume astroid is going to be usable with next version of python interpreter because it's often the case, but in this case there's actually a fix to do that is only in pylint 3.0. So we do need #671 to be merged and a new release of prospector to be made.
Hey fellas, a quick touching base from one of your conda-feedstock maintainers here - the new v1.10.3 builds well now https://github.com/conda-forge/prospector-feedstock/pull/43 - but I had to pin upper
pylint
to<3
, see failed test withpylint=3
- and since I vaguely understand poetry environment files, I wanted to double checkpylint
is upper pinned to <3 upstream (here) too. Incidentally, Python 3.12 support seems to work fine for you, so I'd suggest you included a Github Action test for 3.12 as well (seen you guys have them all Pythons but no 3.12 GA test yet). Cheers and keep up the good work :beer: