diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE/bug_report.md similarity index 53% rename from .github/ISSUE_TEMPLATE.md rename to .github/ISSUE_TEMPLATE/bug_report.md index 3ca7f967..4a132da4 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -1,17 +1,30 @@ -Too many issues will kill our team's development velocity, drastically. -Make sure you have checked all steps below. +--- +name: Bug report +about: Create a report to help us improve +title: '' +labels: '' +assignees: '' + +--- ### Prerequisite -* [ ] Make sure your problem is not listed in [the common build problems](https://github.com/pyenv/pyenv/wiki/Common-build-problems). * [ ] Make sure no duplicated issue has already been reported in [the pyenv-virtualenv issues](https://github.com/pyenv/pyenv-virtualenv/issues). You should look in closed issues, too. -* [ ] Make sure you are not asking us to help solving your specific issue. - * GitHub issues is opened mainly for development purposes. If you want to ask someone to help solving your problem, go to some community site like [Gitter](https://gitter.im/yyuu/pyenv), [StackOverflow](https://stackoverflow.com/questions/tagged/pyenv), etc. +* [ ] Make sure you are reporting a problem in Pyenv-Virtualenv and not seeking consultation with Pyenv-Virtualenv use. + * GitHub issues are intended mainly for Pyenv-Virtualenv development purposes. If you are seeking help with Pyenv-Virtualenv use, check [Pyenv-Virtualenv documentation](https://github.com/pyenv/pyenv-virtualenv?tab=readme-ov-file#usage), go to a user community site like [Gitter](https://gitter.im/yyuu/pyenv), [StackOverflow](https://stackoverflow.com/questions/tagged/pyenv), etc, or to [Discussions](https://github.com/orgs/pyenv/discussions). * [ ] Make sure your problem is not derived from packaging (e.g. [Homebrew](https://brew.sh)). * Please refer to the package documentation for the installation issues, etc. * [ ] Make sure your problem is not derived from other plugins. * This repository is maintaining the `pyenv-virtualenv` plugin only. Please refrain from reporting issues of other plugins here. -### Description +### Describe the bug +A clear and concise description of what the bug is. +Do specify what the expected behaviour is if that's not obvious from the bug's nature. + +#### Reproduction steps +Listing the commands to run in a new console session and their output is usually sufficient. +Please use a Markdown code block (three backticks on a line by themselves before and after the text) to denote a console output excerpt. + +#### Diagnostic details - [ ] Platform information (e.g. Ubuntu Linux 20.04): - [ ] OS architecture (e.g. amd64): - [ ] pyenv version: @@ -21,7 +34,7 @@ Make sure you have checked all steps below. - [ ] Please attach the debug log of a faulty Pyenv invocation as a gist * If the problem happens in a Pyenv invocation, you can turn on debug logging by setting `PYENV_DEBUG=1`, e.g. `env PYENV_DEBUG=1 pyenv install -v 3.6.4` * If the problem happens outside of a Pyenv invocation, get the debug log like this: - ``` + ```bash # for Bash export PS4='+(${BASH_SOURCE}:${LINENO}): ${FUNCNAME[0]:+${FUNCNAME[0]}(): }' # for Zsh diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 00000000..00c109d1 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,24 @@ +--- +name: Feature request +about: Suggest an idea for this project +title: '' +labels: '' +assignees: '' + +--- + +**Describe the intended use case** +* What your general environment is if it's relevant to the feature request and is not a generic console with a typical Pyenv installation (CI, server with a custom setup, cloud environment, IDE) +* What you are trying to achieve +* What specifically you are doing for that regarding Pyenv +* Where you are stuck + +**Describe the solution you'd like** +A clear and concise description of what you want to happen. + +**Describe alternatives you've considered** +A clear and concise description of any alternative solutions or features you've considered. +[ ] In particular, did you consider [writing a plugin](https://github.com/pyenv/pyenv/blob/master/README.md#pyenv-plugins)? Note that if your plugin has general applicability, you can publish it in the 3rd-party plugin catalog on the Pyenv Wiki as per the link above. + +**Additional context** +Add any other context or screenshots about the feature request here. diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index c9930c81..3f52ae60 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -6,10 +6,11 @@ jobs: fail-fast: false matrix: os: + - ubuntu-24.04 - ubuntu-22.04 - - ubuntu-20.04 + - macos-15-intel + - macos-15 - macos-14 - - macos-13 runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v2 diff --git a/CHANGELOG.md b/CHANGELOG.md index 70280cfd..08dce127 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,17 +1,32 @@ ## Version History -#### 1.2.4 +#### v1.2.6 +* Fix changelog and version numbers + +#### v1.2.5 +* Add prompt customization by @jimenezj8 in https://github.com/pyenv/pyenv-virtualenv/pull/476 +* README: fix and distinguish syntax highlighting in Bash vs Fish snippets by @diericx in https://github.com/pyenv/pyenv-virtualenv/pull/489 +* Fix pyenv-virtualenv using a different Python version in a conda environment by @native-api in https://github.com/pyenv/pyenv-virtualenv/pull/492 +* Fix confusing activate/deactivate error messages when Pyenv is not installed as a shell function by @native-api in https://github.com/pyenv/pyenv-virtualenv/pull/495 +* Fix errorneously creating a symlink inside env directory if running w… by @native-api in https://github.com/pyenv/pyenv-virtualenv/pull/496 +* Update LICENSE, fix copyright license year by @JasonnnW3000 in https://github.com/pyenv/pyenv-virtualenv/pull/499 +* docs: add WSL note about core.autocrlf to prevent CRLF issues by @stoneHee99 in https://github.com/pyenv/pyenv-virtualenv/pull/512 +* docs: fix the link to Pyenv shell setup steps by @cshen-dev in https://github.com/pyenv/pyenv-virtualenv/pull/516 +* Convert issue template to new Github format by @native-api in https://github.com/pyenv/pyenv-virtualenv/pull/519 +* Prevent loss of data on `virtualenv-delete -f` if the env doesn't exist and the PREFIX envvar is set elsewhere by @SabriRamadanTNG in https://github.com/pyenv/pyenv-virtualenv/pull/518 + +#### v1.2.4 * Fix failing to detect `-m venv` when "python" is not provided by the distro by @native-api in https://github.com/pyenv/pyenv-virtualenv/pull/479 * README: Remove dollar signs from commands that are meant to be copied by @galonsky in https://github.com/pyenv/pyenv-virtualenv/pull/481 * Reflect pyenv-latest switch change in 2.4.8 by @native-api in https://github.com/pyenv/pyenv-virtualenv/pull/484 -#### 1.2.3 +#### v1.2.3 * Fix: add `colorize` helper by @silverjam in https://github.com/pyenv/pyenv-virtualenv/pull/470 * Bump pyenv-virtualenv reporting version to match release by @ushuz in https://github.com/pyenv/pyenv-virtualenv/pull/471 * Add fish prompt changing by @romirk in https://github.com/pyenv/pyenv-virtualenv/pull/475 * Don't activate if a 3rd-party venv is activated over ours by @native-api in https://github.com/pyenv/pyenv-virtualenv/pull/478 -#### 1.2.2 +#### v1.2.2 * Prompt removal was never done and is not planned anymore by @native-api in https://github.com/pyenv/pyenv-virtualenv/pull/447 * Update PYENV_VIRTUALENV_VERSION by @jack-mcivor in https://github.com/pyenv/pyenv-virtualenv/pull/449 * Add activate/deactivate hooks by @joshfrench in https://github.com/pyenv/pyenv-virtualenv/pull/452 @@ -19,10 +34,10 @@ * Add fish install oneliner by @ElijahLynn in https://github.com/pyenv/pyenv-virtualenv/pull/322 * Link python*-config into VE by @native-api in https://github.com/pyenv/pyenv-virtualenv/pull/460 -#### 1.2.1 +#### v1.2.1 * Support prefixes resolved by pyenv-latest as base version names by @native-api in https://github.com/pyenv/pyenv-virtualenv/pull/446 -#### 1.2.0 +#### v1.2.0 * ~/.*rc should be modified instead of ~/.*profile by @native-api in https://github.com/pyenv/pyenv-virtualenv/pull/384 * Fixes #394 - update pyenv virtualenvs to list virtualenvs start with dot prefixes by @Gauravtalreja1 in https://github.com/pyenv/pyenv-virtualenv/pull/395 * Fix installation steps to allow for Pyenv 2 by @native-api in https://github.com/pyenv/pyenv-virtualenv/pull/388 @@ -45,63 +60,63 @@ * Use realpath of scripts to determine relative locations by @andrew-christianson in https://github.com/pyenv/pyenv-virtualenv/pull/308 * Shell detect improvements by @scop in https://github.com/pyenv/pyenv-virtualenv/pull/377 -#### 1.1.5 +#### v1.1.5 * Fix install script (#290, #302) -#### 1.1.4 +#### v1.1.4 * Support newer conda (#290) * Prefer `python3.x` executable if available (#206, #282, #296) -#### 1.1.3 +#### v1.1.3 * No code changes since 1.1.2 -#### 1.1.2 +#### v1.1.2 * Use custom get-pip URL based on the target version (#253, #254, #255) * Source conda 4.4.4 shell files (#251) * Evaluate force flag before testing if venv exists (#232) -#### 1.1.1 +#### v1.1.1 * Set `CONDA_PREFIX` to make is useable in conda activate/deactivate scripts (#224) * Generate `pydoc` executable after creating new virtualenv (#197, #230) -#### 1.1.0 +#### v1.1.0 * fish: use "set -gx" instead of "setenv" (#215, #216, #217, #218) -#### 1.0.0 +#### v1.0.0 * Use similar versioning scheme as pyenv; YYYYMMDD -> X.Y.Z -#### 20160716 +#### v20160716 * Suppress activate/deactivate messages by default (#169, #170, #171) * Source conda package activate/deactivat scripts if exist (#173) * Use `source` in favor of `.` for `fish` (#175) * Use `python -m venv` instead of `pyvenv` due to deprecation of `pyvenv` after 3.6 (#184, #185) -#### 20160315 +#### v20160315 * Evaluate `${PATH}` when outputted code is eval'd. (#154) * Set proper `CONDA_DEFAULT_ENV` for shorter name (#160) -#### 20160202 +#### v20160202 * Install virtualenv 13.1.2 for CPython/Stackless 3.2.x (yyuu/pyenv#531) -#### 20160112 +#### v20160112 * Fix problem with `virtualenv` to look up executables from source version with `--system-site-packages` (#62) -#### 20151229 +#### v20151229 * Fix `deactivate` error on `fish` (#136) -#### 20151222 +#### v20151222 * Improved interoperability with Anaconda/Miniconda (#103, #106, #107, #108) * Create `virtualenv` inside `envs` directory of source version, like Anaconda/Miniconda (#103, #107) @@ -111,49 +126,49 @@ * Add `--skip-aliases` to `pyenv virtualenvs` (#120) * Stop showing `version not installed` warning messages in precmd (#49) -#### 20151103 +#### v20151103 * Passing return value from executed command. (#100) * Add workaround for commands installed in a virtual environment created by `pyvenv` (#62) * init: zsh: prepend hook to `precmd_functions` (#101) -#### 20151006 +#### v20151006 * Ignore user's site-packages on ensurepip/get-pip (#89) * Find `python-config` from source version if current version is a virtualenv * Fix pyenv-virtualenv-init script for fish where command was in string and not being evaluated (#98) * Add foolproof for `-p` argument. (yyuu/pyenv#98) -#### 20150719 +#### v20150719 * Add support for `conda` environments created by Anaconda/Miniconda (#91) * Look up commands for original version as well if the environment is created with `--system-site-packages` (#62) * Add error message if the source version is not installed (#83) -#### 20150526 +#### v20150526 * Use `typeset -g` with `precmd_functions` (#75) * activate: display setup instructions only with `PYENV_VIRTUALENV_INIT=0` (#78) * Ignore failure of pyenv activate (#68) -#### 20150119 +#### v20150119 * Ignore errors from `pyenv-version-name` since it might fail if there is configuration error (yyuu/pyenv#291) * The _shell_ version set in `activate` should be unset in `deactivate` (#61) * Anaconda has `activate` script nevertheless it is not a virtual environment (#65) -#### 20141106 +#### v20141106 * Stop creating after `ensurepip` since it has done by `ensurepip` itself * Suppress some useless warnings from `pyenv virtualenv-init` -#### 20141012 +#### v20141012 * Fix warnings from `shellcheck` to improve support for POSIX sh (#40) * Do not allow whitespace in `VIRTUALENV_NAME` (#44) * Should not persist `PYENV_DEACTIVATE` after automatic deactivation (#47, #48) -#### 20140705 +#### v20140705 * Display information on auto-(de)?activation * Support manual (de)?activation with auto-activation enabled (#32, #34) @@ -161,88 +176,88 @@ * Use https://bootstrap.pypa.io/ to install setuptools and pip * Create backup of original virtualenv within `$(pyenv root)/versions` when `--upgrade` -#### 20140615 +#### v20140615 * Fix incompatibility issue of `pyenv activate` and `pyenv deactivate` (#26) * Workaround for the issue with pyenv-which-ext (#26) -#### 20140614 +#### v20140614 * Add `pyenv virtualenv-init` to enable auto-activation feature (#24) * Create symlinks for executables with version suffix (yyuu/pyenv#182) -#### 20140602 +#### v20140602 * Use new style GH raw url to avoid redirects (raw.github.com -> raw.githubusercontent.com) * Repaired virtualenv activation and deactivation for the fish shell (#23) -#### 20140421 +#### v20140421 * Display error if `pyenv activate` was invoked as a command * Fix completion of `pyenv activate` (#15) * Use `virtualenv` instead of `pyvenv` if `-p` has given (yyuu/pyenv#158) -#### 20140123 +#### v20140123 * Add `activate` and `deactivate` to make `pyenv-virtualenv` work with [jedi](https://github.com/davidhalter/jedi) (#9) * Use `ensurepip` to install `pip` if it is available * Unset `PIP_REQUIRE_VENV` to avoid problem on the installation of `virtualenv` (#10) * Add tests -#### 20140110.1 +#### v20140110.1 * Fix install script -#### 20140110 +#### v20140110 * Support environment variables of `EZ_SETUP` and `GET_PIP`. * Support a short option `-p` of `virtualenv`. -#### 20131216 +#### v20131216 * Use latest release of setuptools and pip if the version not given via environment variables. -#### 20130622 +#### v20130622 * Removed bundled `virtualenv.py` script. Now pyenv-virtualenv installs `virtualenv` package into source version and then use it. * On Python 3.3+, use `pyvenv` as virtualenv command if `virtualenv` is not available. * Install setuptools and pip into environments created by `pyvenv`. -#### 20130614 +#### v20130614 * Add `pyenv virtualenvs` to list all virtualenv versions. * *EXPERIMENTAL*: Add `--upgrade` option to re-create virtualenv with migrating packages -#### 20130527 +#### v20130527 * Remove `python-virtualenv` which was no longer used. * Change the installation path of the `virtualenv.py` script. (`./libexec` -> `./libexec/pyenv-virtualenv/${VIRTUALENV_VERSION}`) * Download `virtualenv.py` if desired version has not been installed. -#### 20130507 +#### v20130507 * Display virtualenv information in `--help` and `--version` * Update virtualenv version; 1.8.4 -> 1.9.1 -#### 20130307 +#### v20130307 * Rename the project; `s/python-virtualenv/pyenv-virtualenv/g` * The `pyenv-virtualenv` script is not depending on `python-virtualenv` now. `python-virtualenv` will left for compatibility and will not continue for future releases. * Update virtualenv version; 1.8.2 -> 1.8.4 -#### 20130218 +#### v20130218 * Add pyenv 0.2.x (rbenv 0.4.x) style help messages. -#### 20121023 +#### v20121023 * Create virtualenv with exact name of python executables. * Changed command-line options of python-virtualenv. First argument should be a path to the python executable. * Add install script. -#### 20120927 +#### v20120927 * Initial public release. diff --git a/LICENSE b/LICENSE index 78745fda..4c10f81e 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2015 Yamashita, Yuu +Copyright (c) 2025 Yamashita, Yuu Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the diff --git a/README.md b/README.md index d5338880..266a22a5 100644 --- a/README.md +++ b/README.md @@ -28,27 +28,33 @@ From inside that directory you can: - Get the latest development release by running `git pull` to download the latest changes. +💡 **WSL note:** If you're using WSL, we recommend setting Git to use Unix-style line endings to prevent script execution errors: + +```sh +git config --global core.autocrlf input +``` + 1. **Check out pyenv-virtualenv into plugin directory** - ```sh + ```bash git clone https://github.com/pyenv/pyenv-virtualenv.git $(pyenv root)/plugins/pyenv-virtualenv ``` For the Fish shell: - ```sh + ```fish git clone https://github.com/pyenv/pyenv-virtualenv.git (pyenv root)/plugins/pyenv-virtualenv ``` 2. (OPTIONAL) **Add `pyenv virtualenv-init` to your shell** to enable auto-activation of virtualenvs. This is entirely optional but pretty useful. See "Activate virtualenv" below. - ```sh + ```bash echo 'eval "$(pyenv virtualenv-init -)"' >> ~/.bashrc ``` **Fish shell note**: Add this to your `~/.config/fish/config.fish` - ```sh + ```fish status --is-interactive; and pyenv virtualenv-init - | source ``` @@ -56,7 +62,7 @@ From inside that directory you can: 3. **Restart your shell to enable pyenv-virtualenv** - ```sh + ```bash exec "$SHELL" ``` @@ -82,7 +88,7 @@ brew install --HEAD pyenv-virtualenv ``` After installation, you'll still need to do -[Pyenv shell setup steps](https://github.com/pyenv/pyenv#basic-github-checkout) +[Pyenv shell setup steps](https://github.com/pyenv/pyenv#b-set-up-your-shell-environment-for-pyenv) then add ```sh eval "$(pyenv virtualenv-init -)" @@ -243,6 +249,7 @@ You can set certain environment variables to control pyenv-virtualenv. * `PIP_VERSION`, if set and `venv` is preferred over `virtualenv`, install the specified version of pip. * `PYENV_VIRTUALENV_VERBOSE_ACTIVATE`, if set, shows some verbose outputs on activation and deactivation +* `PYENV_VIRTUALENV_PROMPT`, if set, allows users to customize how `pyenv-virtualenv` modifies their shell prompt. The default prompt ("(venv)") is overwritten with any user-specified text. Specify the location of the virtual environment name with the string `{venv}`. For example, the default prompt string would be `({venv})`. ## Version History diff --git a/bin/pyenv-activate b/bin/pyenv-activate index ef213c12..0f5d324b 100755 --- a/bin/pyenv-activate +++ b/bin/pyenv-activate @@ -22,10 +22,8 @@ fi { printf "\x1B[31;1m" echo - echo "Failed to activate virtualenv." - echo - echo "Perhaps pyenv-virtualenv has not been loaded into your shell properly." - echo "Please restart current shell and try again." + echo "\`pyenv activate' requires Pyenv and Pyenv-Virtualenv to be loaded into your shell." + echo "Check your shell configuration and Pyenv and Pyenv-Virtualenv installation instructions." echo printf "\x1B[0m" } 1>&2 diff --git a/bin/pyenv-deactivate b/bin/pyenv-deactivate index 7d9e1d79..e9e4660e 100755 --- a/bin/pyenv-deactivate +++ b/bin/pyenv-deactivate @@ -11,10 +11,8 @@ set -e { printf "\x1B[31;1m" echo - echo "Failed to deactivate virtualenv." - echo - echo "Perhaps pyenv-virtualenv has not been loaded into your shell properly." - echo "Please restart current shell and try again." + echo "\`pyenv deactivate' requires Pyenv and Pyenv-Virtualenv to be loaded into your shell." + echo "Check your shell configuration and Pyenv and Pyenv-Virtualenv installation instructions." echo printf "\x1B[0m" } 1>&2 diff --git a/bin/pyenv-sh-activate b/bin/pyenv-sh-activate index 38091ee0..5c53b500 100755 --- a/bin/pyenv-sh-activate +++ b/bin/pyenv-sh-activate @@ -262,9 +262,14 @@ EOS fi ;; * ) + if [ -z "${PYENV_VIRTUALENV_PROMPT}" ]; then + PYENV_VIRTUALENV_PROMPT="(${venv})" + else + PYENV_VIRTUALENV_PROMPT="${PYENV_VIRTUALENV_PROMPT/\{venv\}/${venv}}" + fi cat </dev/null || true)" ]]; then - unset COMPAT_PREFIX + ENV_PREFIX="${PYENV_ROOT}/versions/${DEFINITION}" + if [ -L "${ENV_COMPAT_PREFIX}" ]; then + if [[ "${ENV_PREFIX}" != "$(resolve_link "${ENV_COMPAT_PREFIX}" 2>/dev/null || true)" ]]; then + unset ENV_COMPAT_PREFIX fi fi else - if [ -L "${COMPAT_PREFIX}" ]; then - PREFIX="$(resolve_link "${COMPAT_PREFIX}" 2>/dev/null || true)" - if [[ "${PREFIX%/*/envs/*}" != "${PYENV_ROOT}/versions" ]]; then - echo "pyenv-virtualenv: \`${COMPAT_PREFIX}' is a symlink for unknown location." 1>&2 + if [ -L "${ENV_COMPAT_PREFIX}" ]; then + ENV_PREFIX="$(resolve_link "${ENV_COMPAT_PREFIX}" 2>/dev/null || true)" + if [[ "${ENV_PREFIX%/*/envs/*}" != "${PYENV_ROOT}/versions" ]]; then + echo "pyenv-virtualenv: \`${ENV_COMPAT_PREFIX}' is a symlink for unknown location." 1>&2 exit 1 fi else if pyenv-virtualenv-prefix "${VERSION_NAME}" 1>/dev/null 2>&1; then - PREFIX="${PYENV_ROOT}/versions/${VERSION_NAME}" - unset COMPAT_PREFIX + ENV_PREFIX="${PYENV_ROOT}/versions/${VERSION_NAME}" + unset ENV_COMPAT_PREFIX elif [ -z "$FORCE" ]; then echo "pyenv-virtualenv: \`${DEFINITION}' is not a virtualenv." 1>&2 exit 1 @@ -82,23 +84,25 @@ else fi fi -if [ -z "$FORCE" ]; then - if [ ! -d "$PREFIX" ]; then +if [ ! -d "$ENV_PREFIX" ]; then + if [ -z "$FORCE" ]; then echo "pyenv-virtualenv: virtualenv \`$VERSION_NAME' not installed" >&2 exit 1 + else + exit 0 fi +fi - read -p "pyenv-virtualenv: remove $PREFIX? (y/N) " +if [ -z "$FORCE" ]; then + read -p "pyenv-virtualenv: remove $ENV_PREFIX? (y/N) " case "$REPLY" in y* | Y* ) ;; * ) exit 1 ;; esac fi -if [ -d "$PREFIX" ]; then - rm -rf "$PREFIX" - if [ -L "$COMPAT_PREFIX" ]; then - rm -rf "$COMPAT_PREFIX" - fi - pyenv-rehash +rm -rf "$ENV_PREFIX" +if [ -L "$ENV_COMPAT_PREFIX" ]; then + rm -rf "$ENV_COMPAT_PREFIX" fi +pyenv-rehash diff --git a/test/activate.bats b/test/activate.bats index 8c1760a8..25f0f059 100644 --- a/test/activate.bats +++ b/test/activate.bats @@ -15,6 +15,7 @@ setup() { unset PYENV_VIRTUALENV_DISABLE_PROMPT unset PYENV_VIRTUAL_ENV_DISABLE_PROMPT unset VIRTUAL_ENV_DISABLE_PROMPT + unset PYENV_VIRTUALENV_PROMPT unset _OLD_VIRTUAL_PS1 stub pyenv-hooks "activate : echo" } @@ -44,6 +45,31 @@ EOS unstub pyenv-sh-deactivate } +@test "activate virtualenv from current version with custom prompt" { + export PYENV_VIRTUALENV_INIT=1 + + stub pyenv-version-name "echo venv" + stub pyenv-virtualenv-prefix "venv : echo \"${PYENV_ROOT}/versions/venv\"" + stub pyenv-prefix "venv : echo \"${PYENV_ROOT}/versions/venv\"" + stub pyenv-sh-deactivate "--force --quiet : echo deactivated" + + PYENV_SHELL="bash" PYENV_VERSION="venv" PYENV_VIRTUALENV_PROMPT='venv:{venv}' run pyenv-sh-activate + + assert_success + assert_output </dev/null || {