7 Commits

Author SHA1 Message Date
Charlie (cshen.dev)
387f627464 docs: fix the link to Pyenv shell setup steps (#516)
Some checks failed
tests / tests (macos-13) (push) Has been cancelled
tests / tests (macos-14) (push) Has been cancelled
tests / tests (macos-15) (push) Has been cancelled
tests / tests (ubuntu-22.04) (push) Has been cancelled
tests / tests (ubuntu-24.04) (push) Has been cancelled
2025-09-22 08:36:00 +03:00
Seokhee Park
4b3f5f8468 docs: add WSL note about core.autocrlf to prevent CRLF issues (#512)
Some checks failed
tests / tests (macos-13) (push) Has been cancelled
tests / tests (macos-14) (push) Has been cancelled
tests / tests (macos-15) (push) Has been cancelled
tests / tests (ubuntu-22.04) (push) Has been cancelled
tests / tests (ubuntu-24.04) (push) Has been cancelled
2025-05-17 10:19:25 +03:00
Ivan Pozdeev
3057e1549b [CI] Update environments
Some checks failed
tests / tests (macos-13) (push) Has been cancelled
tests / tests (macos-14) (push) Has been cancelled
tests / tests (macos-15) (push) Has been cancelled
tests / tests (ubuntu-22.04) (push) Has been cancelled
tests / tests (ubuntu-24.04) (push) Has been cancelled
ubuntu-20.04 is dropped, macos-15 is available
2025-05-06 19:14:54 +03:00
Jason N. White
aa9b8e9a5a Update LICENSE, fix license year (#499)
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) Has been cancelled
Signed-off-by: JasonnnW3000 <sufssl04@gmail.com>
2025-01-01 20:46:21 +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) Has been cancelled
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 (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) Has been cancelled
Allow output checking with wildcards
2024-11-25 00:54:05 +03:00
9 changed files with 46 additions and 18 deletions

View File

@@ -6,8 +6,9 @@ jobs:
fail-fast: false
matrix:
os:
- ubuntu-24.04
- ubuntu-22.04
- ubuntu-20.04
- macos-15
- macos-14
- macos-13
runs-on: ${{ matrix.os }}

View File

@@ -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

View File

@@ -28,6 +28,12 @@ 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**
```bash
@@ -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 -)"

View File

@@ -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

View File

@@ -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

View File

@@ -605,7 +605,13 @@ STATUS=0
mkdir -p "${PYENV_VIRTUALENV_CACHE_PATH}"
cd "${PYENV_VIRTUALENV_CACHE_PATH}"
if [ -n "${USE_CONDA}" ]; then
pyenv-exec conda create $QUIET $VERBOSE --name "${VIRTUALENV_PATH##*/}" --yes "${VIRTUALENV_OPTIONS[@]}" python || STATUS="$?"
if [ -z "$VIRTUALENV_PYTHON" ]; then
#process substitution doesn't seem to work unless it's directly inserted to the command line
#if we add it to VIRTUALENV_OPTIONS instead, "broken pipe" happens
pyenv-exec conda create $QUIET $VERBOSE --name "${VIRTUALENV_PATH##*/}" --yes "${VIRTUALENV_OPTIONS[@]}" --file <(pyenv-exec conda list python --full-name --export) || STATUS="$?"
else
pyenv-exec conda create $QUIET $VERBOSE --name "${VIRTUALENV_PATH##*/}" --yes "${VIRTUALENV_OPTIONS[@]}" || STATUS="$?"
fi
else
if [ -n "${USE_M_VENV}" ]; then
pyenv-exec "${M_VENV_PYTHON_BIN:-python}" -m venv $QUIET $VERBOSE "${VIRTUALENV_OPTIONS[@]}" "${VIRTUALENV_PATH}" || STATUS="$?"
@@ -625,7 +631,8 @@ fi
## Create symlink in the `versions` directory for backward compatibility
if [ -d "${VIRTUALENV_PATH}" ] && [ -n "${COMPAT_VIRTUALENV_PATH}" ]; then
ln -fs "${VIRTUALENV_PATH}" "${COMPAT_VIRTUALENV_PATH}"
# Overwrite an existing link, can happen if running with -f
ln -fsn "${VIRTUALENV_PATH}" "${COMPAT_VIRTUALENV_PATH}"
fi
if [ ! -e "${VIRTUALENV_PATH}/bin/pydoc" ]; then

View File

@@ -32,8 +32,8 @@ unstub_pyenv() {
run pyenv-virtualenv venv
assert_success
assert_output <<OUT
PYENV_VERSION=miniconda3-3.16.0 conda create --name venv --yes python
assert_output_wildcards <<OUT
PYENV_VERSION=miniconda3-3.16.0 conda create --name venv --yes --file /dev/fd/*
rehashed
OUT
@@ -56,7 +56,7 @@ OUT
assert_success
assert_output <<OUT
PYENV_VERSION=miniconda3-3.16.0 conda create --name venv --yes python=3.5 python
PYENV_VERSION=miniconda3-3.16.0 conda create --name venv --yes python=3.5
rehashed
OUT
@@ -79,7 +79,7 @@ OUT
assert_success
assert_output <<OUT
PYENV_VERSION=miniconda3-3.16.0 conda create --name venv --yes python=3.5 python
PYENV_VERSION=miniconda3-3.16.0 conda create --name venv --yes python=3.5
rehashed
OUT

View File

@@ -83,6 +83,16 @@ assert_equal() {
fi
}
assert_equal_wildcards() {
if [[ $1 != $2 ]]; then
{ echo "expected:"
echo "$2"
echo "actual:"
echo "$1"
} | flunk
fi
}
assert_output() {
local expected
if [ $# -eq 0 ]; then expected="$(cat -)"
@@ -91,6 +101,14 @@ assert_output() {
assert_equal "$expected" "$output"
}
assert_output_wildcards() {
local expected
if [ $# -eq 0 ]; then expected="$(cat -)"
else expected="$1"
fi
assert_equal_wildcards "$output" "$expected"
}
assert_output_contains() {
local expected="$1"
echo "$output" | grep -F "$expected" >/dev/null || {