diff --git a/pyproject.toml b/pyproject.toml
index c27943fca8d2354cb6a090fdcfa0b95a5795115a..a0e7897b2999b2b23fbdb7f8676eccbe04effbf6 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -63,7 +63,7 @@ Source = "https://github.com/executablebooks/jupyter-book/"
 Tracker = "https://github.com/executablebooks/jupyter-book/issues"
 
 [project.optional-dependencies]
-code_style = ["pre-commit~=2.12"]
+code_style = ["pre-commit~=3.1"]
 pdfhtml = ["pyppeteer"]
 sphinx = [
     "altair",