Skip to content

Commit

Permalink
Split pyenv installation into separate script
Browse files Browse the repository at this point in the history
Has quite some (build) dependencies; best to make the choice of
installing it/them explicit. Also, include pip-tools as part of the pipx
installations.
  • Loading branch information
thijsputman committed Mar 8, 2024
1 parent c714c5d commit ad9515c
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 11 deletions.
31 changes: 31 additions & 0 deletions install/parts.d/91-apt-install-pyenv
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/usr/bin/env bash

if ! [ -d "$HOME/.pyenv" ]; then

if ! [[ $PATH =~ (^|:)"$HOME/.pyenv"(:|$) ]]; then
echo " ⚠️ Add \"📂 $HOME/.pyenv\" to PATH... " >&3
PATH="$PATH:$HOME/.pyenv"
fi

sudo apt-get update

sudo DEBIAN_FRONTEND=noninteractive \
apt-get install -y \
build-essential \
curl \
libbz2-dev \
libffi-dev \
liblzma-dev \
libncursesw5-dev \
libreadline-dev \
libsqlite3-dev \
libssl-dev \
libxml2-dev \
libxmlsec1-dev \
tk-dev \
xz-utils \
zlib1g-dev

curl https://pyenv.run | bash

fi
11 changes: 0 additions & 11 deletions install/parts.d/91-apt-install-python
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,6 @@ if ! [[ $PATH =~ (^|:)"$HOME/.local/bin"(:|$) ]]; then
PATH="$PATH:$HOME/.local/bin"
fi

if ! [ -d "$HOME/.pyenv" ]; then

if ! [[ $PATH =~ (^|:)"$HOME/.pyenv"(:|$) ]]; then
echo " ⚠️ Add \"📂 $HOME/.pyenv\" to PATH... " >&3
PATH="$PATH:$HOME/.pyenv"
fi

curl https://pyenv.run | bash

fi

# Ignore the warning in /usr/share/doc/python3.11/README.venv – we want these
# packages to be user-managed, not system-managed...

Expand Down
3 changes: 3 additions & 0 deletions install/parts.d/93-tools-install-python
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,6 @@ pipx install pre-commit

echo " 🐍 yamllint" >&3
pipx install yamllint

echo " 🐍 pip-tools (pip-compile & pip-sync)" >&3
pipx install pip-tools

0 comments on commit ad9515c

Please sign in to comment.