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

[BUG] AttributeError: 'FileFinder' object has no attribute 'check_module' #547

Closed
patrickmagyarskaylink opened this issue Dec 1, 2022 · 2 comments

Comments

@patrickmagyarskaylink
Copy link

patrickmagyarskaylink commented Dec 1, 2022

Hello

Describe the bug A clear and concise description of what the bug is.
Prospector ends up with stacktrace:

Traceback (most recent call last):
  File "/drone/src/.pre-commit-cache/repoufibcgo8/py_env-python3.9/lib/python3.9/site-packages/prospector/run.py", line 87, in execute
    messages += tool.run(found_files)
  File "/drone/src/.pre-commit-cache/repoufibcgo8/py_env-python3.9/lib/python3.9/site-packages/prospector/tools/pylint/__init__.py", line 239, in run
    self._linter.check(self._args)
  File "/drone/src/.pre-commit-cache/repoufibcgo8/py_env-python3.9/lib/python3.9/site-packages/pylint/lint/pylinter.py", line 696, in check
    ast_per_fileitem = self._get_asts(fileitems, data)
  File "/drone/src/.pre-commit-cache/repoufibcgo8/py_env-python3.9/lib/python3.9/site-packages/pylint/lint/pylinter.py", line 707, in _get_asts
    for fileitem in fileitems:
  File "/drone/src/.pre-commit-cache/repoufibcgo8/py_env-python3.9/lib/python3.9/site-packages/pylint/lint/pylinter.py", line 874, in _iterate_file_descrs
    for descr in self._expand_files(files_or_modules).values():
  File "/drone/src/.pre-commit-cache/repoufibcgo8/py_env-python3.9/lib/python3.9/site-packages/prospector/tools/pylint/linter.py", line 29, in _expand_files
    if self._files.check_module(module):
AttributeError: 'FileFinder' object has no attribute 'check_module'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/drone/src/.pre-commit-cache/repoufibcgo8/py_env-python3.9/bin/prospector", line 8, in <module>
    sys.exit(main())
  File "/drone/src/.pre-commit-cache/repoufibcgo8/py_env-python3.9/lib/python3.9/site-packages/prospector/run.py", line 199, in main
    prospector.execute()
  File "/drone/src/.pre-commit-cache/repoufibcgo8/py_env-python3.9/lib/python3.9/site-packages/prospector/run.py", line 105, in execute
    raise FatalProspectorException(f"Tool {toolname} failed to run.") from ex
prospector.exceptions.FatalProspectorException: Tool pylint failed to run.

This happens with prospector version 1.8.0 and 1.8.1 and pylint version 2.15.7 since #529 was processed.

To Reproduce Steps to reproduce the behavior:

  1. install prospector version 1.8.1
  2. install pylint version 2.15.7
  3. Call prospector the following way 'prospector -X foobar.py'
  4. See error

or with pre-commit:

---
repos:
  - repo: https://github.com/PyCQA/prospector
    rev: v1.8.1
    hooks:
      - id: prospector
        args:
          - '-X'
        additional_dependencies:
          - bandit
          - pylint==2.15.7

Expected behavior A clear and concise description of what you expected to happen.
working with latest pylint version

Screenshots If applicable, add screenshots to help explain your problem.
/

Environment (please complete the following information):

  • OS:
(venv) 4a00c39b9e9b:/drone/src# uname -a
Linux 4a00c39b9e9b 5.4.0-1084-aws #91~18.04.1-Ubuntu SMP Sun Aug 14 01:24:43 UTC 2022 x86_64 Linux
(venv) 4a00c39b9e9b:/drone/src# cat /etc/os-release
NAME="Alpine Linux"
ID=alpine
VERSION_ID=3.14.8
PRETTY_NAME="Alpine Linux v3.14"
HOME_URL="https://alpinelinux.org/"
BUG_REPORT_URL="https://bugs.alpinelinux.org/"
  • Tool: pylint 2.15.7
  • Prospector version: 1.8.1
  • Python version 3.9.15

Additional context
Temp fix:
use pylint version 2.15.6
pre-commit example:

---
repos:
  - repo: https://github.com/PyCQA/prospector
    rev: v1.8.1
    hooks:
      - id: prospector
        args:
          - '-X'

        additional_dependencies:
          - bandit
          - pylint==2.15.6
@mab-fas
Copy link

mab-fas commented Dec 2, 2022

I have exactly the same issue on a fresh setup with VS Code on a Raspberry Pi 3B:
Linux 5.15.76-v7+ armv7l GNU/Linux
prospector 1.8.1
pylint 2.15.7
Python 3.9.2

@bessman
Copy link
Contributor

bessman commented Dec 2, 2022

Quick bisect points to 788e936 as causing the breakage. Don't see an obvious reason why, though.

Edit: Oh, it's a merge commit. The actual breakage is in d5f2650, which completely revamped the file finding mechanism.

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

No branches or pull requests

3 participants