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

flake8 and importlib_metadata 5.0 support #1701

Closed
tony opened this issue Oct 2, 2022 · 5 comments
Closed

flake8 and importlib_metadata 5.0 support #1701

tony opened this issue Oct 2, 2022 · 5 comments
Labels

Comments

@tony
Copy link

tony commented Oct 2, 2022

flake8: 3.9.2
importlib-metadata: 5.0.0

how did you install flake8?

$ poetry install

unmodified output of flake8 --bug-report

{}

describe the problem

what I expected to happen

Normal usage

Traceback (most recent call last):
  File "/project/.venv/bin/flake8", line 8, in <module>
    sys.exit(main())
  File "/project/.venv/lib/python3.7/site-packages/flake8/main/cli.py", line 22, in main
    app.run(argv)
  File "/project/.venv/lib/python3.7/site-packages/flake8/main/application.py", line 363, in run
    self._run(argv)
  File "/project/.venv/lib/python3.7/site-packages/flake8/main/application.py", line 350, in _run
    self.initialize(argv)
  File "/project/.venv/lib/python3.7/site-packages/flake8/main/application.py", line 330, in initialize
    self.find_plugins(config_finder)
  File "/project/.venv/lib/python3.7/site-packages/flake8/main/application.py", line 153, in find_plugins
    self.check_plugins = plugin_manager.Checkers(local_plugins.extension)
  File "/project/.venv/lib/python3.7/site-packages/flake8/plugins/manager.py", line 357, in __init__
    self.namespace, local_plugins=local_plugins
  File "/project/.venv/lib/python3.7/site-packages/flake8/plugins/manager.py", line 238, in __init__
    self._load_entrypoint_plugins()
  File "/project/.venv/lib/python3.7/site-packages/flake8/plugins/manager.py", line 254, in _load_entrypoint_plugins
    eps = importlib_metadata.entry_points().get(self.namespace, ())
AttributeError: 'EntryPoints' object has no attribute 'get'

sample code

commands ran

$ flake8
...
@tony tony changed the title flake8 w/ importlib_metadata flake8 and importlib_metadata 5.0 support Oct 2, 2022
@asottile
Copy link
Member

asottile commented Oct 2, 2022

please actually fill out the issue template and make sure to include your version info (hint hint)

@tony
Copy link
Author

tony commented Oct 2, 2022

@asottile Sorry about that, I had it in edit in another tab and added it in.

@asottile
Copy link
Member

asottile commented Oct 2, 2022

you're 2 major versions of flake8 out of date

@tony
Copy link
Author

tony commented Oct 2, 2022

Good point.

I came here through python/importlib_metadata#406, and use poetry, and it has a dependency of flake8 < 5: https://github.com/python/importlib_metadata/blob/v5.0.0/setup.cfg#L38

Will go back to them.

dainnilsson added a commit to Yubico/python-fido2 that referenced this issue Oct 17, 2022
See: PyCQA/flake8#1701
This hopefully gets resolved in flake8 and can be re-enabled.
auphofBSF pushed a commit to auphofBSF/sqlmodel that referenced this issue Oct 18, 2022
flake8 not compatible with 22Oct1 release of  importlib_metadata v5
see PyCQA/flake8#1701
set importlib_metadata to 4.13.0
@sfc-gh-mkeller
Copy link

Just wanted to share my mistake to maybe save someone else some time.
I had an old git link in my .pre-commit-config.yaml.

-  repo: https://gitlab.com/pycqa/flake8
+  repo: https://github.com/PyCQA/flake8

Rahix added a commit to Rahix/tbot that referenced this issue Oct 20, 2022
Use latest versions of all the hooks which we include.

flake8 has moved to GitHub which means we tracked a stale repo
until now [1].  Update to the correct upstream.

[1]: PyCQA/flake8#1701
progval added a commit to progval/irctest that referenced this issue Oct 22, 2022
Fixes support for importlib_metadata 5.0.0,
PyCQA/flake8#1701
fmigneault added a commit to Ouranosinc/Magpie that referenced this issue Dec 12, 2022
davidag added a commit to pelican-plugins/feed-filter that referenced this issue Jan 25, 2023
This was causing problems in CI due to this issue:
PyCQA/flake8#1701
samuller added a commit to samuller/genuml that referenced this issue Nov 3, 2023
Have to update to Python 3.8+ so we can get flake8 v6 because v5 has this issue (on Python 3.7): PyCQA/flake8#1701
HorlogeSkynet added a commit to cclauss/distro that referenced this issue Nov 29, 2023
facebook-github-bot pushed a commit to facebook/pyre-check that referenced this issue Apr 25, 2024
…833)

Summary:
**Pre-submission checklist**
- [x] I've ran the linters locally and fixed lint errors related to the files I modified in this PR. You can install the linters by running `pip install -r requirements-dev.txt && pre-commit install`
- [x] `pre-commit run`

```diff
 repos:
 - repo: https://github.com/pycqa/flake8
-  rev: 4.0.1
+  rev: 7.0.0
   hooks:
   - id: flake8
```
As discussed at:
* PyCQA/flake8#1701

Pull Request resolved: #833

Test Plan:
For test failures on Python < 3.10 see:
* #832

Reviewed By: grievejia

Differential Revision: D56535569

Pulled By: migeed-z

fbshipit-source-id: 576cccafeca06e6ebe1290bcd115c53e4a07fbc2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants