[gdal-dev] pre-commit hook failure

Even Rouault even.rouault at spatialys.com
Fri Jun 7 10:49:52 PDT 2024


Andrew,

https://stackoverflow.com/questions/75591296/entrypoints-object-has-no-attribute-get-during-running-pre-commit 
would suggest that we should perhaps update the flake8 version in 
.pre-commit-config.yaml at the root of the GDAL source tree.

Can you give a try to https://github.com/OSGeo/gdal/pull/10163 ?

Even

Le 07/06/2024 à 19:36, Andrew Bell via gdal-dev a écrit :
> 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
>
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/gdal-dev

-- 
http://www.spatialys.com
My software is free, but my time generally not.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20240607/f552c77c/attachment.htm>


More information about the gdal-dev mailing list