Skip to content

Commit

Permalink
upgrade pip when upgrading packages #72
Browse files Browse the repository at this point in the history
  • Loading branch information
cs01 committed Jan 27, 2019
1 parent 181ee7b commit e3e7f41
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
dev
* upgrade pip when upgrading packages #72

0.10.4.1
* Fix version printed when `pipx --version` is run

Expand Down
7 changes: 7 additions & 0 deletions pipx/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,13 @@ def upgrade(

old_version = venv.get_package_version(package)
do_animation = not verbose
try:
with animate(f"upgrading pip for package {package_or_url!r}", do_animation):
venv.upgrade_package("pip", pip_args)

except Exception:
logging.error("Failed to upgrade pip", exc_info=True)

with animate(f"upgrading package {package_or_url!r}", do_animation):
venv.upgrade_package(package_or_url, pip_args)
new_version = venv.get_package_version(package)
Expand Down

0 comments on commit e3e7f41

Please sign in to comment.