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

Release v5.0.3 - ImportError: cannot import name 'ConfigFileFinder' #1652

Closed
vjeeva opened this issue Aug 3, 2022 · 3 comments
Closed

Release v5.0.3 - ImportError: cannot import name 'ConfigFileFinder' #1652

vjeeva opened this issue Aug 3, 2022 · 3 comments
Labels

Comments

@vjeeva
Copy link

vjeeva commented Aug 3, 2022

how did you install flake8?

poetry install flake8==5.0.3

unmodified output of flake8 --bug-report

This won't run either, due to the traceback.

describe the problem

what I expected to happen

$ flake8 .

Should just exit 0.

what I'm seeing

Traceback (most recent call last):
  File "/Users/vjeeva/.pyenv/versions/3.9.11/envs/pgbelt/lib/python3.9/site-packages/flake8/plugins/finder.py", line 296, in _load_plugin
    obj = plugin.entry_point.load()
  File "/Users/vjeeva/.pyenv/versions/3.9.11/lib/python3.9/importlib/metadata.py", line 86, in load
    module = import_module(match.group('module'))
  File "/Users/vjeeva/.pyenv/versions/3.9.11/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 850, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/Users/vjeeva/.pyenv/versions/3.9.11/envs/pgbelt/lib/python3.9/site-packages/flake8_bandit.py", line 10, in <module>
    from flake8.options.config import ConfigFileFinder
ImportError: cannot import name 'ConfigFileFinder' from 'flake8.options.config' (/Users/vjeeva/.pyenv/versions/3.9.11/envs/pgbelt/lib/python3.9/site-packages/flake8/options/config.py)

I see this both on my local Mac (running Python 3.9.11, Poetry 1.1.14), and my GitHub Actions CI (ubuntu-latest).

commands ran

$ flake8 .
@asottile
Copy link
Member

asottile commented Aug 3, 2022

flake8-bandit accesses private implementation details

@valeriupredoi
Copy link

@asottile this is a much wider issue reported by many others, see tholo/pytest-flake8#87 - I think you guys should have a closer look please 👍

@asottile
Copy link
Member

pytest-flake8 accesses private implementation detail

@PyCQA PyCQA locked as resolved and limited conversation to collaborators Aug 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants