5 Commits

Author SHA1 Message Date
Ivan Pozdeev
b90bd92853 1.2.3 2024-04-07 22:59:10 +03:00
Ivan Pozdeev
33f54ecad9 Add maintenance guide 2024-04-07 22:50:45 +03:00
native-api
f8469a1c67 Merge pull request #478 from native-api/3drparty_venv_over_ours
Don't activate if a 3rd-party venv is activated over ours
2024-04-03 23:12:47 +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
Ivan Pozdeev
45a28ac094 bump stub and stub fns to Pyenv version 2024-04-03 21:09:22 +03:00
7 changed files with 106 additions and 11 deletions

View File

@@ -1,5 +1,45 @@
## Version History
#### 1.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
* 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
* More helpful error message when requesting a nonexistent base version by @MarcinKonowalczyk in https://github.com/pyenv/pyenv-virtualenv/pull/454
* 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
* 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
* ~/.*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
* Fix get-pip.py URLs for older versions of Python by @jivanf in https://github.com/pyenv/pyenv-virtualenv/pull/403
* Add (y/N) prompt help text by @sh-cho in https://github.com/pyenv/pyenv-virtualenv/pull/404
* perf(sh-activate): avoid a pyenv-version-name call by @scop in https://github.com/pyenv/pyenv-virtualenv/pull/380
* Fix unbound variable errors when running `pyenv activate` with `set -u` Use default empty value. This fixes #422. by @ackalker in https://github.com/pyenv/pyenv-virtualenv/pull/423
* Fix another unbound variable error by @ackalker in https://github.com/pyenv/pyenv-virtualenv/pull/424
* Update `get-pip.py` URLs in `pyenv-virtualenv` by @mcdonnnj in https://github.com/pyenv/pyenv-virtualenv/pull/426
* Deduplicate shims in $PATH for the fish shell during initialization by @ericvw in https://github.com/pyenv/pyenv-virtualenv/pull/430
* Upgrade uninstall hook after pyenv/pyenv#2432 by @laggardkernel in https://github.com/pyenv/pyenv-virtualenv/pull/438
* Stop delete force failing when virtualenv does not exist by @eganjs in https://github.com/pyenv/pyenv-virtualenv/pull/330
* fix: relative path to pyenv-realpath.dylib by @scop in https://github.com/pyenv/pyenv-virtualenv/pull/378
* Spelling fixes by @scop in https://github.com/pyenv/pyenv-virtualenv/pull/352
* Clone bats with --depth=1, gitignore it by @scop in https://github.com/pyenv/pyenv-virtualenv/pull/351
* set -u fixes by @scop in https://github.com/pyenv/pyenv-virtualenv/pull/350
* Set up Github Actions CI by @native-api in https://github.com/pyenv/pyenv-virtualenv/pull/440
* Enhance documentation about options for `pyenv virtualenv` by @pylipp in https://github.com/pyenv/pyenv-virtualenv/pull/425
* Return control to pyenv-uninstall in uninstall/envs.bash by @aiguofer in https://github.com/pyenv/pyenv-virtualenv/pull/321
* 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
* Fix install script (#290, #302)

15
MAINTENANCE.md Normal file
View File

@@ -0,0 +1,15 @@
Creating a release
==================
The release of the new version of Pyenv is done via GitHub Releases.
Release checklist:
* Start [drafting a new release on GitHub](https://github.com/pyenv/pyenv-virtualenv/releases) to generate a summary of changes. Save the summary locally.
* The summary may need editing. E.g. rephrase entries, delete/merge entries that are too minor or irrelevant to the users (e.g. typo fixes, CI)
* Push the version number in `bin/pyenv-virtualenv`
* Minor version is pushed if there are significant functional changes (not e.g. bugfixes/formula adaptations/supporting niche use cases).
* Major version is pushed if there are breaking changes
* Update `CHANGELOG.md` with the new version number and the edited summary (only the changes section), reformatting it like the rest of the changelog sections
* Commit the changes locally into `master`
* Create a new tag with the new version number and push the changes including the tag
* Create a new release on GitHub based on the tag, using the saved summary

View File

@@ -96,8 +96,8 @@ fi
venv="${versions}"
if [ -n "${VIRTUAL_ENV}" ]; then
# exit as success if some virtualenv is already activated outside from pyenv-virtualenv
if [ -z "${PYENV_VIRTUAL_ENV}" ]; then
# exit as success if a non-pyenv virtualenv is active
if [[ -z $PYENV_VIRTUAL_ENV || $PYENV_VIRTUAL_ENV != "$VIRTUAL_ENV" ]]; then
if [ -z "${FORCE}" ]; then
if [ -z "${QUIET}" ]; then
echo "pyenv-virtualenv: virtualenv \`${VIRTUAL_ENV}' is already activated" 1>&2

View File

@@ -13,7 +13,7 @@
# -u/--upgrade Imply --force
#
PYENV_VIRTUALENV_VERSION="1.2.2"
PYENV_VIRTUALENV_VERSION="1.2.3"
set -e
[ -n "$PYENV_DEBUG" ] && set -x

View File

@@ -439,6 +439,34 @@ EOS
unstub pyenv-prefix
}
@test "do nothing if a 3rd-party virtualenv is active" {
export PYENV_VIRTUALENV_INIT=1
export VIRTUAL_ENV="${TMP}/venv-3rd-party"
unset PYENV_VIRTUAL_ENV
PYENV_SHELL="bash" run pyenv-sh-activate "venv"
assert_success
assert_output <<EOS
pyenv-virtualenv: virtualenv \`${TMP}/venv-3rd-party' is already activated
true
EOS
}
@test "do nothing if a 3rd-party virtualenv is active over ours" {
export PYENV_VIRTUALENV_INIT=1
export VIRTUAL_ENV="${TMP}/venv-3rd-party"
export PYENV_VIRTUAL_ENV="${PYENV_ROOT}/versions/venv"
PYENV_SHELL="bash" run pyenv-sh-activate "venv"
assert_success
assert_output <<EOS
pyenv-virtualenv: virtualenv \`${TMP}/venv-3rd-party' is already activated
true
EOS
}
@test "should fail if activate is invoked as a command" {
run pyenv-activate

View File

@@ -11,11 +11,10 @@ _STUB_RUN="${PROGRAM}_STUB_RUN"
_STUB_INDEX="${PROGRAM}_STUB_INDEX"
_STUB_RESULT="${PROGRAM}_STUB_RESULT"
_STUB_END="${PROGRAM}_STUB_END"
_STUB_DEBUG="${PROGRAM}_STUB_DEBUG"
_STUB_LOG="${PROGRAM}_STUB_LOG"
if [ -n "${!_STUB_DEBUG}" ]; then
echo "$program" "$@" >&${!_STUB_DEBUG}
fi
[ -n "${!_STUB_LOG}" ] || eval "${_STUB_LOG}"="${TMPDIR}/${program}-stub-log"
if test -z "${!_STUB_END}"; then echo "$program" "$@" >>"${!_STUB_LOG}"; fi
[ -e "${!_STUB_PLAN}" ] || exit 1
[ -n "${!_STUB_RUN}" ] || eval "${_STUB_RUN}"="${TMPDIR}/${program}-stub-run"
@@ -24,7 +23,7 @@ fi
# Initialize or load the stub run information.
eval "${_STUB_INDEX}"=1
eval "${_STUB_RESULT}"=0
[ ! -e "${!_STUB_RUN}" ] || source "${!_STUB_RUN}"
if test -e "${!_STUB_RUN}"; then source "${!_STUB_RUN}"; fi
# Loop over each line in the plan.
@@ -80,14 +79,26 @@ done < "${!_STUB_PLAN}"
if [ -n "${!_STUB_END}" ]; then
# Clean up the run file.
rm -f "${!_STUB_RUN}"
# If the number of lines in the plan is larger than
# the requested index, we failed.
if [ $index -ge "${!_STUB_INDEX}" ]; then
eval "${_STUB_RESULT}"=1
fi
if [ "${!_STUB_RESULT}" -ne 0 ]; then
{
echo "index: $index; stub index: ${!_STUB_INDEX}"
echo "plan:"
cat "${!_STUB_PLAN}" || true
echo "run:"
cat "${!_STUB_RUN}" || true
echo "log:"
cat "${!_STUB_LOG}" || true
} >&2
fi
# Clean up the run file.
rm -f "${!_STUB_RUN}"
rm -f "${!_STUB_LOG}"
# Return the result.
exit "${!_STUB_RESULT}"

View File

@@ -16,6 +16,7 @@ stub() {
export "${prefix}_STUB_PLAN"="${TMP}/${program}-stub-plan"
export "${prefix}_STUB_RUN"="${TMP}/${program}-stub-run"
export "${prefix}_STUB_LOG"="${TMP}/${program}-stub-log"
export "${prefix}_STUB_END"=
mkdir -p "${TMP}/bin"