Last active
August 11, 2020 15:15
-
-
Save edvardm/70e03ae99eda28d575ef8703817d1e87 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 and cookiecutter" | |
pip install -U pip invoke cookiecutter |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment