Forked from MADindustries/set_up_python_dev_env_macos
Last active
April 30, 2019 20:23
-
-
Save repentsinner/18b54a95c4819d4cb5f8bf2d81da62c8 to your computer and use it in GitHub Desktop.
Set up a python development environment (macOS)
This file contains 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
#!/bin/sh | |
# Install Homebrew (macOS package manager) | |
# consider using spack (https://spack.io/) when it better supports fish | |
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" | |
brew update | |
# Install fish (A better shell) | |
curl -Lo ~/Downloads/fish-3.0.2.pkg https://github.com/fish-shell/fish-shell/releases/download/3.0.2/fish-3.0.2.pkg | |
sudo installer -pkg ~/Downloads/fish-3.0.2.pkg -target / | |
# Set fish as default login shell | |
# See here for additional options: https://gist.github.com/idleberg/9c7aaa3abedc58694df5 | |
sudo echo /usr/local/bin/fish >> /etc/shells | |
chsh -s /usr/local/bin/fish | |
# Restart your shell to activate / test fish | |
exec fish | |
# Install git | |
brew install git | |
# Install git-flow | |
brew install git-flow | |
# Install fisherman (A fish plugin manager) | |
curl -Lo ~/.config/fish/functions/fisher.fish --create-dirs https://git.io/fisher | |
# Install asdf (a language manager) | |
git clone https://github.com/asdf-vm/asdf.git ~/.asdf | |
echo 'source ~/.asdf/asdf.fish' >> ~/.config/fish/config.fish | |
mkdir -p ~/.config/fish/completions; and cp ~/.asdf/completions/asdf.fish ~/.config/fish/completions | |
#brew install pyenv | |
#echo -e 'if command -v pyenv 1>/dev/null 2>&1; then\n eval "$(pyenv init -)"\nfi' >> ~/.bash_profile | |
#fisher pyenv | |
# Install python and set global version | |
# But first, workaround for missing zlib dependency https://github.com/pyenv/pyenv/issues/1219 😒 | |
sudo installer -pkg /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg -target / | |
asdf plugin-add python | |
asdf install python 3.7.3 | |
asdf global python 3.7.3 | |
# Install pipenv (a python virtualenv manager) | |
pip install --upgrade pip | |
pip install pipenv | |
asdf rehash python 3.7.3 | |
fisher add kennethreitz/fish-pipenv | |
# Fix config race condition as described here: https://github.com/fisherman/pipenv/issues/1#issuecomment-385205034 | |
# and here: https://github.com/kennethreitz/fish-pipenv | |
set -U fish_user_paths ~/.asdf/shims $fish_user_paths | |
# Configure Pipenv to store .venv folders in project folder | |
set -Ux PIPENV_VENV_IN_PROJECT 1 | |
# Restart your shell | |
exec fish | |
# Now you can actually develop shit without fucking everything up all the time * | |
# **Unless all these intructions fucked everything up. Which is likely. So good luck unwrapping the snake spaghetti** |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment