pypa/pipx

pipx installation should implicitly be "aware" of `$PIPX_HOME/$PIPX_BIN_DIR` values

Open

#774 aberto em 9 de dez. de 2021

Ver no GitHub
 (5 comments) (0 reactions) (0 assignees)Python (363 forks)batch import
bughelp wanted

Métricas do repositório

Stars
 (7.844 stars)
Métricas de merge de PR
 (Mesclagem média 5d 2h) (16 fundiu PRs em 30d)

Description

How would this feature be useful?

Two background details:

  • I keep my pipx repos outside of ~/.local/pipx, so I have to have the envariables $PIPX_HOME and $PIPX_BIN_DIR set to /home/user/code/pipx and /home/user/code/pipx/bin (or whatever).

  • note above that I keep my $PIPX_BIN_DIR inside $PIPX_HOME, many folks do this

  • I use pipx to manage itself, so my repo contains pipx in $PIPX_BIN_DIR

The problem: Once $PIPX_BIN_DIR is added to my path, I can run all the binaries in my repo, with the exception of pipx itself. If I ever need to call pipx on my repository for upgrade/installs, I need to set these envariables again.

Describe the solution you'd like

It would be great if pipx can "cache" or else store these values inside the repo itself, such that I can call pipx and have it do the right thing.

This is roughly analogous to how pip itself works:

    $ python -m venv /home/user/code/venv
    $ /home/user/code/venv/bin/pip install pycowsay
    $ /home/user/code/venv/bin/pycowsay

Notice above that I didn't need to set any environment varaibles. When calling pip and pycowsay from the command line, they implicitly understood that their libraries were in /home/user/code/venv/lib/python3.x/site-packages and did the right thing in finding them. pipx should work the same way.

Describe alternatives you've considered

I can set $PIPX_HOME and $PIPX_BIN_DIR in my shell's rc file as needed, so this is not a terribly big deal, but having the values cached, allows me to move my pipx repository around anywhere without updating the envariables all the time.

Guia do colaborador