]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
[pre-commit] add 'tomli' dependency for codespell pre-commit hook
authorRohr, Stephan <stephan.rohr@intel.com>
Tue, 28 Jul 2026 08:01:13 +0000 (10:01 +0200)
committerTom de Vries <tdevries@suse.de>
Tue, 28 Jul 2026 08:01:13 +0000 (10:01 +0200)
The codespell pre-commit hook imports the 'tomllib' module to parse
'pyproject.toml'.  'tomllib' is not available for Python versions 3.10
and older.  Add a dependency on 'tomli' so the hook also works on these
Python versions.

Approved-By: Tom de Vries <tdevries@suse.de>
.pre-commit-config.yaml

index 66cbc117dfc6432fbc877f58decf68e7055ef578..8ff84dae274f802e1b8208bb23227660a1b890e5 100644 (file)
@@ -86,10 +86,13 @@ repos:
       - id: codespell
         args: &codespell_args [--toml, gdb/pyproject.toml]
         files: &gdb_files '^(gdb|gdbserver|gdbsupport)/'
+        # 'tomllib' library is not available on Python < 3.11.
+        additional_dependencies: &codespell_deps ['tomli']
       - id: codespell
         name: codespell-log
         entry: gdb/contrib/codespell-log.sh
         args: *codespell_args
+        additional_dependencies: *codespell_deps
         verbose: true
         stages: [commit-msg]