From ab8fe0bb40c7c5af15341bdb405734df3e0d86e6 Mon Sep 17 00:00:00 2001 From: Tony Duckles Date: Sun, 25 Jul 2021 10:25:22 -0500 Subject: [PATCH] bin/pip-upgrade: Helper script to upgrade all outdated `pip` packages --- bin/pip-outdated | 6 ++++++ bin/pip-upgrade | 8 ++++++++ 2 files changed, 14 insertions(+) create mode 100755 bin/pip-outdated create mode 100755 bin/pip-upgrade diff --git a/bin/pip-outdated b/bin/pip-outdated new file mode 100755 index 0000000..bde5fe1 --- /dev/null +++ b/bin/pip-outdated @@ -0,0 +1,6 @@ +#!/bin/sh +# Show all outdated `pip` packages +pip=$(type -P pip3) +$pip list --outdated --format=freeze | \ + grep -v '^\-e' | \ + cut -d = -f 1 diff --git a/bin/pip-upgrade b/bin/pip-upgrade new file mode 100755 index 0000000..0fef782 --- /dev/null +++ b/bin/pip-upgrade @@ -0,0 +1,8 @@ +#!/bin/sh +# Upgrade all outdated `pip` packages +# https://stackoverflow.com/a/3452888 +pip=$(type -P pip3) +$pip list --outdated --format=freeze | \ + grep -v '^\-e' | \ + cut -d = -f 1 | \ + xargs -n1 sudo -H $pip install --upgrade -- 2.47.1