Last active
December 11, 2018 21:56
-
-
Save andyneff/0dd6c72e0feee05a6b4ac6188ac3317d to your computer and use it in GitHub Desktop.
Cleanly add pipenv to OS
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
| #!/usr/bin/env bash | |
| set -eu | |
| TMP_DIR="$(mktemp -d)" | |
| python3 <(curl -L https://bootstrap.pypa.io/get-pip.py) --no-cache-dir -I --root "${TMP_DIR}" virtualenv | |
| sudo env PYTHONPATH="$(cd "${TMP_DIR}"/usr/local/lib/python*/*-packages/; pwd)" "${TMP_DIR}/usr/local/bin/virtualenv" "/usr/local/pipenv/" | |
| sudo /usr/local/pipenv/bin/pip install --no-cache-dir pipenv | |
| sudo ln -s /usr/local/pipenv/bin/pipenv /usr/local/bin | |
| sudo bash -c "echo \"/usr/local/pipenv/bin/pip list --outdated --format=freeze | grep -v '^\-e' | cut -d = -f 1 | xargs /usr/local/pipenv/bin/pip install -U\" > /usr/local/pipenv/bin/update" | |
| sudo chmod 754 /usr/local/pipenv/bin/update | |
| rm -r "${TMP_DIR}" |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Now it adds the script
/usr/local/pipenv/bin/updateyou can run as root to update thepipenvinstall and all of its dependencies for you.