Skip to content

Commit

Permalink
Cleanup parallel/serial/sequential logic
Browse files Browse the repository at this point in the history
  • Loading branch information
defjaf committed Jan 15, 2019
1 parent cac8ded commit 678a2e2
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions pip_upgrade_outdated/upgrade_pip_packages.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,16 +166,16 @@ def main():
dry_run=args.dry_run), packages)
pool.close()
pool.join()
else: ### serial (batch) or sequential
if args.sequential:
if args.verbose > 1:
print("Sequential execution")
# Upgrade each package as a separate command in case one package fails to upgrade, others still are upgraded
for package in packages:
upgrade_package(package, pip_cmd=pip_cmd, pip_args=pip_args, verbose=args.verbose, dry_run=args.dry_run)
else:
if args.verbose > 1:
print("Serial (batch) execution")
all_packages = " ".join(packages)
upgrade_package(all_packages, pip_cmd=pip_cmd, pip_args=pip_args, verbose=args.verbose,
dry_run=args.dry_run)
elif args.sequential:
### note that order matters here since args.serial defaults to True
if args.verbose > 1:
print("Sequential execution")
# Upgrade each package as a separate command in case one package fails to upgrade, others still are upgraded
for package in packages:
upgrade_package(package, pip_cmd=pip_cmd, pip_args=pip_args, verbose=args.verbose, dry_run=args.dry_run)
elif args.serial:
if args.verbose > 1:
print("Serial (batch) execution")
all_packages = " ".join(packages)
upgrade_package(all_packages, pip_cmd=pip_cmd, pip_args=pip_args, verbose=args.verbose,
dry_run=args.dry_run)

0 comments on commit 678a2e2

Please sign in to comment.