Created
August 11, 2020 15:12
-
-
Save edvardm/8ec13b80b3c0ee1dc6ccc65053ef9e8c to your computer and use it in GitHub Desktop.
setup python prerequisities
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 | |
PYTHON_VERSION=3.7.5 | |
POETRY_URL=https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | |
has() { | |
type $1 > /dev/null 2>&1 | |
} | |
echo "Ensure pyenv is installed" | |
has pyenv || (echo "pyenv required, see https://github.com/pyenv/pyenv" && exit 1) | |
echo "Installing decent Python ($PYTHON_VERSION)" | |
(pyenv versions | grep -q $PYTHON_VERSION) || pyenv install $PYTHON_VERSION | |
echo "Set system default to $PYTHON_VERSION" | |
pyenv global $PYTHON_VERSION | |
echo "Install poetry" | |
has poetry || (curl -sSL $POETRY_URL | python) | |
echo "Install invoke" | |
pip install -U pip invoke |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment