8 Commits

Author SHA1 Message Date
Christian Fredrik Johnsen
0e200e714c feat: add automatic rehash on uv pip install/uninstall. 2025-01-20 00:09:47 +01:00
Christian Fredrik Johnsen
4017615af3 refactor: use elif when checking for -m pip in command to be
executed.

This is a logical change. If the command is `pip install ...`, then you
don't need to look for `python -m pip install ...` in the same command.
Either you have `pip install ...` or `python -m pip install ...`
or something completely different.
2024-12-28 12:47:53 +01:00
Christian Fredrik Johnsen
6112062fdd fix: add automatic rehash after pip3.x/pip3.xx install
The tests showed that the original implementation actually never worked.
You did NOT get a rehash after doing pip3.8 install, even when the
comments in the code said so.

--> replaced `\d` with [0-9] and slapped on a `+`, such that we match
both pip3.x and `pip3.xx install`
2024-12-28 12:41:09 +01:00
Christian Fredrik Johnsen
b154f3a7d8 refactor: use regex matching instead of for loop
Instead of creating a for-loop where we go through each argument, to
check if current argument is -m and next argument is pip, we instead do
simple regex matching where we look for ` -m pip ` somewhere in the
command which is to be executed.
2024-12-27 21:19:59 +01:00
Christian Fredrik Johnsen
372ffab430 fix: look for -m followed by pip instead of looking for python -m pip
It isn't necessarily the case that the command will be python, it can be
both python3, python2, python3.12, etc.
2024-12-26 21:02:03 +01:00
Christian Fredrik Johnsen
c660839b62 fix: add python -m pip command to pip hook-script.
When doing `pip install ...`, the command is redirected to
`pyenv.d/exec/pip-rehash/pip`, which does a `pyenv rehash` after
installation. A simple fix to issue #3031 is to make `python -m pip`
commands go through the same special hook script.
2024-12-26 21:02:03 +01:00
Daniel Hahler
481198d255 pip-rehash: handle versions in commands, like "pip2" and "pip3.4"
Fixes https://github.com/yyuu/pyenv/issues/367
2015-04-30 00:49:53 +02:00
Yamashita Yuu
acce3744e7 Add pip-rehash 2014-12-01 22:36:10 +09:00