Replace lambda with itemgetter in script/gen_requirements_all.py (#99661)
parent
a04c61e77b
commit
abb0537928
|
@ -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}")
|
||||
|
||||
|
|
Loading…
Reference in New Issue