pypa/pipx

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

Open

#774 geöffnet am 9. Dez. 2021

Auf GitHub ansehen
 (5 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)Python (363 Forks)batch import
bughelp wanted

Repository-Metriken

Stars
 (7.844 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 5T 2h) (16 gemergte PRs in 30 T)

Beschreibung

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.

Contributor Guide