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

AttributeError: 'EntryPoints' object has no attribute 'get' #257

Open
zamberjo opened this issue May 9, 2024 · 2 comments
Open

AttributeError: 'EntryPoints' object has no attribute 'get' #257

zamberjo opened this issue May 9, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@zamberjo
Copy link
Member

zamberjo commented May 9, 2024

Error when executing pre-commit with python3.12 (odoov16 I don't know if the same thing happens in other versions, I haven't been able to test it yet)

trim trailing whitespace.................................................Passed
fix end of files.........................................................Passed
debug statements (python)................................................Passed
fix python encoding pragma...............................................Passed
check for case conflicts.................................................Passed
check docstring is first.................................................Passed
check that executables have shebangs.................(no files to check)Skipped
check for merge conflicts................................................Passed
check for broken symlinks............................(no files to check)Skipped
check xml................................................................Passed
mixed line ending........................................................Passed
pyupgrade................................................................Passed
isort except __init__.py.................................................Passed
Generate default setup.py for an addons directory........................Passed
Generate requirements.txt for an addons directory........................Passed
flake8...................................................................Failed
- hook id: flake8
- exit code: 1

Traceback (most recent call last):
File "/root/.cache/pre-commit/repomm21bih1/py_env-python3/bin/flake8", line 8, in <module>
sys.exit(main())
^^^^^^
File "/root/.cache/pre-commit/repomm21bih1/py_env-python3/lib/python3.12/site-packages/flake8/main/cli.py", line 22, in main
app.run(argv)
File "/root/.cache/pre-commit/repomm21bih1/py_env-python3/lib/python3.12/site-packages/flake8/main/application.py", line 363, in run
self._run(argv)
File "/root/.cache/pre-commit/repomm21bih1/py_env-python3/lib/python3.12/site-packages/flake8/main/application.py", line 350, in _run
self.initialize(argv)
File "/root/.cache/pre-commit/repomm21bih1/py_env-python3/lib/python3.12/site-packages/flake8/main/application.py", line 330, in initialize
self.find_plugins(config_finder)
File "/root/.cache/pre-commit/repomm21bih1/py_env-python3/lib/python3.12/site-packages/flake8/main/application.py", line 153, in find_plugins
self.check_plugins = plugin_manager.Checkers(local_plugins.extension)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/.cache/pre-commit/repomm21bih1/py_env-python3/lib/python3.12/site-packages/flake8/plugins/manager.py", line 356, in __init__
self.manager = PluginManager(
^^^^^^^^^^^^^^
File "/root/.cache/pre-commit/repomm21bih1/py_env-python3/lib/python3.12/site-packages/flake8/plugins/manager.py", line 238, in __init__
self._load_entrypoint_plugins()
File "/root/.cache/pre-commit/repomm21bih1/py_env-python3/lib/python3.12/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'

pylint with optional checks..............................................Passed
- hook id: pylint_odoo
- duration: 10.3s
Check for Odoo modules using pylint......................................Passed

I have checked that in python3.11 it works correctly, and that the python bin to use is python3, maybe we should pine it for the moment to python3.11?

PS: I got the trace from a docker container, not that I run it with root :P

@zamberjo zamberjo added the bug Something isn't working label May 9, 2024
@legalsylvain
Copy link
Contributor

This looks quite similar to this PR, dont you think ?

#243

Could you review it ? Thanks !

@zamberjo
Copy link
Member Author

zamberjo commented May 9, 2024

I had not seen it sorry, it looks pretty good, much better than pinning the Python version.

I'll check it out, thanks @legalsylvain

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants