Skip to content

Commit

Permalink
Merge pull request #3562 from dev-hato/fix_pipfile_2
Browse files Browse the repository at this point in the history
CI pr-format: Pipfile内にパッケージがあるかを大文字・小文字区別せず判定する
  • Loading branch information
massongit authored Jan 4, 2024
2 parents a315fe0 + fa4ca14 commit d48c039
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions scripts/pr_format/pr_format/fix_pipfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,8 @@ def get_pipfile_packages(pipfile: Pipfile) -> set[str] | NoReturn:
if not is_pipfile_packages(pipfile_value):
raise TypeError("Failed to cast to PipfilePackages: " + str(pipfile_value))

pipfile_packages |= set(pipfile_value.keys())
for package_name in pipfile_value.keys():
pipfile_packages.add(package_name.lower())

return pipfile_packages

Expand All @@ -175,9 +176,8 @@ def exist_package_in_pipfile(packages: list[str], pipfile_packages: set[str]) ->
:return: 与えられたパッケージ群のいずれかがPipfile内に存在するか
"""
for package_name in packages:
for pn in [package_name, package_name.lower()]:
if pn in pipfile_packages:
return True
if package_name.lower() in pipfile_packages:
return True

return False

Expand Down

0 comments on commit d48c039

Please sign in to comment.