* perf: replace a series of if statements with a case block. Add error
handling for case where unknown option is provided.
Same setup as rbenv-init for reading arguments.
* perf, docs: Recommend users to specify the shell for `pyenv init -`
Speeds up the startup by about 40% (in local testing, from ~50ms to ~30ms).
Reflect this in `pyenv init` hint text.
* style: remove unnecessary `root` variable in pyenv-init
* style: remove unnecessary variable declarations at the top of file in pyenv-init.
* perf: replace `cat <<` calls with `echo`
The builtin `echo` is about 100x faster. In tests, saves about 2-3ms.
* docs: document the `pyenv init - <shell>` performance boost in the Advanced Configuration section.
* style: test_helper.bash: avoid unnecessary ".." in produced PATH
* docs: fix a false statement about completions location in the Advanced Configuration section.
* Reorganize readme, add gif
1. Details in 'Getting Pyenv' and 'Setup for your shell' are collapsed. User can expand relevant
sections depending on their platform and shell.
2. 'How It Works' and 'Advanced Configuration' are moved to the bottom of the README.md
just before 'Contributing' section at the end.
3. Added a GIF in the 'Usage' section to showcase
- Listing python versions available for install.
- Installing a specific python version.
- Listing installed python versions.
- Switching to another python version for a directory.
- Testing by moving terminal into the directory and moving back.
* Update GIF to show prefix resolution
* Collapse upgrade notes
* Cross-mention Linux and MacOS instlalation scenarios
---------
Co-authored-by: Ivan Pozdeev <vano@mail.mipt.ru>
This PR corrects a small but important detail in the documentation regarding how the system searches for executable files. The original text incorrectly stated that the operating system performs this search. The corrected text clarifies that it is actually the shell that performs the search.
* Document listing available versions in the tutorial (#1677)
* Reflect 3.7.15's extended support
* Document using development head with Homebrew
* Structurize the Upgrading section
* Fix Pyenv-latest documentation
We're going to eliminate the need to mandatorily use `pyenv init --path`.
We can't delete it yet for backward compatibility.
Besides, there's one other use case for it: to enable shims but without
shell integration, e.g. for noninteractive shells.
To be a full-fledged replacement for `pyenv init -` however,
it needs to do rehashing.
Now the setup is to add to both rc and profile:
1) set PYENV_ROOT
(can do it unconditionally -- since if you change it,
you need to update all places anyway since any of them can be run first)
2) Add `pyenv` to PATH if not already there
3) eval "$(pyenv init -)"
Not a breaking change, old setup will continue to work.