From 1d8eee02fcaeb72112d03617705a21e9b98581df Mon Sep 17 00:00:00 2001 From: Brendon Smith Date: Mon, 5 Jul 2021 18:16:54 -0400 Subject: [PATCH] Update Poetry configuration for install-poetry.py python-poetry/poetry#3706 Poetry has a new install script, install-poetry.py, which alters the requirements for adding Poetry to `$PATH`. One simple way to add Poetry to `$PATH` is to `export PATH=$HOME/.local/bin:$PATH`, which adds the ~/.local/bin directory (it's also used by pipx, so it's a good option) to `$PATH`, then `export POETRY_HOME=$HOME/.local`, which tells Poetry to install itself into the ~/.local/bin directory. --- .zshrc | 3 ++- script/strap-after-setup | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.zshrc b/.zshrc index 9b0986a..933fd20 100644 --- a/.zshrc +++ b/.zshrc @@ -39,7 +39,8 @@ else fi TTY=$(tty) export GPG_TTY=$TTY -export PATH=$PATH:$HOME/.local/bin:$HOME/.poetry/bin +export PATH=$HOME/.local/bin:$PATH +export POETRY_HOME=$HOME/.local export SSH_KEY_PATH=$HOME/.ssh/id_rsa_$USER ### aliases diff --git a/script/strap-after-setup b/script/strap-after-setup index 49cb62f..e805202 100755 --- a/script/strap-after-setup +++ b/script/strap-after-setup @@ -21,16 +21,16 @@ fi ### Install user Python packages if command -v python3 &>/dev/null; then - if ! command -v poetry &>/dev/null; then - curl -fsSL $RAW/python-poetry/poetry/HEAD/get-poetry.py | python3 - - fi if ! command -v pipx &>/dev/null; then python3 -m pip install --user pipx python3 -m pipx ensurepath fi + if ! command -v poetry &>/dev/null; then + curl -fsSL $RAW/python-poetry/poetry/HEAD/install-poetry.py | python3 - + fi "$HOME"/.dotfiles/script/python-user-packages.sh else - echo "Python 3 not found. Skipping Poetry and pipx installs." + echo "Python 3 not found. Skipping pipx and Poetry installs." fi ### Install VSCode extensions