Skip to content

Commit

Permalink
Improve implementation of freeze_outdated_packages
Browse files Browse the repository at this point in the history
  • Loading branch information
realshouzy committed Feb 25, 2024
1 parent d79ed6e commit 97ef825
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pip_review.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,8 +280,10 @@ def update_packages(

if freeze_outdated_packages:
with open("requirements.txt", "w", encoding="utf-8") as f:
for pkg in packages:
f.write(f"{pkg.name}=={pkg.version}\n")
outdated_packages: str = "\n".join(
f"{pkg.name}=={pkg.version}" for pkg in packages
)
f.write(f"{outdated_packages}\n")

if not continue_on_fail:
upgrade_cmd.extend(pkg.name for pkg in packages)
Expand Down

0 comments on commit 97ef825

Please sign in to comment.