[gdal-dev] pre-commit hook failure

Andrew Bell andrew.bell.ia at gmail.com
Fri Jun 7 10:36:40 PDT 2024


Hi,

I'm getting an error when flake8 runs as a pre-commit hook and it won't
allow me to commit code. My understanding was that the pre-commit stuff was
supposed to make sure the proper versions were found. Ideas?

(gdal) [viewshed-oor] $ git commit
black....................................................................Passed
isort....................................................................Passed
flake8...................................................................Failed
- hook id: flake8
- exit code: 1

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

--
Andrew Bell
andrew.bell.ia at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20240607/54de63f0/attachment-0001.htm>


More information about the gdal-dev mailing list