diff --git a/script/gen_requirements_all.py b/script/gen_requirements_all.py index 101a57e419d..81fea80efad 100755 --- a/script/gen_requirements_all.py +++ b/script/gen_requirements_all.py @@ -4,6 +4,7 @@ from __future__ import annotations import difflib import importlib +from operator import itemgetter import os from pathlib import Path import pkgutil @@ -333,7 +334,7 @@ def process_requirements( def generate_requirements_list(reqs: dict[str, list[str]]) -> str: """Generate a pip file based on requirements.""" output = [] - for pkg, requirements in sorted(reqs.items(), key=lambda item: item[0]): + for pkg, requirements in sorted(reqs.items(), key=itemgetter(0)): for req in sorted(requirements): output.append(f"\n# {req}")