mirror of
https://github.com/jimeh/dotfiles.git
synced 2026-02-19 13:46:41 +00:00
Use pyenv to manage python installation instead of homebrew
This commit is contained in:
1
Brewfile
1
Brewfile
@@ -41,6 +41,7 @@ brew 'node'
|
|||||||
brew 'pandoc'
|
brew 'pandoc'
|
||||||
brew 'peco'
|
brew 'peco'
|
||||||
brew 'pgformatter'
|
brew 'pgformatter'
|
||||||
|
brew 'pyenv'
|
||||||
brew 'rbenv'
|
brew 'rbenv'
|
||||||
brew 'rclone'
|
brew 'rclone'
|
||||||
brew 'readline'
|
brew 'readline'
|
||||||
|
|||||||
@@ -10,10 +10,6 @@ install_python_global_packages() {
|
|||||||
'yamllint'
|
'yamllint'
|
||||||
)
|
)
|
||||||
|
|
||||||
if [[ "$OSTYPE" == "darwin"* ]] && command-exists brew; then
|
|
||||||
brew list python >/dev/null || brew install python
|
|
||||||
fi
|
|
||||||
|
|
||||||
local pipcmd="pip"
|
local pipcmd="pip"
|
||||||
if command-exists pip3; then pipcmd="pip3"; fi
|
if command-exists pip3; then pipcmd="pip3"; fi
|
||||||
|
|
||||||
@@ -22,6 +18,26 @@ install_python_global_packages() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Aliases
|
# Aliases
|
||||||
alias ap="ansible-playbook"
|
alias ap="env OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES ansible-playbook"
|
||||||
alias av="ansible-vault"
|
alias av="env OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES ansible-vault"
|
||||||
alias mo="molecule"
|
alias mo="env OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES molecule"
|
||||||
|
|
||||||
|
if command-exists pyenv; then
|
||||||
|
# lazy-load pyenv
|
||||||
|
pyenv() {
|
||||||
|
load-pyenv
|
||||||
|
pyenv "$@"
|
||||||
|
}
|
||||||
|
|
||||||
|
_pyenv() {
|
||||||
|
load-pyenv
|
||||||
|
_pyenv "$@"
|
||||||
|
}
|
||||||
|
|
||||||
|
compctl -K _pyenv pyenv
|
||||||
|
|
||||||
|
load-pyenv() {
|
||||||
|
unset -f load-pyenv _pyenv pyenv
|
||||||
|
eval "$(command pyenv init -)"
|
||||||
|
}
|
||||||
|
fi
|
||||||
|
|||||||
4
zshenv
4
zshenv
@@ -157,6 +157,10 @@ path_prepend "/opt/tmux/bin"
|
|||||||
path_prepend "$HOME/.rbenv/shims"
|
path_prepend "$HOME/.rbenv/shims"
|
||||||
path_prepend "$HOME/.rbenv/bin"
|
path_prepend "$HOME/.rbenv/bin"
|
||||||
|
|
||||||
|
# Python setup
|
||||||
|
path_prepend "$HOME/.pyenv/shims"
|
||||||
|
path_prepend "$HOME/.pyenv/bin"
|
||||||
|
|
||||||
# Rust setup
|
# Rust setup
|
||||||
path_prepend "$HOME/.cargo/bin"
|
path_prepend "$HOME/.cargo/bin"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user