Skip to content

Commit

Permalink
Update Poetry configuration for install-poetry.py
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
br3ndonland committed Jul 5, 2021
1 parent ff946b1 commit 1d8eee0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion .zshrc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions script/strap-after-setup
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1d8eee0

Please sign in to comment.