pypa/pipx

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

Open

#774 建立於 2021年12月9日

在 GitHub 查看
 (5 留言) (0 反應) (0 負責人)Python (7,844 star) (363 fork)batch import
bughelp wanted

描述

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.

貢獻者指南