14 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
Andrew Rabert
0f596d2504 Revert "Merge pull request #1153 from cmcginty/remove-sbang"
This reverts commit 070e1c859fb2584c3dbe0a6fbe58cbc80938654e, reversing
changes made to 3faeda67bb33e07750d1a104271369a7384ca45c.
2019-04-23 10:23:33 -04:00
Casey McGinty
83e5459cfb Remove shebang lines from scripts for performance
All scripts in libexec/ (excluding pyenv) are called through pyenv,
therefore the shebang lines are not necessary. On some systems this
provides a measurable increase in performance of the shell prompt.

Related to pyenv/pyenv-virtualenv#259
2019-03-07 22:15:14 +01:00
Lars Fronius
1ec90481e8 Update pip 2017-05-09 12:51:50 +02:00
Lars Fronius
95818ab802 Update pip 2017-05-09 12:50:46 +02:00
Lars Fronius
bbd8f2c01e Fixes pip-rehash to rehash if pip was called with a flag
`pip -v install foobar` or `pip -q install foobar` did not trigger a rehash before. Now it should have the same behaviour as `pip install foobar`.
2017-05-09 12:43:51 +02:00
Yamashita, Yuu
4c06f23aaf Run rehash after conda install 2015-12-23 08:09:40 +00: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