Commit graph

309 commits

Author SHA1 Message Date
Sam Doran 4d2fd5dd3e
Remove unused code
The new implementation is not using realpath.
2026-04-23 17:29:17 -04:00
Sam Doran 36eb43ebad
Use conditional expressions
For consistency, use conditional expressions instead of
arithmetic evaluation when comparing bash versions.
2026-04-23 17:29:17 -04:00
Sam Doran 13b0d850d8
Add skip-aliases to complete output
This was removed by accident.
2026-04-23 17:29:17 -04:00
Sam Doran 39f35841f9
Only show aliases as completions for pyenv activate
This makes the suggested completetions cleaner.
2026-04-23 17:29:17 -04:00
Sam Doran ad14880ab2
Only show Python versions for completion when creating new virtual environments
Having the current virtual environments listed as options in the competion
is noisy since only bare Python versions, such as 3.11.1, make sense as
suggested completions for `pyenv virtualenv [version]`.
2026-04-23 17:29:17 -04:00
Sam Doran 6d2cb280f8
Add --only-aliases argument
This is useful for listing the “frinedly” virtualenv names instead of
the short path which includes the Python version.
2026-04-23 17:29:16 -04:00
Sam Doran 97e1333197
Shellcheck fixes, mostly quoting to avoid word splitting 2026-04-23 17:29:16 -04:00
Sam Doran 563bcff28e
Improve performance of pyenv-virtualenvs
Use the code from pyenv-versions for efficiency and consistent output.

The main performance problem was in the call to pyenv-virtualenv-prefix,
which called pyenv-prefix, which then enumerated every virtual environment.
This was done inside a loop, compounding the problem.

Simply the virtual environment listing so that it does not have to call
pyenv-virtualenv-prefix anymore.
2026-04-23 17:29:16 -04:00
Chris Caldwell 99d35f201c
Fix POSIX sh (dash) compatibility in pyenv-virtualenv-init (#526)
* Refactor cache code generation
* Don't generate prompt_command for non bash/zsh/fish

---------

Co-authored-by: Ivan Pozdeev <vano@mail.mipt.ru>
2026-04-21 18:53:01 +03:00
Ivan Pozdeev 90dfbcad93
1.3.0 2026-03-25 23:46:29 +03:00
Jake Lodwick 72cb35b2b4
Drastically speed up precommand hook by caching active version to skip redundant activate calls (#523) 2026-03-25 23:33:43 +03:00
Ivan Pozdeev b5c88a7a15
1.2.6 2025-12-14 18:41:47 +03:00
SabriRamadanTNG 64233612fb
Prevent loss of data on virtualenv-delete -f if the env doesn't exist and the PREFIX envvar is set elsewhere (#518)
* Rename the PREFIX var just in case as too generic

Co-authored-by: Ivan Pozdeev <vano@mail.mipt.ru>
2025-12-13 20:05:26 +03:00
native-api e8c8fd9b84
Fix errorneously creating a symlink inside env directory if running with -f (#496)
Some checks failed
tests / tests (macos-13) (push) Has been cancelled
tests / tests (macos-14) (push) Has been cancelled
tests / tests (ubuntu-20.04) (push) Has been cancelled
tests / tests (ubuntu-22.04) (push) Failing after 0s
2024-12-08 23:30:27 +03:00
native-api db299cada3
Fix confusing activate/deactivate error messages (#495) 2024-12-08 21:43:35 +03:00
native-api c6bb0694bf
Fix pyenv-virtualenv using a different Python version in a conda environment (#492)
Some checks failed
tests / tests (ubuntu-22.04) (push) Failing after 0s
tests / tests (macos-13) (push) Has been cancelled
tests / tests (macos-14) (push) Has been cancelled
tests / tests (ubuntu-20.04) (push) Has been cancelled
Allow output checking with wildcards
2024-11-25 00:54:05 +03:00
Jovier Jimenez d4c9655e26
Add prompt customization (#476)
Some checks failed
tests / tests (ubuntu-22.04) (push) Failing after 1s
tests / tests (macos-13) (push) Has been cancelled
tests / tests (macos-14) (push) Has been cancelled
tests / tests (ubuntu-20.04) (push) Has been cancelled
2024-09-15 09:40:44 +03:00
Ivan Pozdeev e9b88cc366 1.2.4
Some checks failed
tests / tests (ubuntu-22.04) (push) Failing after 1s
tests / tests (macos-13) (push) Has been cancelled
tests / tests (macos-14) (push) Has been cancelled
tests / tests (ubuntu-20.04) (push) Has been cancelled
2024-07-22 00:37:02 +03:00
native-api d811b3fef2
Merge pull request #484 from native-api/pyenv_latest_f
Reflect pyenv-latest switch change in 2.4.8
2024-07-22 00:34:28 +03:00
Ivan Pozdeev 6179ac76c4 Reflect pyenv-latest switch change in 2.4.8 2024-07-21 23:31:47 +03:00
native-api 37917069ec
Fix failing to detect -m venv when "python" is not provided by the distro (#479) 2024-04-10 00:14:13 +03:00
Ivan Pozdeev b90bd92853 1.2.3 2024-04-07 22:59:10 +03:00
Ivan Pozdeev ac28398fc0 Don't activate if a 3rd-party virtualenv is active over ours 2024-04-03 21:09:22 +03:00
Romir K 0f83c33a3b
Add fish prompt changing (#475) 2024-02-12 12:58:27 +03:00
John HU 2b2b87a25a
Bump pyenv-virtualenv reporting version to match release (#471)
The latest release so far (Dec 2023) is 1.2.2, but the version reported is still 1.2.1:
https://github.com/pyenv/pyenv-virtualenv/releases/tag/v1.2.2
2023-12-06 06:56:52 +03:00
Jason Mobarak 38a6561f96
fix: add colorize helper (#470) 2023-11-29 11:37:00 +03:00
native-api c85c1c9ed5
Link python*-config into VE (#460)
Required to build binaries that link against Python.
Carl Meyer, the champion for PEP 0405, has confirmed that there isn't a particular reason why `venv` doesn't do that.
2023-06-27 01:36:04 +03:00
Marcin Konowalczyk 85d8c5aabf
More helpful error message when env's base version is not installed (#454) 2023-04-10 21:42:47 +03:00
Josh French fca12418ca
Add activate/deactivate hooks (#452) 2023-03-22 20:39:55 +03:00
Jack McIvor 13bc1877ef
Update PYENV_VIRTUALENV_VERSION (#449)
Co-authored-by: Jack McIvor <j.mcivor@draftkings.com>
2023-02-07 19:37:47 +03:00
native-api 77a7644ff7
Remove prompt deprecation warning (#447)
Prompt removal was never done and is not planned anymore
2023-01-31 23:14:52 +03:00
native-api a6ab660b72
Support a prefix resolved by pyenv-latest as base version (#446) 2023-01-29 23:47:22 +03:00
Ville Skyttä d5f2878a97
Strip -<suffix> when autodetecting shell (#377)
For example bash-5.1, bash-static.
2022-10-18 20:37:46 +03:00
Andrew Christianson c4de2555b7
Use realpath of scripts to determine relative locations (#308)
Just using paths relative to ${BASH_SOURCE} to access `libexec`
fails if the scripts are symlinked to a location,
such as when installed with Homebrew,
since the `libexec` directory is not linked into `brew --prefix`.

Implement a simple version of `realpath`
and run `${BASH_SOURCE}` through it.
This gets the actual installation directory
relative to which `libexec` is located.

Co-authored-by: Andrew Christianson <achristianson@edmunds.com>
2022-10-14 04:37:08 +03:00
P M 177eb67af3
Enhance documentation about options for pyenv virtualenv (#425)
Co-authored-by: Ivan Pozdeev <vano@mail.mipt.ru>
2022-10-12 22:12:21 +03:00
Ville Skyttä 4054162a1c
Fix errors when set -u is set in the user's shell (#350) 2022-10-12 07:41:29 +03:00
Ville Skyttä 3c0edf888e
Spelling fixes (#352) 2022-10-10 21:50:28 +03:00
Joseph Egan 7932bb4cc0
Stop delete force failing when virtualenv does not exist (#330) 2022-10-10 21:47:19 +03:00
Eric N. Vander Weele c6ff093344
Deduplicate shims in $PATH for the fish shell during initialization (#430)
When a fish login shell is invoked within an existing login shell, avoid
duplicating path to the shims by removing existing occurrences before
prepending.
2022-05-19 19:03:51 +03:00
Nick cc9d5f168e
Update get-pip.py URLs in pyenv-virtualenv (#426) 2022-02-26 09:41:41 +03:00
Alain Kalker 017ea60cd3
Fix another unbound variable error (#424)
* Fix tests failing after #423
2022-01-30 21:14:28 +03:00
Alain Kalker 1ee7ca6346
Fix unbound variable errors when running pyenv activate with set -u (#423) 2022-01-29 20:53:52 +03:00
Ville Skyttä 91609e25f3
perf(sh-activate): avoid a duplicate pyenv-version-name call (#380) 2021-11-14 02:30:56 +03:00
Seonghyeon Cho 5509c25ac1
Add (y/N) prompt help text (#404) 2021-11-08 18:15:23 +03:00
jivanf c3110d874e
Fix get-pip.py URLs for older versions of Python (#403) 2021-11-08 18:14:47 +03:00
Gaurav Talreja b334dde5ef Fix #394 - update pyenv virtualenvs command to list virtualenvs starting with dot prefixes 2021-06-16 15:20:14 +05:30
Anton Petrov 8c7ef734f9
Update pyenv-virtualenv-init
https://github.com/pyenv/pyenv-installer/pull/109
2021-05-09 20:17:17 +03:00
Yamashita, Yuu 294f64f76b v1.1.5 2019-02-13 15:27:07 +00:00
Yamashita, Yuu 74bba45b9c v1.1.4 2019-02-08 02:04:46 +00:00
Yamashita, Yuu a9e1891e8b Prefer python3.x executable if avaialble (closes #206, #282) 2019-01-12 05:38:21 +00:00