Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: respect user-defined PIPX_BIN_DIR #641

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

skycaptain
Copy link

If pipx is already installed in the base image, it's likely that PIPX_BIN_DIR is set to a custom location such as /usr/local/bin. Since this script doesn't yet support --global, this at least adds support for user-defined PIPX_BIN_DIRs. Without this support, the script would create broken symlinks, e.g. when installing ghcr.io/prulloac/devcontainer-features/pre-commit:1 and PIPX_BIN_DIR=/usr/local/bin and PIPX_HOME=/opt/pipx, pipx installs the pre-commit symlink to /opt/pipx/bin/pre-commit, which results in a broken symlink:

root ➜ / $ which pre-commit
root ➜ / $ pipx list
venvs are in /opt/pipx/venvs
apps are exposed on your $PATH at /usr/local/bin
   package pre-commit 3.8.0, installed using Python 3.11.2
    - pre-commit (symlink missing or pointing to unexpected location)

If pipx is already installed in the base image, it's likely that
PIPX_BIN_DIR is set to a custom location such as /usr/local/bin. Since
this script doesn't yet support --global, this at least adds support
for user-defined PIPX_BIN_DIRs. Without this support, the script would
create broken symlinks.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant