Created
September 3, 2024 08:48
-
-
Save gmolveau/9d72c3c64544c4f95bd882d93cee55d1 to your computer and use it in GitHub Desktop.
bash script to upgrade all outdated dependencies with python/pip
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pip list --disable-pip-version-check --outdated --format=columns | tail -n +3 | awk '{print $1}' | xargs -n1 pip install -U || true | |
# explanations : | |
# pip list --disable-pip-version-check --outdated --format=columns : print as a column format only the outdated dependencies, and suppress the warning if pip is outdated as it messes up the output | |
# tail -n +3 : keep only the lines after the first two | |
# awk '{print $1}' : keep only the first column | |
# xargs -n1 pip install -U || true : install each dependency, never fails via the || true (to use in a CI or script env) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment