diff --git a/requirements.txt b/requirements.txt
index 9f4224165..561663f10 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -10,4 +10,4 @@ PyYAML>=3.12 # MIT
 six>=1.10.0 # MIT
 stevedore>=1.20.0 # Apache-2.0
 # NOTE(ianw) in here because dib-lint uses flake8
-hacking>=1.1.0
+flake8<4.0.0,>=3.6.0 # MIT