pipx installation should implicitly be "aware" of `$PIPX_HOME/$PIPX_BIN_DIR` values
#774 建立於 2021年12月9日
描述
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_HOMEand$PIPX_BIN_DIRset to/home/user/code/pipxand/home/user/code/pipx/bin(or whatever). -
note above that I keep my
$PIPX_BIN_DIRinside$PIPX_HOME, many folks do this -
I use
pipxto manage itself, so my repo containspipxin$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.