-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup-python.fish
executable file
·46 lines (34 loc) · 1.1 KB
/
setup-python.fish
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/usr/bin/env fish
cd (dirname (status -f)) && source init.fish
set PYTHON_VERSION (get-version python "3.10.13")
brew-install readline zlib xz openssl
apt-install build-essential libreadline-dev libffi-dev libssl-dev zlib1g-dev liblzma-dev libbz2-dev libsqlite3-dev
set -x PYENV_ROOT $HOME/.pyenv
if not test -d $PYENV_ROOT
git clone https://github.com/pyenv/pyenv.git $PYENV_ROOT
end
cd $PYENV_ROOT && git pull
fish_add_path $PYENV_ROOT/bin
source-config
cd $DOT_PATH
if not test (pyenv global) = $PYTHON_VERSION
pyenv install $PYTHON_VERSION -s && pyenv global $PYTHON_VERSION
end
source-config
function pip-install
pip install -U -r pip-packages
end
if is-mac # for llvmlite
LLVM_CONFIG=(brew --prefix llvm@11)/bin/llvm-config pip-install
else
pip-install
end
# poetry install
curl -sSL https://install.python-poetry.org | python3 -
fish_add_path $HOME/.local/bin
link-file \
.config/pycodestyle \
.jupyter/lab/user-settings/@jupyterlab/shortcuts-extension/shortcuts.jupyterlab-settings
if not test -e $HOME/.config/asciinema/install-id
echo "asciinema auth is needed!"
end