Skip to content

Instantly share code, notes, and snippets.

@edvardm
Last active August 11, 2020 15:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save edvardm/70e03ae99eda28d575ef8703817d1e87 to your computer and use it in GitHub Desktop.
Save edvardm/70e03ae99eda28d575ef8703817d1e87 to your computer and use it in GitHub Desktop.
setup python prerequisities
#!/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