From 6559554c3a1749bef018477e264180715d8232fb Mon Sep 17 00:00:00 2001 From: Jason Myers Date: Mon, 29 Aug 2016 20:55:08 -0500 Subject: [PATCH 01/95] Fixes Issues #248 Signed-off-by: Jason Myers --- virtualenvwrapper.sh | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/virtualenvwrapper.sh b/virtualenvwrapper.sh index 2104cb4..d960eaa 100644 --- a/virtualenvwrapper.sh +++ b/virtualenvwrapper.sh @@ -244,8 +244,8 @@ function virtualenvwrapper_run_hook { source "$hook_script" elif [ "${1}" = "initialize" ] then - cat - 1>&2 <&2 <&2 return 1 @@ -557,7 +557,7 @@ function rmvirtualenv { # List the available environments. function virtualenvwrapper_show_workon_options { virtualenvwrapper_verify_workon_home || return 1 - # NOTE: DO NOT use ls or cd here because colorized versions spew control + # NOTE: DO NOT use ls or cd here because colorized versions spew control # characters into the output list. # echo seems a little faster than find, even with -depth 3. # Note that this is a little tricky, as there may be spaces in the path. @@ -572,7 +572,7 @@ function virtualenvwrapper_show_workon_options { # a slash, as that is an illegal character in a directory name. # This yields a slash-separated list of possible env names. # 4. Replace each slash with a newline to show the output one name per line. - # 5. Eliminate any lines with * on them because that means there + # 5. Eliminate any lines with * on them because that means there # were no envs. (virtualenvwrapper_cd "$WORKON_HOME" && echo */$VIRTUALENVWRAPPER_ENV_BIN_DIR/activate) 2>/dev/null \ | command \tr "\n" " " \ @@ -947,7 +947,7 @@ function cpvirtualenv { typeset src_name="$1" typeset trg_name="$2" typeset src - typeset trg + typeset trg # without a source there is nothing to do if [ "$src_name" = "" ]; then @@ -991,10 +991,10 @@ function cpvirtualenv { echo "Copying $src_name as $trg_name..." ( - [ -n "$ZSH_VERSION" ] && setopt SH_WORD_SPLIT + [ -n "$ZSH_VERSION" ] && setopt SH_WORD_SPLIT virtualenvwrapper_cd "$WORKON_HOME" && - "$VIRTUALENVWRAPPER_VIRTUALENV_CLONE" "$src" "$trg" - [ -d "$trg" ] && + "$VIRTUALENVWRAPPER_VIRTUALENV_CLONE" "$src" "$trg" + [ -d "$trg" ] && virtualenvwrapper_run_hook "pre_cpvirtualenv" "$src" "$trg_name" && virtualenvwrapper_run_hook "pre_mkvirtualenv" "$trg_name" ) From 63596865a18093dff7707687a68491aeb5c5e8e0 Mon Sep 17 00:00:00 2001 From: Audrey Dutcher Date: Sat, 3 Nov 2018 22:00:39 -0700 Subject: [PATCH 02/95] Make mkvirtualenv work with interpreters whose paths have spaces --- virtualenvwrapper.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/virtualenvwrapper.sh b/virtualenvwrapper.sh index ade8ddd..4d000b8 100644 --- a/virtualenvwrapper.sh +++ b/virtualenvwrapper.sh @@ -461,7 +461,7 @@ function mkvirtualenv { i=$(( $i + 1 )) done - if [ ! -z $interpreter ] + if [ ! -z "$interpreter" ] then out_args=( "--python=$interpreter" ${out_args[@]} ) fi; From b71ddca0837cf193b1e8bb05f3c4e2c937913bb4 Mon Sep 17 00:00:00 2001 From: Lumir Balhar Date: Tue, 19 Feb 2019 14:36:36 +0100 Subject: [PATCH 03/95] Find the highest Python version with installed virtualenvwrapper --- virtualenvwrapper.sh | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/virtualenvwrapper.sh b/virtualenvwrapper.sh index ade8ddd..45b0493 100644 --- a/virtualenvwrapper.sh +++ b/virtualenvwrapper.sh @@ -45,9 +45,21 @@ # # Locate the global Python where virtualenvwrapper is installed. +# Use the highest Python version if [ "${VIRTUALENVWRAPPER_PYTHON:-}" = "" ] then - VIRTUALENVWRAPPER_PYTHON="$(command \which python)" + for NAME in python3 python2 python + do + PYTHON="$(command \which $NAME 2>&1)" + if ! [ -z $PYTHON ] + then + if $PYTHON -m 'virtualenvwrapper.hook_loader' --help >/dev/null 2>&1 + then + VIRTUALENVWRAPPER_PYTHON=$PYTHON + break + fi + fi + done fi # Set the name of the virtualenv app to use. From 0ea789333df5ded2e275fcfabb41dcdeec4faef6 Mon Sep 17 00:00:00 2001 From: Lumir Balhar Date: Tue, 12 Mar 2019 13:08:41 +0100 Subject: [PATCH 04/95] fixup! Find the highest Python version with installed virtualenvwrapper --- virtualenvwrapper.sh | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/virtualenvwrapper.sh b/virtualenvwrapper.sh index 45b0493..e83f666 100644 --- a/virtualenvwrapper.sh +++ b/virtualenvwrapper.sh @@ -50,16 +50,23 @@ if [ "${VIRTUALENVWRAPPER_PYTHON:-}" = "" ] then for NAME in python3 python2 python do - PYTHON="$(command \which $NAME 2>&1)" - if ! [ -z $PYTHON ] + python_executable="$(which $NAME 2>/dev/null)" + if ! [ -z "$python_executable" ] then - if $PYTHON -m 'virtualenvwrapper.hook_loader' --help >/dev/null 2>&1 + if $python_executable -m 'virtualenvwrapper.hook_loader' --help >/dev/null 2>&1 then - VIRTUALENVWRAPPER_PYTHON=$PYTHON + VIRTUALENVWRAPPER_PYTHON=$python_executable break fi fi done + if [ "${VIRTUALENVWRAPPER_PYTHON:-}" = "" ] + then + echo -e "ERROR: Python with virtualenvwrapper module not found! +Either, install virtualenvwrapper module for standard python2 +or python3 or set VIRTUALENVWRAPPER_PYTHON variable manually." 1>&2 + return 1 + fi fi # Set the name of the virtualenv app to use. From d41b18b918803fd2f3464b29ea7dc922c521691b Mon Sep 17 00:00:00 2001 From: Shailesh Vashishth Date: Sun, 25 Aug 2019 09:29:55 +0000 Subject: [PATCH 05/95] index.rst edited online with Bitbucket --- docs/source/index.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/index.rst b/docs/source/index.rst index eabd39d..29e088d 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -25,7 +25,7 @@ Features 4. Tab completion for commands that take a virtual environment as argument. 5. User-configurable hooks for all operations (see :ref:`scripts`). -6. Plugin system for more creating sharable extensions (see +6. Plugin system for creating more sharable extensions (see :ref:`plugins`). ============ From 426961c10e885cabf5a31eb049845c54e14da2f3 Mon Sep 17 00:00:00 2001 From: Stephan Sokolow Date: Sat, 23 Nov 2019 00:56:43 +0000 Subject: [PATCH 06/95] Improve Zsh prompt tip Closes #332 --- docs/source/tips.rst | 80 ++++++++++++++++++++++++++++++++++---------- 1 file changed, 63 insertions(+), 17 deletions(-) diff --git a/docs/source/tips.rst b/docs/source/tips.rst index c610322..c32bdf9 100644 --- a/docs/source/tips.rst +++ b/docs/source/tips.rst @@ -10,25 +10,71 @@ an email or post a comment on `this blog post `__ and I'll add it here. -zsh Prompt -========== - -From Nat (was blogger.com/profile/16779944428406910187): - -Using zsh, I added some bits to ``$WORKON_HOME/post(de)activate`` to show -the active virtualenv on the right side of my screen instead. - -in ``postactivate``:: - - PS1="$_OLD_VIRTUAL_PS1" - _OLD_RPROMPT="$RPROMPT" - RPROMPT="%{${fg_bold[white]}%}(env: %{${fg[green]}%}`basename \"$VIRTUAL_ENV\"`%{${fg_bold[white]}%})%{${reset_color}%} $RPROMPT" - -and in ``postdeactivate``:: +Enhanced bash/zsh Prompt +======================== + +Via `Stephan Sokolow `_ + +While the virtualenv ``activate`` script does attempt to provide +an indicator in the prompt, it has various shortcomings, and +cannot be customized. + +However, it does also set a shell variable named +``VIRTUAL_ENV`` which can be used as the basis for disabling the +built-in prompt indicator and substituting an improved one, +as a customization to ``.bashrc`` or ``.zshrc``:: + + virtualenv_prompt() { + # If not in a virtualenv, print nothing + [[ "$VIRTUAL_ENV" == "" ]] && return + + # Distinguish between the shell where the virtualenv was activated + # and its children + local venv_name="${VIRTUAL_ENV##*/}" + if typeset -f deactivate >/dev/null; then + echo "[${venv_name}] " + else + echo "<${venv_name}> " + fi + } + + # Display a "we are in a virtualenv" indicator that works in child shells too + VIRTUAL_ENV_DISABLE_PROMPT=1 + PS1='$(virtualenv_prompt)'"$PS1" + +This basic example works in both bash and zsh and has the following +advantages: + +1. It will also display in sub-shells, because it works by having the + shell detect an active virtualenv, rather than by having the ``activate`` + script modify the prompt for just the current shell instance. +2. It will clearly indicate if you're in a subshell, where the + virtualenv will still apply, but the ``deactivate`` command will be + missing. + +However, if you are using zsh, a better example of what the design +is capable of can be constructed by taking advantage of zsh's built-in +support for easily adding color and right-aligned segments to prompts:: + + zsh_virtualenv_prompt() { + # If not in a virtualenv, print nothing + [[ "$VIRTUAL_ENV" == "" ]] && return + + # Distinguish between the shell where the virtualenv was activated + # and its children + local venv_name="${VIRTUAL_ENV##*/}" + if typeset -f deactivate >/dev/null; then + echo "[%F{green}${venv_name}%f] " + else + echo "<%F{green}${venv_name}%f> " + fi + } - RPROMPT="$_OLD_RPROMPT" + setopt PROMPT_SUBST PROMPT_PERCENT -Adjust colors according to your own personal tastes or environment. + # Display a "we are in a virtualenv" indicator that works in child shells too + VIRTUAL_ENV_DISABLE_PROMPT=1 + RPS1='$(zsh_virtualenv_prompt)' Updating cached ``$PATH`` entries ================================= From 9eeeb1bf45987fc5ba334e07095f5e32cb04a9bc Mon Sep 17 00:00:00 2001 From: Doug Hellmann Date: Sun, 9 Feb 2020 09:34:56 -0500 Subject: [PATCH 07/95] improve some of the wording in the readme The project is maintained by more than one person, so replace "I" with "we", etc. Link to the places that we want users to report problems or send pull requests. Signed-off-by: Doug Hellmann --- README.txt | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/README.txt b/README.txt index 1b7221a..f64a874 100644 --- a/README.txt +++ b/README.txt @@ -52,13 +52,16 @@ Supported Shells ================ virtualenvwrapper is a set of shell *functions* defined in Bourne -shell compatible syntax. It is tested under ``bash``, ``ksh``, and ``zsh``. -It may work with other shells, so if you find that it does work with a -shell not listed here please let me know. If you can modify it to -work with another shell, without completely rewriting it, send a pull -request through the bitbucket project page. If you write a clone to -work with an incompatible shell, let me know and I will link to it -from this page. +shell compatible syntax. It is tested under ``bash``, ``ksh``, and +``zsh``. It may work with other shells, so if you find that it does +work with a shell not listed here please let us know by opening a +`ticket on bitbucket +`_. +If you can modify it to work with another shell, without completely +rewriting it, send a pull request through the `bitbucket project page +`_. If +you write a clone to work with an incompatible shell, let us know and +we will link to it from this page. Python Versions =============== From 0b9e83541c59d1763cfd82984fd5dd287670aa7b Mon Sep 17 00:00:00 2001 From: Doug Hellmann Date: Sun, 9 Feb 2020 18:33:35 -0500 Subject: [PATCH 08/95] fix link to screencast Link directly to the vimeo page instead of the blog post, which no longer exists. Signed-off-by: Doug Hellmann --- README.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.txt b/README.txt index 1b7221a..ebd09b7 100644 --- a/README.txt +++ b/README.txt @@ -37,8 +37,8 @@ Features 6. Plugin system for more creating sharable extensions. Rich Leland has created a short `screencast -`__ -showing off the features of virtualenvwrapper. +`__ showing off the features of +virtualenvwrapper. ============ Installation From ef7548c63acd8a4cf31421a6406861bf40f179e6 Mon Sep 17 00:00:00 2001 From: Jason Myers Date: Fri, 14 Feb 2020 09:39:40 -0600 Subject: [PATCH 09/95] Updating to support virtualenv 20+ Signed-off-by: Jason Myers --- Makefile | 2 +- docs/source/developers.rst | 2 +- docs/source/index.rst | 38 +++++++++++++++---------------- requirements.txt | 2 +- setup.cfg | 4 ++-- tox.ini | 2 +- virtualenvwrapper.sh | 2 +- virtualenvwrapper/user_scripts.py | 2 +- 8 files changed, 27 insertions(+), 27 deletions(-) diff --git a/Makefile b/Makefile index 253bab6..10e44a7 100644 --- a/Makefile +++ b/Makefile @@ -40,7 +40,7 @@ test: tox test-quick: - tox -e py27 + tox -e py37 develop: python setup.py develop diff --git a/docs/source/developers.rst b/docs/source/developers.rst index 83ce8e4..6e0e560 100644 --- a/docs/source/developers.rst +++ b/docs/source/developers.rst @@ -50,7 +50,7 @@ documentation:: writing output... [100%] index writing additional files... search - copying static files... WARNING: static directory '/Users/dhellmann/Devel/virtualenvwrapper/plugins/docs/sphinx/pkg/static' does not exist + copying static files... WARNING: static directory '/Users/username/Devel/virtualenvwrapper/plugins/docs/sphinx/pkg/static' does not exist done dumping search index... done dumping object inventory... done diff --git a/docs/source/index.rst b/docs/source/index.rst index 29e088d..02a98cd 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -54,10 +54,10 @@ installed by pip or your package manager. .................................................... .................................................... ...............................done. - virtualenvwrapper.user_scripts Creating /Users/dhellmann/Envs/env1/bin/predeactivate - virtualenvwrapper.user_scripts Creating /Users/dhellmann/Envs/env1/bin/postdeactivate - virtualenvwrapper.user_scripts Creating /Users/dhellmann/Envs/env1/bin/preactivate - virtualenvwrapper.user_scripts Creating /Users/dhellmann/Envs/env1/bin/postactivate New python executable in env1/bin/python + virtualenvwrapper.user_scripts Creating /Users/username/Envs/env1/bin/predeactivate + virtualenvwrapper.user_scripts Creating /Users/username/Envs/env1/bin/postdeactivate + virtualenvwrapper.user_scripts Creating /Users/username/Envs/env1/bin/preactivate + virtualenvwrapper.user_scripts Creating /Users/username/Envs/env1/bin/postactivate New python executable in env1/bin/python (env1)$ ls $WORKON_HOME env1 hook.log @@ -72,7 +72,7 @@ Now we can install some software into the environment. Installing collected packages: django Running setup.py install for django changing mode of build/scripts-2.6/django-admin.py from 644 to 755 - changing mode of /Users/dhellmann/Envs/env1/bin/django-admin.py to 755 + changing mode of /Users/username/Envs/env1/bin/django-admin.py to 755 Successfully installed django We can see the new package with ``lssitepackages``:: @@ -91,10 +91,10 @@ Of course we are not limited to a single virtualenv:: .................................................... .................................................... ........... ...............................done. - virtualenvwrapper.user_scripts Creating /Users/dhellmann/Envs/env2/bin/predeactivate - virtualenvwrapper.user_scripts Creating /Users/dhellmann/Envs/env2/bin/postdeactivate - virtualenvwrapper.user_scripts Creating /Users/dhellmann/Envs/env2/bin/preactivate - virtualenvwrapper.user_scripts Creating /Users/dhellmann/Envs/env2/bin/postactivate New python executable in env2/bin/python + virtualenvwrapper.user_scripts Creating /Users/username/Envs/env2/bin/predeactivate + virtualenvwrapper.user_scripts Creating /Users/username/Envs/env2/bin/postdeactivate + virtualenvwrapper.user_scripts Creating /Users/username/Envs/env2/bin/preactivate + virtualenvwrapper.user_scripts Creating /Users/username/Envs/env2/bin/postactivate New python executable in env2/bin/python (env2)$ ls $WORKON_HOME env1 env2 hook.log @@ -102,7 +102,7 @@ Switch between environments with ``workon``:: (env2)$ workon env1 (env1)$ echo $VIRTUAL_ENV - /Users/dhellmann/Envs/env1 + /Users/username/Envs/env1 (env1)$ The ``workon`` command also includes tab completion for the @@ -114,7 +114,7 @@ is activated or deactivated (see :ref:`scripts`). (env1)$ echo 'cd $VIRTUAL_ENV' >> $WORKON_HOME/postactivate (env1)$ workon env2 (env2)$ pwd - /Users/dhellmann/Envs/env2 + /Users/username/Envs/env2 :ref:`scripts-postmkvirtualenv` is run when a new environment is created, letting you automatically install commonly-used tools. @@ -128,10 +128,10 @@ created, letting you automatically install commonly-used tools. .................................................... .................................................... ........... ...............................done. - virtualenvwrapper.user_scripts Creating /Users/dhellmann/Envs/env3/bin/predeactivate - virtualenvwrapper.user_scripts Creating /Users/dhellmann/Envs/env3/bin/postdeactivate - virtualenvwrapper.user_scripts Creating /Users/dhellmann/Envs/env3/bin/preactivate - virtualenvwrapper.user_scripts Creating /Users/dhellmann/Envs/env3/bin/postactivate + virtualenvwrapper.user_scripts Creating /Users/username/Envs/env3/bin/predeactivate + virtualenvwrapper.user_scripts Creating /Users/username/Envs/env3/bin/postdeactivate + virtualenvwrapper.user_scripts Creating /Users/username/Envs/env3/bin/preactivate + virtualenvwrapper.user_scripts Creating /Users/username/Envs/env3/bin/postactivate Downloading/unpacking sphinx Downloading Sphinx-0.6.5.tar.gz (972Kb): 972Kb downloaded Running setup.py egg_info for package sphinx @@ -152,12 +152,12 @@ created, letting you automatically install commonly-used tools. Running setup.py install for Pygments Running setup.py install for sphinx no previously-included directories found matching 'doc/_build' - Installing sphinx-build script to /Users/dhellmann/Envs/env3/bin - Installing sphinx-quickstart script to /Users/dhellmann/Envs/env3/bin - Installing sphinx-autogen script to /Users/dhellmann/Envs/env3/bin + Installing sphinx-build script to /Users/username/Envs/env3/bin + Installing sphinx-quickstart script to /Users/username/Envs/env3/bin + Installing sphinx-autogen script to /Users/username/Envs/env3/bin Successfully installed docutils Jinja2 Pygments sphinx (env3)$ (venv3)$ which sphinx-build - /Users/dhellmann/Envs/env3/bin/sphinx-build + /Users/username/Envs/env3/bin/sphinx-build Through a combination of the existing functions defined by the core package (see :ref:`command`), third-party plugins (see diff --git a/requirements.txt b/requirements.txt index 8f54551..9bcb2ef 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ -virtualenv +virtualenv>=20.0.4 virtualenv-clone stevedore diff --git a/setup.cfg b/setup.cfg index d24d69d..6348038 100644 --- a/setup.cfg +++ b/setup.cfg @@ -10,13 +10,13 @@ classifier = License :: OSI Approved :: MIT License Programming Language :: Python Programming Language :: Python :: 2 - Programming Language :: Python :: 2.6 Programming Language :: Python :: 2.7 Programming Language :: Python :: 3 - Programming Language :: Python :: 3.3 Programming Language :: Python :: 3.4 Programming Language :: Python :: 3.5 Programming Language :: Python :: 3.6 + Programming Language :: Python :: 3.7 + Programming Language :: Python :: 3.8 Intended Audience :: Developers Environment :: Console keywords = diff --git a/tox.ini b/tox.ini index ba242cc..3e475e1 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py27,py33,py34,py35,py36,zsh,ksh,style +envlist = py27,py34,py35,py36,py37,py38,zsh,ksh,style [testenv] install_command = pip install -U {opts} {packages} diff --git a/virtualenvwrapper.sh b/virtualenvwrapper.sh index e83f666..aebe9f1 100644 --- a/virtualenvwrapper.sh +++ b/virtualenvwrapper.sh @@ -82,7 +82,7 @@ then fi # Define script folder depending on the platorm (Win32/Unix) -VIRTUALENVWRAPPER_ENV_BIN_DIR="bin" +VIRTUALENVWRAPPER_ENV_BIN_DIR="usr/local/bin" if [ "${OS:-}" = "Windows_NT" ] && ([ "${MSYSTEM:-}" = "MINGW32" ] || [ "${MSYSTEM:-}" = "MINGW64" ]) then # Only assign this for msys, cygwin use standard Unix paths diff --git a/virtualenvwrapper/user_scripts.py b/virtualenvwrapper/user_scripts.py index 8a5eedc..b76fffb 100644 --- a/virtualenvwrapper/user_scripts.py +++ b/virtualenvwrapper/user_scripts.py @@ -23,7 +23,7 @@ script_folder = 'Scripts' else: is_msys = False - script_folder = 'bin' + script_folder = 'usr/local/bin' def _get_msys_shell(): From 9b1e4374d368a6f18f5495cfe11ea78a82509dde Mon Sep 17 00:00:00 2001 From: Jason Myers Date: Fri, 14 Feb 2020 10:07:41 -0600 Subject: [PATCH 10/95] Fixing readme.txt Signed-off-by: Jason Myers --- README.txt | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/README.txt b/README.txt index e08b371..4aea1ed 100644 --- a/README.txt +++ b/README.txt @@ -11,12 +11,7 @@ managing your development workflow, making it easier to work on more than one project at a time without introducing conflicts in their dependencies. -**Warning:** The 4.x release includes some potentially incompatible -changes for extensions from 3.x. The python modules for extensions are -now *always* run with ``PWD=$WORKON_HOME`` (previously the value of -PWD varied depending on the hook). The *shell* portion of any hook -(anything sourced by the user's shell when the hook is run) is still -run in the same place as before. +**Warning:** The 5.x release requires virtualenv 20+ ======== Features From f481be386e527c53bb2cc81ed965b66a93d4e792 Mon Sep 17 00:00:00 2001 From: Jason Myers Date: Sun, 16 Feb 2020 12:41:48 -0600 Subject: [PATCH 11/95] Revert "Merged in 334 (pull request #78)" This reverts commit 3ca9883fdeb543c0ac52e650e028d40a1d2afa74, reversing changes made to ef6b567687191c3613ca3cc3f6cdb783f0721a09. --- Makefile | 2 +- docs/source/developers.rst | 2 +- docs/source/index.rst | 38 +++++++++++++++---------------- requirements.txt | 2 +- setup.cfg | 4 ++-- tox.ini | 2 +- virtualenvwrapper.sh | 2 +- virtualenvwrapper/user_scripts.py | 2 +- 8 files changed, 27 insertions(+), 27 deletions(-) diff --git a/Makefile b/Makefile index 10e44a7..253bab6 100644 --- a/Makefile +++ b/Makefile @@ -40,7 +40,7 @@ test: tox test-quick: - tox -e py37 + tox -e py27 develop: python setup.py develop diff --git a/docs/source/developers.rst b/docs/source/developers.rst index 6e0e560..83ce8e4 100644 --- a/docs/source/developers.rst +++ b/docs/source/developers.rst @@ -50,7 +50,7 @@ documentation:: writing output... [100%] index writing additional files... search - copying static files... WARNING: static directory '/Users/username/Devel/virtualenvwrapper/plugins/docs/sphinx/pkg/static' does not exist + copying static files... WARNING: static directory '/Users/dhellmann/Devel/virtualenvwrapper/plugins/docs/sphinx/pkg/static' does not exist done dumping search index... done dumping object inventory... done diff --git a/docs/source/index.rst b/docs/source/index.rst index 02a98cd..29e088d 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -54,10 +54,10 @@ installed by pip or your package manager. .................................................... .................................................... ...............................done. - virtualenvwrapper.user_scripts Creating /Users/username/Envs/env1/bin/predeactivate - virtualenvwrapper.user_scripts Creating /Users/username/Envs/env1/bin/postdeactivate - virtualenvwrapper.user_scripts Creating /Users/username/Envs/env1/bin/preactivate - virtualenvwrapper.user_scripts Creating /Users/username/Envs/env1/bin/postactivate New python executable in env1/bin/python + virtualenvwrapper.user_scripts Creating /Users/dhellmann/Envs/env1/bin/predeactivate + virtualenvwrapper.user_scripts Creating /Users/dhellmann/Envs/env1/bin/postdeactivate + virtualenvwrapper.user_scripts Creating /Users/dhellmann/Envs/env1/bin/preactivate + virtualenvwrapper.user_scripts Creating /Users/dhellmann/Envs/env1/bin/postactivate New python executable in env1/bin/python (env1)$ ls $WORKON_HOME env1 hook.log @@ -72,7 +72,7 @@ Now we can install some software into the environment. Installing collected packages: django Running setup.py install for django changing mode of build/scripts-2.6/django-admin.py from 644 to 755 - changing mode of /Users/username/Envs/env1/bin/django-admin.py to 755 + changing mode of /Users/dhellmann/Envs/env1/bin/django-admin.py to 755 Successfully installed django We can see the new package with ``lssitepackages``:: @@ -91,10 +91,10 @@ Of course we are not limited to a single virtualenv:: .................................................... .................................................... ........... ...............................done. - virtualenvwrapper.user_scripts Creating /Users/username/Envs/env2/bin/predeactivate - virtualenvwrapper.user_scripts Creating /Users/username/Envs/env2/bin/postdeactivate - virtualenvwrapper.user_scripts Creating /Users/username/Envs/env2/bin/preactivate - virtualenvwrapper.user_scripts Creating /Users/username/Envs/env2/bin/postactivate New python executable in env2/bin/python + virtualenvwrapper.user_scripts Creating /Users/dhellmann/Envs/env2/bin/predeactivate + virtualenvwrapper.user_scripts Creating /Users/dhellmann/Envs/env2/bin/postdeactivate + virtualenvwrapper.user_scripts Creating /Users/dhellmann/Envs/env2/bin/preactivate + virtualenvwrapper.user_scripts Creating /Users/dhellmann/Envs/env2/bin/postactivate New python executable in env2/bin/python (env2)$ ls $WORKON_HOME env1 env2 hook.log @@ -102,7 +102,7 @@ Switch between environments with ``workon``:: (env2)$ workon env1 (env1)$ echo $VIRTUAL_ENV - /Users/username/Envs/env1 + /Users/dhellmann/Envs/env1 (env1)$ The ``workon`` command also includes tab completion for the @@ -114,7 +114,7 @@ is activated or deactivated (see :ref:`scripts`). (env1)$ echo 'cd $VIRTUAL_ENV' >> $WORKON_HOME/postactivate (env1)$ workon env2 (env2)$ pwd - /Users/username/Envs/env2 + /Users/dhellmann/Envs/env2 :ref:`scripts-postmkvirtualenv` is run when a new environment is created, letting you automatically install commonly-used tools. @@ -128,10 +128,10 @@ created, letting you automatically install commonly-used tools. .................................................... .................................................... ........... ...............................done. - virtualenvwrapper.user_scripts Creating /Users/username/Envs/env3/bin/predeactivate - virtualenvwrapper.user_scripts Creating /Users/username/Envs/env3/bin/postdeactivate - virtualenvwrapper.user_scripts Creating /Users/username/Envs/env3/bin/preactivate - virtualenvwrapper.user_scripts Creating /Users/username/Envs/env3/bin/postactivate + virtualenvwrapper.user_scripts Creating /Users/dhellmann/Envs/env3/bin/predeactivate + virtualenvwrapper.user_scripts Creating /Users/dhellmann/Envs/env3/bin/postdeactivate + virtualenvwrapper.user_scripts Creating /Users/dhellmann/Envs/env3/bin/preactivate + virtualenvwrapper.user_scripts Creating /Users/dhellmann/Envs/env3/bin/postactivate Downloading/unpacking sphinx Downloading Sphinx-0.6.5.tar.gz (972Kb): 972Kb downloaded Running setup.py egg_info for package sphinx @@ -152,12 +152,12 @@ created, letting you automatically install commonly-used tools. Running setup.py install for Pygments Running setup.py install for sphinx no previously-included directories found matching 'doc/_build' - Installing sphinx-build script to /Users/username/Envs/env3/bin - Installing sphinx-quickstart script to /Users/username/Envs/env3/bin - Installing sphinx-autogen script to /Users/username/Envs/env3/bin + Installing sphinx-build script to /Users/dhellmann/Envs/env3/bin + Installing sphinx-quickstart script to /Users/dhellmann/Envs/env3/bin + Installing sphinx-autogen script to /Users/dhellmann/Envs/env3/bin Successfully installed docutils Jinja2 Pygments sphinx (env3)$ (venv3)$ which sphinx-build - /Users/username/Envs/env3/bin/sphinx-build + /Users/dhellmann/Envs/env3/bin/sphinx-build Through a combination of the existing functions defined by the core package (see :ref:`command`), third-party plugins (see diff --git a/requirements.txt b/requirements.txt index 9bcb2ef..8f54551 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ -virtualenv>=20.0.4 +virtualenv virtualenv-clone stevedore diff --git a/setup.cfg b/setup.cfg index 6348038..d24d69d 100644 --- a/setup.cfg +++ b/setup.cfg @@ -10,13 +10,13 @@ classifier = License :: OSI Approved :: MIT License Programming Language :: Python Programming Language :: Python :: 2 + Programming Language :: Python :: 2.6 Programming Language :: Python :: 2.7 Programming Language :: Python :: 3 + Programming Language :: Python :: 3.3 Programming Language :: Python :: 3.4 Programming Language :: Python :: 3.5 Programming Language :: Python :: 3.6 - Programming Language :: Python :: 3.7 - Programming Language :: Python :: 3.8 Intended Audience :: Developers Environment :: Console keywords = diff --git a/tox.ini b/tox.ini index 3e475e1..ba242cc 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py27,py34,py35,py36,py37,py38,zsh,ksh,style +envlist = py27,py33,py34,py35,py36,zsh,ksh,style [testenv] install_command = pip install -U {opts} {packages} diff --git a/virtualenvwrapper.sh b/virtualenvwrapper.sh index aebe9f1..e83f666 100644 --- a/virtualenvwrapper.sh +++ b/virtualenvwrapper.sh @@ -82,7 +82,7 @@ then fi # Define script folder depending on the platorm (Win32/Unix) -VIRTUALENVWRAPPER_ENV_BIN_DIR="usr/local/bin" +VIRTUALENVWRAPPER_ENV_BIN_DIR="bin" if [ "${OS:-}" = "Windows_NT" ] && ([ "${MSYSTEM:-}" = "MINGW32" ] || [ "${MSYSTEM:-}" = "MINGW64" ]) then # Only assign this for msys, cygwin use standard Unix paths diff --git a/virtualenvwrapper/user_scripts.py b/virtualenvwrapper/user_scripts.py index b76fffb..8a5eedc 100644 --- a/virtualenvwrapper/user_scripts.py +++ b/virtualenvwrapper/user_scripts.py @@ -23,7 +23,7 @@ script_folder = 'Scripts' else: is_msys = False - script_folder = 'usr/local/bin' + script_folder = 'bin' def _get_msys_shell(): From 1a7bec7500ce2af4648a70b9f301810d4afca9d3 Mon Sep 17 00:00:00 2001 From: Alexander Huynh Date: Mon, 12 Sep 2022 06:54:22 +0000 Subject: [PATCH 12/95] replace deprecated `egrep` with `grep -E` On newer verions of GNU grep, this warning pops up: egrep: warning: egrep is obsolescent; using grep -E Suppress the warning by doing what it asks. See the following for more detail: https://www.phoronix.com/news/GNU-Grep-3.8-Stop-egrep-fgrep --- virtualenvwrapper.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/virtualenvwrapper.sh b/virtualenvwrapper.sh index e83f666..4127a08 100644 --- a/virtualenvwrapper.sh +++ b/virtualenvwrapper.sh @@ -177,7 +177,7 @@ function virtualenvwrapper_derive_workon_home { # path might contain stuff to expand. # (it might be possible to do this in shell, but I don't know a # cross-shell-safe way of doing it -wolever) - if echo "$workon_home_dir" | (unset GREP_OPTIONS; command \egrep '([\$~]|//)' >/dev/null) + if echo "$workon_home_dir" | (unset GREP_OPTIONS; command \grep -E '([\$~]|//)' >/dev/null) then # This will normalize the path by: # - Removing extra slashes (e.g., when TMPDIR ends in a slash) @@ -599,7 +599,7 @@ function virtualenvwrapper_show_workon_options { | command \sed "s|/$VIRTUALENVWRAPPER_ENV_BIN_DIR/activate |/|g" \ | command \tr "/" "\n" \ | command \sed "/^\s*$/d" \ - | (unset GREP_OPTIONS; command \egrep -v '^\*$') 2>/dev/null + | (unset GREP_OPTIONS; command \grep -E -v '^\*$') 2>/dev/null } function _lsvirtualenv_usage { @@ -1306,7 +1306,7 @@ function wipeenv { virtualenvwrapper_verify_active_environment || return 1 typeset req_file="$(virtualenvwrapper_tempfile "requirements.txt")" - pip freeze | egrep -v '(distribute|wsgiref|appdirs|packaging|pyparsing|six)' > "$req_file" + pip freeze | grep -E -v '(distribute|wsgiref|appdirs|packaging|pyparsing|six)' > "$req_file" if [ -n "$(cat "$req_file")" ] then echo "Uninstalling packages:" From 60122f0ff80516458f67872390c29e875cbbe103 Mon Sep 17 00:00:00 2001 From: Doug Hellmann Date: Sun, 15 Jan 2023 10:25:07 -0500 Subject: [PATCH 13/95] add github action configuration for test jobs --- .github/workflows/test.yml | 118 +++++++++++++++++++++++++++++++++++++ 1 file changed, 118 insertions(+) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..ce8761c --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,118 @@ +name: Test + +on: + - push + - pull_request + +jobs: + + # Test different python versions with bash on Ubuntu. + ubuntu: + name: Test Ubuntu + runs-on: ubuntu-latest + if: ${{ !startsWith(github.ref, 'refs/tags') }} + + strategy: + fail-fast: false + matrix: + python-version: + - 3.8 + - 3.9 + - "3.10" + - "3.11" + + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + + - name: Install dependencies + run: python -m pip install tox + + - name: Run tests + run: tox -e py + + # Test the latest python version with zsh on macOS + zsh: + name: Test Zsh + runs-on: macos-latest + if: ${{ !startsWith(github.ref, 'refs/tags') }} + + strategy: + fail-fast: false + + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + + - name: Install dependencies + run: python -m pip install tox + + - name: Run tests + run: tox -e zsh + + # Test different python versions with bash on macOS + macos: + name: Test macOS + runs-on: macos-latest + if: ${{ !startsWith(github.ref, 'refs/tags') }} + + strategy: + fail-fast: false + matrix: + python-version: + - 3.8 + - 3.9 + - "3.10" + - "3.11" + + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + + - name: Install dependencies + run: python -m pip install tox + + - name: Run tests + run: tox -e py + + # Run various style checkers + style: + runs-on: ubuntu-latest + if: ${{ !startsWith(github.ref, 'refs/tags') }} + + strategy: + fail-fast: false + tox-environment: + - docs + - style + - pkglint + + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Set up Python + uses: actions/setup-python@v4 + + - name: Install dependencies + run: python -m pip install tox + + - name: Run + run: tox -e ${{ matrix.tox-environment }} From 63285b933fdb7878e39504f356479260448ca66d Mon Sep 17 00:00:00 2001 From: Doug Hellmann Date: Sun, 15 Jan 2023 10:37:17 -0500 Subject: [PATCH 14/95] fix linter action config --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ce8761c..05a1838 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -98,10 +98,10 @@ jobs: strategy: fail-fast: false - tox-environment: + matrix: + tox-environment: - docs - style - - pkglint steps: - uses: actions/checkout@v3 From 8b4885f26c618056a0e905349f0cf7c95ed98d4a Mon Sep 17 00:00:00 2001 From: Doug Hellmann Date: Sun, 15 Jan 2023 10:39:25 -0500 Subject: [PATCH 15/95] set the version of python to use for linter jobs --- .github/workflows/test.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 05a1838..ead0771 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -110,6 +110,8 @@ jobs: - name: Set up Python uses: actions/setup-python@v4 + with: + python-version: "3.11" - name: Install dependencies run: python -m pip install tox From f5b8523040f537545287fdb3eba3c5ae4298b6da Mon Sep 17 00:00:00 2001 From: Doug Hellmann Date: Sun, 15 Jan 2023 10:40:07 -0500 Subject: [PATCH 16/95] do not specify python version for docs env in tox settings --- tox.ini | 1 - 1 file changed, 1 deletion(-) diff --git a/tox.ini b/tox.ini index ba242cc..b20ddae 100644 --- a/tox.ini +++ b/tox.ini @@ -31,7 +31,6 @@ setenv = commands = ksh ./tests/run_tests {envdir} [] [testenv:docs] -basepython=python2.7 deps = -r{toxinidir}/requirements.txt -r{toxinidir}/docs/requirements.txt From ef3d2d12b16409202c9077077228fa2065eefcf8 Mon Sep 17 00:00:00 2001 From: Doug Hellmann Date: Sun, 15 Jan 2023 10:41:36 -0500 Subject: [PATCH 17/95] update tox config for tox 4 --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index b20ddae..e375374 100644 --- a/tox.ini +++ b/tox.ini @@ -8,7 +8,7 @@ deps = -rrequirements.txt setenv = TOXIC = true SHELL = /bin/bash -whitelist_externals = +allowlist_externals = bash zsh ksh From 5c78c0d5f8ac4de3198e70b4480c5aeb6d070165 Mon Sep 17 00:00:00 2001 From: Doug Hellmann Date: Sun, 15 Jan 2023 10:43:46 -0500 Subject: [PATCH 18/95] set python version for zsh job in ci --- .github/workflows/test.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ead0771..4ae527f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -53,6 +53,8 @@ jobs: - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v4 + with: + python-version: "3.11" - name: Install dependencies run: python -m pip install tox From 1f2c153ed979d88f2d56a11ef7f2f35c5e220bd4 Mon Sep 17 00:00:00 2001 From: Doug Hellmann Date: Sun, 15 Jan 2023 10:57:46 -0500 Subject: [PATCH 19/95] add pkglint test and fix some warnings --- .github/workflows/test.yml | 1 + setup.cfg | 6 +++--- tox.ini | 10 ++++++++++ 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4ae527f..3d39c3c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -104,6 +104,7 @@ jobs: tox-environment: - docs - style + - pkglint steps: - uses: actions/checkout@v3 diff --git a/setup.cfg b/setup.cfg index d24d69d..c459b66 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,9 +1,9 @@ [metadata] name = virtualenvwrapper author = Doug Hellmann -author-email = doug@doughellmann.com +author_email = doug@doughellmann.com summary = Enhancements to virtualenv -description-file = README.txt +description_file = README.txt license = MIT classifier = Development Status :: 5 - Production/Stable @@ -21,7 +21,7 @@ classifier = Environment :: Console keywords = virtualenv -home-page = https://virtualenvwrapper.readthedocs.io/ +home_page = https://virtualenvwrapper.readthedocs.io/ zip_safe = False [files] diff --git a/tox.ini b/tox.ini index e375374..f8b2751 100644 --- a/tox.ini +++ b/tox.ini @@ -35,3 +35,13 @@ deps = -r{toxinidir}/requirements.txt -r{toxinidir}/docs/requirements.txt commands = python setup.py build_sphinx + +[testenv:pkglint] +deps= + pbr + twine + check-python-versions +commands= + python setup.py sdist + twine check dist/*.tar.gz + check-python-versions --only setup.py,setup.cfg,.github/workflows/test.yml From 0399e4ad20441a8f5848a7bf625c438d4b69399c Mon Sep 17 00:00:00 2001 From: Doug Hellmann Date: Sun, 15 Jan 2023 10:33:35 -0500 Subject: [PATCH 20/95] update trove classifiers with more modern python versions fixes #7 --- setup.cfg | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/setup.cfg b/setup.cfg index c459b66..0ec5d5c 100644 --- a/setup.cfg +++ b/setup.cfg @@ -9,15 +9,12 @@ classifier = Development Status :: 5 - Production/Stable License :: OSI Approved :: MIT License Programming Language :: Python - Programming Language :: Python :: 2 - Programming Language :: Python :: 2.6 - Programming Language :: Python :: 2.7 Programming Language :: Python :: 3 - Programming Language :: Python :: 3.3 - Programming Language :: Python :: 3.4 - Programming Language :: Python :: 3.5 - Programming Language :: Python :: 3.6 - Intended Audience :: Developers + Programming Language :: Python :: 3.8 + Programming Language :: Python :: 3.9 + Programming Language :: Python :: 3.10 + Programming Language :: Python :: 3.11 +Intended Audience :: Developers Environment :: Console keywords = virtualenv From 9dddc079955cfafabd43c4c2bb3f00afcb5b871c Mon Sep 17 00:00:00 2001 From: Jason Myers Date: Sun, 15 Jan 2023 10:09:00 -0600 Subject: [PATCH 21/95] Updating references to bitbucket Fixes: python-virtualenvwrapper/virtualenvwrapper#9 --- README.es.rst | 2 +- README.ja.rst | 4 ++-- README.txt | 12 ++++++------ docs/source/developers.rst | 4 ++-- docs/source/extensions.rst | 4 ++-- docs/source/index.rst | 4 ++-- docs/source/install.rst | 4 ++-- docs/source/plugins.rst | 2 +- docs/source/projects.rst | 6 +++--- 9 files changed, 21 insertions(+), 21 deletions(-) diff --git a/README.es.rst b/README.es.rst index 6147175..15d6764 100644 --- a/README.es.rst +++ b/README.es.rst @@ -80,4 +80,4 @@ USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -.. _BitBucket: http://bitbucket.org/dhellmann/virtualenvwrapper/overview/ +.. _github: https://github.com/python-virtualenvwrapper/virtualenvwrapper/ diff --git a/README.ja.rst b/README.ja.rst index 805f0ce..b540423 100644 --- a/README.ja.rst +++ b/README.ja.rst @@ -48,7 +48,7 @@ virtualenvwrapper は Bourne シェル互換の構文で定義された ここに記載されていないシェルで動作することを発見したら私に 教えてください。もしあなたがその他のシェルで動作させるために virtualenvwrapper を完全に書き直すことなく修正できるなら、 -bitbucket のプロジェクトページを通じて pull リクエストを +GitHub のプロジェクトページを通じて pull リクエストを 送ってください。あなたが非互換なシェル上で動作させるクローンを 作成するなら、このページでリンクを張るので私に連絡してください。 @@ -84,7 +84,7 @@ virtualenvwrapper のコアへ新しい機能を追加する前に、 `virtualenvwrapper Google Group `__ に参加してください。 -`BitBucket のバグトラッカー `__ +`github のバグトラッカー `__ でバグを報告してください。 シェルエイリアス diff --git a/README.txt b/README.txt index 4aea1ed..bd42fbe 100644 --- a/README.txt +++ b/README.txt @@ -50,11 +50,11 @@ virtualenvwrapper is a set of shell *functions* defined in Bourne shell compatible syntax. It is tested under ``bash``, ``ksh``, and ``zsh``. It may work with other shells, so if you find that it does work with a shell not listed here please let us know by opening a -`ticket on bitbucket -`_. +`ticket on GitHub +`_. If you can modify it to work with another shell, without completely -rewriting it, send a pull request through the `bitbucket project page -`_. If +rewriting it, send a pull request through the `GitHub project page +`_. If you write a clone to work with an incompatible shell, let us know and we will link to it from this page. @@ -71,8 +71,8 @@ Join the `virtualenvwrapper Google Group `__ to discuss issues and features. -Report bugs via the `bug tracker on Bitbucket -`__. +Report bugs via the `bug tracker on GitHub +`__. Shell Aliases ============= diff --git a/docs/source/developers.rst b/docs/source/developers.rst index 83ce8e4..692d60e 100644 --- a/docs/source/developers.rst +++ b/docs/source/developers.rst @@ -4,8 +4,8 @@ For Developers If you would like to contribute to virtualenvwrapper directly, these instructions should help you get started. Patches, bug reports, and -feature requests are all welcome through the `BitBucket site -`_. Contributions +feature requests are all welcome through the `GitHub site +`_. Contributions in the form of patches or pull requests are easier to integrate and will receive priority attention. diff --git a/docs/source/extensions.rst b/docs/source/extensions.rst index 8b300f3..8814546 100644 --- a/docs/source/extensions.rst +++ b/docs/source/extensions.rst @@ -45,13 +45,13 @@ Templates Below is a list of some of the templates available for use with :ref:`command-mkproject`. -.. _templates-bitbucket: +.. _templates-github: bitbucket --------- The bitbucket_ extension automatically clones a mercurial repository -from the specified bitbucket project. +from the specified Bitbucket project. .. _bitbucket: https://pypi.python.org/pypi/virtualenvwrapper.bitbucket diff --git a/docs/source/index.rst b/docs/source/index.rst index 29e088d..f0fc0e1 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -211,8 +211,8 @@ Join the `virtualenvwrapper Google Group `__ to discuss issues and features. -Report bugs via the `bug tracker on BitBucket -`__. +Report bugs via the `bug tracker on GitHub +`__. Shell Aliases ============= diff --git a/docs/source/install.rst b/docs/source/install.rst index 2aafa8d..2826b79 100644 --- a/docs/source/install.rst +++ b/docs/source/install.rst @@ -18,11 +18,11 @@ shells on OS X and Linux: It may work with other shells, so if you find that it does work with a shell not listed here please let me know. If you can modify it to work with another shell without completely rewriting it, then send a pull -request through the `bitbucket project page`_. If you write a clone to +request through the `GitHub project page`_. If you write a clone to work with an incompatible shell, let me know and I will link to it from this page. -.. _bitbucket project page: https://bitbucket.org/virtualenvwrapper/virtualenvwrapper/ +.. _github project page: https://GitHub.com/python-virtualenvwrapper/virtualenvwrapper/ Windows Command Prompt ---------------------- diff --git a/docs/source/plugins.rst b/docs/source/plugins.rst index a27a406..63e8e0c 100644 --- a/docs/source/plugins.rst +++ b/docs/source/plugins.rst @@ -396,4 +396,4 @@ respectively. .. _Setuptools entry points: https://setuptools.readthedocs.io/en/latest/pkg_resources.html#entry-points -.. _project: https://bitbucket.org/virtualenvwrapper/virtualenvwrapper +.. _project: https://github.com/python-virtualenvwrapper/virtualenvwrapper diff --git a/docs/source/projects.rst b/docs/source/projects.rst index c08ea33..501b61f 100644 --- a/docs/source/projects.rst +++ b/docs/source/projects.rst @@ -23,13 +23,13 @@ A new project directory can be created empty, or populated using one or more :term:`template` plugins. Templates should be specified as arguments to :ref:`command-mkproject`. Multiple values can be provided to apply more than one template. For example, to check out a Mercurial -repository from a project on bitbucket and create a new Django -site, combine the :ref:`templates-bitbucket` and +repository from a project on GitHub and create a new Django +site, combine the :ref:`templates-github` and :ref:`templates-django` templates. :: - $ mkproject -t bitbucket -t django my_site + $ mkproject -t github -t django my_site .. seealso:: From 83eecfb7901e10bdae16f5fc73155b6402942643 Mon Sep 17 00:00:00 2001 From: Doug Hellmann Date: Thu, 12 Jan 2023 16:23:00 -0500 Subject: [PATCH 22/95] expand the relative path for envdir to the full path tox is passing a relative directory, but the script wants a full path in some cases. --- tests/run_tests | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/run_tests b/tests/run_tests index aa2e55c..82ee36b 100755 --- a/tests/run_tests +++ b/tests/run_tests @@ -1,7 +1,7 @@ # -*- mode: shell-script -*- #set -x -envdir="$1" +envdir="$(cd $1 && pwd)" shift scripts="$*" if [ -z "$scripts" ] From 7cd5da4bad0bb65e0a6645aa588d474444ef4b7d Mon Sep 17 00:00:00 2001 From: Doug Hellmann Date: Thu, 12 Jan 2023 16:35:20 -0500 Subject: [PATCH 23/95] run all of the tests and accumulate errors --- tests/run_tests | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/run_tests b/tests/run_tests index 82ee36b..8ad74a6 100755 --- a/tests/run_tests +++ b/tests/run_tests @@ -44,6 +44,7 @@ unset VIRTUALENVWRAPPER_VIRTUALENV_ARGS # Run the test scripts with a little formatting around them to make it # easier to find where each script output starts. +RC=0 for test_script in $scripts do @@ -66,9 +67,11 @@ do echo SHUNIT_PARENT="$test_script" export SHUNIT_PARENT - $SHELL $test_shell_opts $test_script || exit 1 + if ! $SHELL $test_shell_opts $test_script; then + RC=1 + fi echo done -exit 0 +exit $RC From 5c857be68c5741bfed300a3de983c2c5b01ff8e7 Mon Sep 17 00:00:00 2001 From: Jason Myers Date: Sun, 15 Jan 2023 10:27:19 -0600 Subject: [PATCH 24/95] missed ones --- README.ja.rst | 2 +- docs/source/install.rst | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.ja.rst b/README.ja.rst index b540423..a3931e7 100644 --- a/README.ja.rst +++ b/README.ja.rst @@ -84,7 +84,7 @@ virtualenvwrapper のコアへ新しい機能を追加する前に、 `virtualenvwrapper Google Group `__ に参加してください。 -`github のバグトラッカー `__ +`GitHub のバグトラッカー `__ でバグを報告してください。 シェルエイリアス diff --git a/docs/source/install.rst b/docs/source/install.rst index 2826b79..0769ce7 100644 --- a/docs/source/install.rst +++ b/docs/source/install.rst @@ -22,7 +22,7 @@ request through the `GitHub project page`_. If you write a clone to work with an incompatible shell, let me know and I will link to it from this page. -.. _github project page: https://GitHub.com/python-virtualenvwrapper/virtualenvwrapper/ +.. _GitHub project page: https://GitHub.com/python-virtualenvwrapper/virtualenvwrapper/ Windows Command Prompt ---------------------- From 599583c3a9a070e4f23e7cd17b775ce9f3544be9 Mon Sep 17 00:00:00 2001 From: Doug Hellmann Date: Sun, 15 Jan 2023 11:29:10 -0500 Subject: [PATCH 25/95] add a "fast" environment in tox to exit as soon as any test fails The default in CI is still to run all of the tests. --- docs/source/developers.rst | 5 +++++ tests/run_tests | 6 ++++++ tox.ini | 6 ++++++ 3 files changed, 17 insertions(+) diff --git a/docs/source/developers.rst b/docs/source/developers.rst index 83ce8e4..8f13c03 100644 --- a/docs/source/developers.rst +++ b/docs/source/developers.rst @@ -86,6 +86,11 @@ Python:: $ tox -e py27 tests/test_cd.sh +To stop the test suite as soon as any test fails, use the `fast` tox +target:: + + $ tox -e fast + Add new tests by modifying an existing file or creating new script in the ``tests`` directory. diff --git a/tests/run_tests b/tests/run_tests index 8ad74a6..9176386 100755 --- a/tests/run_tests +++ b/tests/run_tests @@ -14,6 +14,9 @@ then fi fi +# Override FAIL_FAST to true to exit as soon as any test fails +FAIL_FAST=${FAIL_FAST:-false} + # Force the tox virtualenv to be active. # # Since this script runs from within a separate shell created by tox, @@ -69,6 +72,9 @@ do export SHUNIT_PARENT if ! $SHELL $test_shell_opts $test_script; then RC=1 + if $FAIL_FAST; then + exit $RC + fi fi echo diff --git a/tox.ini b/tox.ini index f8b2751..8b84cb1 100644 --- a/tox.ini +++ b/tox.ini @@ -13,6 +13,12 @@ allowlist_externals = zsh ksh +[testenv:fast] +setenv = + TOXIC = true + SHELL = /bin/bash + FAIL_FAST = true + [testenv:style] deps = flake8 commands = flake8 virtualenvwrapper docs/source/conf.py From d6201d950ad82dad9ea50e12c167dd8a3cd1d290 Mon Sep 17 00:00:00 2001 From: Doug Hellmann Date: Thu, 12 Jan 2023 16:23:45 -0500 Subject: [PATCH 26/95] update test runner to use python3 --- tests/run_tests | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/run_tests b/tests/run_tests index 9176386..68cb362 100755 --- a/tests/run_tests +++ b/tests/run_tests @@ -36,7 +36,7 @@ export HOOK_VERBOSE_OPTION # Force virtualenvwrapper to use the python interpreter in the # tox-created virtualenv. -VIRTUALENVWRAPPER_PYTHON="$envdir/bin/python" +VIRTUALENVWRAPPER_PYTHON="$envdir/bin/python3" export VIRTUALENVWRAPPER_PYTHON # Clear any user settings for the hook directory or log directory From e8b6fd2830cbce413c87c8903ef5d31abb26d371 Mon Sep 17 00:00:00 2001 From: Doug Hellmann Date: Sun, 15 Jan 2023 11:19:41 -0500 Subject: [PATCH 27/95] update tox to only use default python version --- docs/source/developers.rst | 12 +++++++----- tox.ini | 2 +- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/docs/source/developers.rst b/docs/source/developers.rst index 8f13c03..8de06e5 100644 --- a/docs/source/developers.rst +++ b/docs/source/developers.rst @@ -69,22 +69,24 @@ The test suite for virtualenvwrapper uses shunit2_ and tox_. The shunit2 source is included in the ``tests`` directory, but tox must be installed separately (``pip install tox``). -To run the tests under bash, zsh, and ksh for Python 2.7 through 3.6, -run ``tox`` from the top level directory of the hg repository. +To run the tests under bash and zsh for the default Python, +run ``tox`` from the top level directory of the hg repository:: + + $ tox To run individual test scripts, use a command like:: - $ tox tests/test_cd.sh + $ tox -- tests/test_cd.sh To run tests under a single version of Python, specify the appropriate environment when running tox:: - $ tox -e py27 + $ tox -e py311 Combine the two modes to run specific tests with a single version of Python:: - $ tox -e py27 tests/test_cd.sh + $ tox -e py311 -- tests/test_cd.sh To stop the test suite as soon as any test fails, use the `fast` tox target:: diff --git a/tox.ini b/tox.ini index 8b84cb1..4226abd 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py27,py33,py34,py35,py36,zsh,ksh,style +envlist = py,zsh,style [testenv] install_command = pip install -U {opts} {packages} From 655878f7210c43649b9174e6ba76da5160aa1489 Mon Sep 17 00:00:00 2001 From: Doug Hellmann Date: Sun, 15 Jan 2023 11:19:59 -0500 Subject: [PATCH 28/95] update tox config to not set basepython for zsh --- tox.ini | 1 - 1 file changed, 1 deletion(-) diff --git a/tox.ini b/tox.ini index 4226abd..ad7c3f6 100644 --- a/tox.ini +++ b/tox.ini @@ -24,7 +24,6 @@ deps = flake8 commands = flake8 virtualenvwrapper docs/source/conf.py [testenv:zsh] -basepython=python2.7 setenv = SHELL = /bin/zsh test_shell_opts = -o shwordsplit From 04a2c3d151fe95c115b603dec6e57d24c4e18e67 Mon Sep 17 00:00:00 2001 From: Doug Hellmann Date: Sun, 15 Jan 2023 11:26:12 -0500 Subject: [PATCH 29/95] remove the test for making virtualenvs relocatable The --relocatable flag was removed from virtualenv, so there is no need to test that mode any more. --- tests/test_cp.sh | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/tests/test_cp.sh b/tests/test_cp.sh index fc93ec1..d5cdf2c 100755 --- a/tests/test_cp.sh +++ b/tests/test_cp.sh @@ -98,17 +98,6 @@ test_virtualenvwrapper_virtualenv_clone_variable () { assertTrue "VIRTUALENVWRAPPER_CLONE did not clone fake file" "[ -f $WORKON_HOME/destination/fake_virtualenv_clone_was_here ]" } -test_source_relocatable () { - mkvirtualenv "source" >/dev/null 2>&1 - (cd tests/testpackage && python setup.py install) >/dev/null 2>&1 - assertTrue "virtualenv --relocatable \"$WORKON_HOME/source\"" - cpvirtualenv "source" "destination" >/dev/null 2>&1 - testscript="$(which testscript.py)" - assertTrue "Environment test script not the same as copy" "[ $WORKON_HOME/destination/bin/testscript.py -ef $testscript ]" - assertTrue virtualenvwrapper_verify_active_environment - assertSame "Wrong virtualenv name" "destination" $(basename "$VIRTUAL_ENV") -} - test_source_does_not_exist () { assertSame "Please provide a valid virtualenv to copy." "$(cpvirtualenv virtualenvthatdoesntexist foo)" } From d9f58eafadebdd713b60c0edc29a9b4f047c799a Mon Sep 17 00:00:00 2001 From: Doug Hellmann Date: Sun, 15 Jan 2023 11:33:04 -0500 Subject: [PATCH 30/95] remove tests and features relying on --no-site-packages virtualenv dropped the --no-site-packages option. This PR updates the code and tests to remove features related to that missing option. * remove copy tests for --no-site-packages * update test_mktmpenv_virtualenv_args to not need --no-site-packages * update mkvirtualenv tests to not rely on --no-site-packages * remove toggleglobalsitepackages command related to #8 --- docs/source/command_ref.rst | 30 ------------------ tests/test_cp.sh | 29 ----------------- tests/test_lazy_loaded.sh | 4 --- tests/test_mktmpenv.sh | 6 ++-- tests/test_mkvirtualenv.sh | 29 +++++------------ tests/test_toggleglobalsitepackages.sh | 43 -------------------------- virtualenvwrapper.sh | 16 ---------- 7 files changed, 10 insertions(+), 147 deletions(-) delete mode 100755 tests/test_toggleglobalsitepackages.sh diff --git a/docs/source/command_ref.rst b/docs/source/command_ref.rst index f2e2f33..eadb850 100644 --- a/docs/source/command_ref.rst +++ b/docs/source/command_ref.rst @@ -465,36 +465,6 @@ for the environment. *Based on a contribution from James Bennett and Jannis Leidel.* -.. _command-toggleglobalsitepackages: - -toggleglobalsitepackages ------------------------- - -Controls whether the active virtualenv will access the packages in the -global Python ``site-packages`` directory. - -Syntax:: - - toggleglobalsitepackages [-q] - -Outputs the new state of the virtualenv. Use the ``-q`` switch to turn off all -output. - -:: - - $ mkvirtualenv env1 - New python executable in env1/bin/python - Installing setuptools............................................. - .................................................................. - .................................................................. - done. - (env1)$ toggleglobalsitepackages - Disabled global site-packages - (env1)$ toggleglobalsitepackages - Enabled global site-packages - (env1)$ toggleglobalsitepackages -q - (env1)$ - ============================ Project Directory Management ============================ diff --git a/tests/test_cp.sh b/tests/test_cp.sh index d5cdf2c..3bd9196 100755 --- a/tests/test_cp.sh +++ b/tests/test_cp.sh @@ -137,33 +137,4 @@ GLOBAL postcpvirtualenv" rm -f "$WORKON_HOME/postmkvirtualenv" } -test_no_site_packages () { - # See issue #102 - mkvirtualenv "source" --no-site-packages >/dev/null 2>&1 - cpvirtualenv "source" "destination" >/dev/null 2>&1 - ngsp_file="`virtualenvwrapper_get_site_packages_dir`/../no-global-site-packages.txt" - assertTrue "$ngsp_file does not exist in copied env" "[ -f \"$ngsp_file\" ]" -} - -test_no_site_packages_default_args () { - # See issue #102 - VIRTUALENVWRAPPER_VIRTUALENV_ARGS="--no-site-packages" - # With the argument, verify that they are not copied. - mkvirtualenv "source" >/dev/null 2>&1 - cpvirtualenv "source" "destination" >/dev/null 2>&1 - ngsp_file="`virtualenvwrapper_get_site_packages_dir`/../no-global-site-packages.txt" - assertTrue "$ngsp_file does not exist" "[ -f \"$ngsp_file\" ]" - unset VIRTUALENVWRAPPER_VIRTUALENV_ARGS -} - -test_no_site_packages_default_behavior () { - # See issue #102 - # virtualenv 1.7 changed to make --no-site-packages the default - mkvirtualenv "source" >/dev/null 2>&1 - cpvirtualenv "source" "destination" >/dev/null 2>&1 - ngsp_file="`virtualenvwrapper_get_site_packages_dir`/../no-global-site-packages.txt" - assertTrue "$ngsp_file does not exist in copied env" "[ -f \"$ngsp_file\" ]" -} - . "$test_dir/shunit2" - diff --git a/tests/test_lazy_loaded.sh b/tests/test_lazy_loaded.sh index 46e4f58..9d217c2 100755 --- a/tests/test_lazy_loaded.sh +++ b/tests/test_lazy_loaded.sh @@ -64,10 +64,6 @@ test_lssitepackages_defined_normal() { function_defined_normal lssitepackages } -test_toggleglobalsitepackages_defined_normal() { - function_defined_normal toggleglobalsitepackages -} - test_cpvirtualenv_defined_normal() { function_defined_normal cpvirtualenv } diff --git a/tests/test_mktmpenv.sh b/tests/test_mktmpenv.sh index c8989bc..6a1171d 100755 --- a/tests/test_mktmpenv.sh +++ b/tests/test_mktmpenv.sh @@ -43,9 +43,9 @@ test_mktmpenv_no_cd() { } test_mktmpenv_virtualenv_args() { - mktmpenv --no-site-packages >/dev/null 2>&1 - ngsp_file="`virtualenvwrapper_get_site_packages_dir`/../no-global-site-packages.txt" - assertTrue "$ngsp_file does not exist" "[ -f \"$ngsp_file\" ]" + mktmpenv --without-pip >/dev/null 2>&1 + contents="$(lssitepackages)" + assertFalse "found pip in site-packages: ${contents}" "echo $contents | grep -q pip" } test_deactivate() { diff --git a/tests/test_mkvirtualenv.sh b/tests/test_mkvirtualenv.sh index bbfd543..3c37dfe 100755 --- a/tests/test_mkvirtualenv.sh +++ b/tests/test_mkvirtualenv.sh @@ -104,23 +104,6 @@ test_no_workon_home () { WORKON_HOME="$old_home" } -test_mkvirtualenv_sitepackages () { - # This part of the test is not reliable because - # creating a new virtualenv from inside the - # tox virtualenv inherits the setting from there. -# # Without the option, verify that site-packages are copied. -# mkvirtualenv "with_sp" >/dev/null 2>&1 -# ngsp_file="`virtualenvwrapper_get_site_packages_dir`/../no-global-site-packages.txt" -# assertFalse "$ngsp_file exists" "[ -f \"$ngsp_file\" ]" -# rmvirtualenv "env3" - - # With the argument, verify that they are not copied. - mkvirtualenv --no-site-packages "without_sp" >/dev/null 2>&1 - ngsp_file="`virtualenvwrapper_get_site_packages_dir`/../no-global-site-packages.txt" - assertTrue "$ngsp_file does not exist" "[ -f \"$ngsp_file\" ]" - rmvirtualenv "env4" >/dev/null 2>&1 -} - test_mkvirtualenv_hooks_system_site_packages () { # See issue #189 @@ -143,12 +126,14 @@ GLOBAL postmkvirtualenv" test_mkvirtualenv_args () { # See issue #102 - VIRTUALENVWRAPPER_VIRTUALENV_ARGS="--no-site-packages" + VIRTUALENVWRAPPER_VIRTUALENV_ARGS="--without-pip" # With the argument, verify that they are not copied. - mkvirtualenv "without_sp2" >/dev/null 2>&1 - ngsp_file="`virtualenvwrapper_get_site_packages_dir`/../no-global-site-packages.txt" - assertTrue "$ngsp_file does not exist" "[ -f \"$ngsp_file\" ]" - rmvirtualenv "env4" >/dev/null 2>&1 + mkvirtualenv "without_pip" >/dev/null 2>&1 + local RC=$? + assertTrue "mkvirtualenv failed" "[ $RC -eq 0 ]" + contents="$(lssitepackages)" + assertFalse "found pip in site-packages: ${contents}" "echo $contents | grep -q pip" + rmvirtualenv "without_pip" >/dev/null 2>&1 unset VIRTUALENVWRAPPER_VIRTUALENV_ARGS } diff --git a/tests/test_toggleglobalsitepackages.sh b/tests/test_toggleglobalsitepackages.sh deleted file mode 100755 index c1d3d82..0000000 --- a/tests/test_toggleglobalsitepackages.sh +++ /dev/null @@ -1,43 +0,0 @@ -# -*- mode: shell-script -*- - -test_dir=$(cd $(dirname $0) && pwd) -source "$test_dir/setup.sh" - -oneTimeSetUp() { - rm -rf "$WORKON_HOME" - mkdir -p "$WORKON_HOME" - source "$test_dir/../virtualenvwrapper.sh" -} - -oneTimeTearDown() { - rm -rf "$WORKON_HOME" -} - -setUp () { - echo -} - -tearDown () { - deactivate >/dev/null 2>&1 -} - -test_toggleglobalsitepackages () { - mkvirtualenv --no-site-packages "test1" - ngsp_file=$(dirname "`virtualenvwrapper_get_site_packages_dir`")/no-global-site-packages.txt - assertTrue "$ngsp_file does not exist 1" "[ -f \"$ngsp_file\" ]" - toggleglobalsitepackages -q - assertFalse "$ngsp_file exists" "[ -f \"$ngsp_file\" ]" - toggleglobalsitepackages -q - assertTrue "$ngsp_file does not exist 2" "[ -f \"$ngsp_file\" ]" -} - -test_toggleglobalsitepackages_quiet () { - mkvirtualenv --no-site-packages "test2" - assertEquals "Command output is not correct" "Enabled global site-packages" "`toggleglobalsitepackages`" - assertEquals "Command output is not correct" "Disabled global site-packages" "`toggleglobalsitepackages`" - - assertEquals "Command output is not correct" "" "`toggleglobalsitepackages -q`" - assertEquals "Command output is not correct" "" "`toggleglobalsitepackages -q`" -} - -. "$test_dir/shunit2" diff --git a/virtualenvwrapper.sh b/virtualenvwrapper.sh index edf0313..f80a087 100644 --- a/virtualenvwrapper.sh +++ b/virtualenvwrapper.sh @@ -948,22 +948,6 @@ function lssitepackages { fi } -# Toggles the currently-active virtualenv between having and not having -# access to the global site-packages. -#:help:toggleglobalsitepackages: turn access to global site-packages on/off -function toggleglobalsitepackages { - virtualenvwrapper_verify_workon_home || return 1 - virtualenvwrapper_verify_active_environment || return 1 - typeset no_global_site_packages_file="`virtualenvwrapper_get_site_packages_dir`/../no-global-site-packages.txt" - if [ -f $no_global_site_packages_file ]; then - rm $no_global_site_packages_file - [ "$1" = "-q" ] || echo "Enabled global site-packages" - else - touch $no_global_site_packages_file - [ "$1" = "-q" ] || echo "Disabled global site-packages" - fi -} - #:help:cpvirtualenv: duplicate the named virtualenv to make a new one function cpvirtualenv { virtualenvwrapper_verify_workon_home || return 1 From 1c2e94d5be13f793416017c30ba078e1c1320228 Mon Sep 17 00:00:00 2001 From: Doug Hellmann Date: Sun, 15 Jan 2023 11:37:36 -0500 Subject: [PATCH 31/95] update lssitepackages tests to not need easy_install The easy_install package is no longer installed by default, so look for pip instead. --- tests/test_ls.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/test_ls.sh b/tests/test_ls.sh index 8d26b3a..25ceab2 100755 --- a/tests/test_ls.sh +++ b/tests/test_ls.sh @@ -27,8 +27,8 @@ test_get_site_packages_dir () { test_lssitepackages () { mkvirtualenv "lssitepackagestest" >/dev/null 2>&1 - contents="$(lssitepackages)" - assertTrue "did not find easy_install in site-packages" "echo $contents | grep -q easy_install" + contents="$(lssitepackages)" + assertTrue "did not find pip in site-packages: ${contents}" "echo $contents | grep -q pip" deactivate } @@ -36,8 +36,8 @@ test_lssitepackages_space_in_name () { # Only test with leading and internal spaces. Directory names with trailing spaces are legal, # and work with virtualenv on OSX, but error out on Linux. mkvirtualenv " space lssitepackagestest" >/dev/null 2>&1 - contents="$(lssitepackages)" - assertTrue "did not find easy_install in site-packages" "echo $contents | grep -q easy_install" + contents="$(lssitepackages)" + assertTrue "did not find pip in site-packages: ${contents}" "echo $contents | grep -q pip" deactivate } @@ -46,7 +46,7 @@ test_lssitepackages_add2virtualenv () { parent_dir=$(dirname $(pwd)) base_dir=$(basename $(pwd)) add2virtualenv "../$base_dir" - contents="$(lssitepackages)" + contents="$(lssitepackages)" actual=$(echo $contents | grep $base_dir) expected=$(echo $contents) assertSame "$expected" "$actual" From a948d6f66f5705447a98afe3bea89988ceceaf5d Mon Sep 17 00:00:00 2001 From: Doug Hellmann Date: Sun, 15 Jan 2023 11:55:49 -0500 Subject: [PATCH 32/95] adjust error message detection in hook tests --- tests/test_run_hook.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_run_hook.sh b/tests/test_run_hook.sh index 2d6983d..e1e8644 100755 --- a/tests/test_run_hook.sh +++ b/tests/test_run_hook.sh @@ -57,7 +57,7 @@ test_virtualenvwrapper_run_hook_permissions() { echo "echo run $@ >> \"$TMPDIR/catch_output\"" >> "$WORKON_HOME/prermvirtualenv" chmod 0444 "$WORKON_HOME/prermvirtualenv" touch "$TMPDIR/catch_output" - error=$(virtualenvwrapper_run_hook "pre_rmvirtualenv" "foo" 2>&1 | grep "could not run" | cut -f2- -d'[') + error=$(virtualenvwrapper_run_hook "pre_rmvirtualenv" "foo" 2>&1 | grep "could not run" | cut -f2- -d'[' | cut -f1 -d:) output=$(cat "$TMPDIR/catch_output") expected="" assertSame "$expected" "$output" From e51c3b5353a71e34654038ce81be4bd819aa0d43 Mon Sep 17 00:00:00 2001 From: Doug Hellmann Date: Sun, 15 Jan 2023 12:15:15 -0500 Subject: [PATCH 33/95] skip some tempfile tests on macos --- tests/test_tempfile.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tests/test_tempfile.sh b/tests/test_tempfile.sh index 9fb6b79..be1f89d 100755 --- a/tests/test_tempfile.sh +++ b/tests/test_tempfile.sh @@ -21,6 +21,11 @@ setUp () { } test_tempfile () { + if [ "$(uname)" = "Darwin" ]; then + # macOS doesn't seem to allow controlling where mktemp creates + # the output files + return 0 + fi filename=$(virtualenvwrapper_tempfile hook) assertTrue "Filename is empty" "[ ! -z \"$filename\" ]" assertTrue "File doesn't exist" "[ -f \"$filename\" ]" @@ -52,6 +57,11 @@ test_bad_mktemp() { } test_no_such_tmpdir () { + if [ "$(uname)" = "Darwin" ]; then + # macOS doesn't seem to allow controlling where mktemp creates + # the output files + return 0 + fi old_tmpdir="$TMPDIR" export TMPDIR="$TMPDIR/does-not-exist" virtualenvwrapper_run_hook "initialize" >/dev/null 2>&1 @@ -61,6 +71,11 @@ test_no_such_tmpdir () { } test_tmpdir_not_writable () { + if [ "$(uname)" = "Darwin" ]; then + # macOS doesn't seem to allow controlling where mktemp creates + # the output files + return 0 + fi old_tmpdir="$TMPDIR" export TMPDIR="$TMPDIR/cannot-write" mkdir "$TMPDIR" From 6f4511344328fb4122637cfc8c65c05a3183b942 Mon Sep 17 00:00:00 2001 From: Doug Hellmann Date: Sun, 15 Jan 2023 12:55:48 -0500 Subject: [PATCH 34/95] fix wipeenv for editable packages Based on https://bitbucket.org/virtualenvwrapper/virtualenvwrapper/pull-requests/81 from Daniel Cordero --- tests/test_wipeenv.sh | 4 ++-- virtualenvwrapper.sh | 23 +++++++++++++++++++++-- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/tests/test_wipeenv.sh b/tests/test_wipeenv.sh index 2dbd9cf..9b8895c 100755 --- a/tests/test_wipeenv.sh +++ b/tests/test_wipeenv.sh @@ -32,10 +32,10 @@ test_wipeenv_pip_e () { mkvirtualenv "wipetest" >/dev/null 2>&1 (cd tests/testpackage && pip install -e .) >/dev/null 2>&1 before="$(pip freeze)" - assertTrue "testpackage not installed" "pip freeze | grep testpackage" + assertTrue "testpackage not installed: $before" "pip freeze | grep testpackage" wipeenv >/dev/null 2>&1 after="$(pip freeze)" - assertFalse "testpackage still installed" "pip freeze | grep testpackage" + assertFalse "testpackage still installed: $after" "pip freeze | grep testpackage" } # test_wipeenv_pip_e_url () { diff --git a/virtualenvwrapper.sh b/virtualenvwrapper.sh index f80a087..79def0d 100644 --- a/virtualenvwrapper.sh +++ b/virtualenvwrapper.sh @@ -1294,9 +1294,28 @@ function wipeenv { if [ -n "$(cat "$req_file")" ] then echo "Uninstalling packages:" - cat "$req_file" echo - pip uninstall -y $(cat "$req_file" | grep -v '^-f' | sed 's/>/=/g' | cut -f1 -d=) + while read line; do + typeset pkg="" + if [[ "$line" =~ ^-f ]]; then + # ignore lines starting -f which pip sometimes + # includes and that do not point to specific + # dependencies + continue + fi + if [[ "$line" =~ ^-e ]]; then + # fix lines pointing to editable packages, which look like: + # -e git+ssh://git@github.com/python-virtualenvwrapper/virtualenvwrapper.git@1dc9e5f52102f0133b804c0c8a6b76c55db908bf#egg=testpackage&subdirectory=tests/testpackage + # and parse out the egg name to pass to pip + pkg=$(echo "$line" | cut -f2 -d' ' | sed -e 's|&subdirectory.*||g' -e 's|.*egg=||g') + else + # Strip version specifiers off of the end of the line + # to keep only the package name. + pkg=$(echo "$line" | sed -e 's/[<>!=].*//g') + fi + echo $pkg + pip uninstall -y "$pkg" + done < "$req_file" else echo "Nothing to remove." fi From c945ffbf7bb0f4aba707386c41f7789c9428b26c Mon Sep 17 00:00:00 2001 From: Doug Hellmann Date: Sun, 15 Jan 2023 13:51:42 -0500 Subject: [PATCH 35/95] pass user and home through from tox instead of using id to derive them The id command being used does not work on Linux. --- tests/setup.sh | 5 ----- tox.ini | 3 +++ 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/tests/setup.sh b/tests/setup.sh index a28d360..6e006fb 100755 --- a/tests/setup.sh +++ b/tests/setup.sh @@ -10,8 +10,3 @@ export WORKON_HOME=$(mktemp -d -t "WORKON_HOME.XXXX.$$") export PROJECT_HOME=$(mktemp -d -t "PROJECT_HOME.XXXX.$$") #unset HOOK_VERBOSE_OPTION - -# tox no longer exports these variables by default, so set them -# ourselves to ensure the tests that rely on the values work -export USER=$(id -u -n) -export HOME=$(id -P | cut -f9 -d:) diff --git a/tox.ini b/tox.ini index ad7c3f6..c97b5ef 100644 --- a/tox.ini +++ b/tox.ini @@ -5,6 +5,9 @@ envlist = py,zsh,style install_command = pip install -U {opts} {packages} commands = bash ./tests/run_tests {envdir} [] deps = -rrequirements.txt +pass_env = + HOME + USER setenv = TOXIC = true SHELL = /bin/bash From 83aff096e8a77f9fdfb5809d618a8b4e2fa396ec Mon Sep 17 00:00:00 2001 From: Doug Hellmann Date: Sun, 15 Jan 2023 13:59:34 -0500 Subject: [PATCH 36/95] ci(Mergify): configuration update Signed-off-by: Doug Hellmann --- .mergify.yml | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 .mergify.yml diff --git a/.mergify.yml b/.mergify.yml new file mode 100644 index 0000000..740f992 --- /dev/null +++ b/.mergify.yml @@ -0,0 +1,54 @@ +pull_request_rules: + + - name: Add CI label + conditions: + - or: + - "title~=^tox:" + - "title~=^ci:" + - "files~=tox.ini" + - "files~=tests" + actions: + label: + add: + - ci + + - name: Add Mergify label + conditions: + - or: + - "title~=^mergify:" + - "files~=.mergify.yml$" + actions: + label: + add: + - mergify + + - name: Add Documentation label + conditions: + - or: + - "title~=^docs:" + - "files~=docs" + - "files~=.rst$" + actions: + label: + add: + - documentation + + - name: Automatic merge on approval + conditions: + - and: + - "check-success=style (docs)" + - "check-success=style (style)" + - "check-success=style (pkglint)" + - "check-success=Test macOS (3.8)" + - "check-success=Test macOS (3.9)" + - "check-success=Test macOS (3.10)" + - "check-success=Test macOS (3.11)" + - "check-success=Test Ubuntu (3.8)" + - "check-success=Test Ubuntu (3.9)" + - "check-success=Test Ubuntu (3.10)" + - "check-success=Test Ubuntu (3.11)" + - "check-success=Test Zsh" + - "-draft" + actions: + merge: + method: merge From 4d7e7a88d94b5f2ff06a7aeecfa5fe6c4e5a96d2 Mon Sep 17 00:00:00 2001 From: Doug Hellmann Date: Sun, 15 Jan 2023 14:11:14 -0500 Subject: [PATCH 37/95] require at least one reviewer to approve PRs --- .mergify.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.mergify.yml b/.mergify.yml index 740f992..4fbb008 100644 --- a/.mergify.yml +++ b/.mergify.yml @@ -49,6 +49,7 @@ pull_request_rules: - "check-success=Test Ubuntu (3.11)" - "check-success=Test Zsh" - "-draft" + - "#approved-reviews-by>=1" actions: merge: method: merge From 8ed41e75e59df5670d86d6b53b9817b5ad401e7f Mon Sep 17 00:00:00 2001 From: Jason Myers Date: Sun, 15 Jan 2023 10:09:00 -0600 Subject: [PATCH 38/95] Updating references to bitbucket Fixes: python-virtualenvwrapper/virtualenvwrapper#9 --- README.es.rst | 2 +- README.ja.rst | 4 ++-- README.txt | 12 ++++++------ docs/source/developers.rst | 4 ++-- docs/source/extensions.rst | 4 ++-- docs/source/index.rst | 4 ++-- docs/source/install.rst | 4 ++-- docs/source/plugins.rst | 2 +- docs/source/projects.rst | 6 +++--- 9 files changed, 21 insertions(+), 21 deletions(-) diff --git a/README.es.rst b/README.es.rst index 6147175..15d6764 100644 --- a/README.es.rst +++ b/README.es.rst @@ -80,4 +80,4 @@ USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -.. _BitBucket: http://bitbucket.org/dhellmann/virtualenvwrapper/overview/ +.. _github: https://github.com/python-virtualenvwrapper/virtualenvwrapper/ diff --git a/README.ja.rst b/README.ja.rst index 805f0ce..b540423 100644 --- a/README.ja.rst +++ b/README.ja.rst @@ -48,7 +48,7 @@ virtualenvwrapper は Bourne シェル互換の構文で定義された ここに記載されていないシェルで動作することを発見したら私に 教えてください。もしあなたがその他のシェルで動作させるために virtualenvwrapper を完全に書き直すことなく修正できるなら、 -bitbucket のプロジェクトページを通じて pull リクエストを +GitHub のプロジェクトページを通じて pull リクエストを 送ってください。あなたが非互換なシェル上で動作させるクローンを 作成するなら、このページでリンクを張るので私に連絡してください。 @@ -84,7 +84,7 @@ virtualenvwrapper のコアへ新しい機能を追加する前に、 `virtualenvwrapper Google Group `__ に参加してください。 -`BitBucket のバグトラッカー `__ +`github のバグトラッカー `__ でバグを報告してください。 シェルエイリアス diff --git a/README.txt b/README.txt index 4aea1ed..bd42fbe 100644 --- a/README.txt +++ b/README.txt @@ -50,11 +50,11 @@ virtualenvwrapper is a set of shell *functions* defined in Bourne shell compatible syntax. It is tested under ``bash``, ``ksh``, and ``zsh``. It may work with other shells, so if you find that it does work with a shell not listed here please let us know by opening a -`ticket on bitbucket -`_. +`ticket on GitHub +`_. If you can modify it to work with another shell, without completely -rewriting it, send a pull request through the `bitbucket project page -`_. If +rewriting it, send a pull request through the `GitHub project page +`_. If you write a clone to work with an incompatible shell, let us know and we will link to it from this page. @@ -71,8 +71,8 @@ Join the `virtualenvwrapper Google Group `__ to discuss issues and features. -Report bugs via the `bug tracker on Bitbucket -`__. +Report bugs via the `bug tracker on GitHub +`__. Shell Aliases ============= diff --git a/docs/source/developers.rst b/docs/source/developers.rst index 8de06e5..01e9e04 100644 --- a/docs/source/developers.rst +++ b/docs/source/developers.rst @@ -4,8 +4,8 @@ For Developers If you would like to contribute to virtualenvwrapper directly, these instructions should help you get started. Patches, bug reports, and -feature requests are all welcome through the `BitBucket site -`_. Contributions +feature requests are all welcome through the `GitHub site +`_. Contributions in the form of patches or pull requests are easier to integrate and will receive priority attention. diff --git a/docs/source/extensions.rst b/docs/source/extensions.rst index 8b300f3..8814546 100644 --- a/docs/source/extensions.rst +++ b/docs/source/extensions.rst @@ -45,13 +45,13 @@ Templates Below is a list of some of the templates available for use with :ref:`command-mkproject`. -.. _templates-bitbucket: +.. _templates-github: bitbucket --------- The bitbucket_ extension automatically clones a mercurial repository -from the specified bitbucket project. +from the specified Bitbucket project. .. _bitbucket: https://pypi.python.org/pypi/virtualenvwrapper.bitbucket diff --git a/docs/source/index.rst b/docs/source/index.rst index 29e088d..f0fc0e1 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -211,8 +211,8 @@ Join the `virtualenvwrapper Google Group `__ to discuss issues and features. -Report bugs via the `bug tracker on BitBucket -`__. +Report bugs via the `bug tracker on GitHub +`__. Shell Aliases ============= diff --git a/docs/source/install.rst b/docs/source/install.rst index 2aafa8d..2826b79 100644 --- a/docs/source/install.rst +++ b/docs/source/install.rst @@ -18,11 +18,11 @@ shells on OS X and Linux: It may work with other shells, so if you find that it does work with a shell not listed here please let me know. If you can modify it to work with another shell without completely rewriting it, then send a pull -request through the `bitbucket project page`_. If you write a clone to +request through the `GitHub project page`_. If you write a clone to work with an incompatible shell, let me know and I will link to it from this page. -.. _bitbucket project page: https://bitbucket.org/virtualenvwrapper/virtualenvwrapper/ +.. _github project page: https://GitHub.com/python-virtualenvwrapper/virtualenvwrapper/ Windows Command Prompt ---------------------- diff --git a/docs/source/plugins.rst b/docs/source/plugins.rst index a27a406..63e8e0c 100644 --- a/docs/source/plugins.rst +++ b/docs/source/plugins.rst @@ -396,4 +396,4 @@ respectively. .. _Setuptools entry points: https://setuptools.readthedocs.io/en/latest/pkg_resources.html#entry-points -.. _project: https://bitbucket.org/virtualenvwrapper/virtualenvwrapper +.. _project: https://github.com/python-virtualenvwrapper/virtualenvwrapper diff --git a/docs/source/projects.rst b/docs/source/projects.rst index c08ea33..501b61f 100644 --- a/docs/source/projects.rst +++ b/docs/source/projects.rst @@ -23,13 +23,13 @@ A new project directory can be created empty, or populated using one or more :term:`template` plugins. Templates should be specified as arguments to :ref:`command-mkproject`. Multiple values can be provided to apply more than one template. For example, to check out a Mercurial -repository from a project on bitbucket and create a new Django -site, combine the :ref:`templates-bitbucket` and +repository from a project on GitHub and create a new Django +site, combine the :ref:`templates-github` and :ref:`templates-django` templates. :: - $ mkproject -t bitbucket -t django my_site + $ mkproject -t github -t django my_site .. seealso:: From c91d69e091b501a06cbe634e310785dcb4aceb51 Mon Sep 17 00:00:00 2001 From: Jason Myers Date: Sun, 15 Jan 2023 10:27:19 -0600 Subject: [PATCH 39/95] missed ones --- README.ja.rst | 2 +- docs/source/install.rst | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.ja.rst b/README.ja.rst index b540423..a3931e7 100644 --- a/README.ja.rst +++ b/README.ja.rst @@ -84,7 +84,7 @@ virtualenvwrapper のコアへ新しい機能を追加する前に、 `virtualenvwrapper Google Group `__ に参加してください。 -`github のバグトラッカー `__ +`GitHub のバグトラッカー `__ でバグを報告してください。 シェルエイリアス diff --git a/docs/source/install.rst b/docs/source/install.rst index 2826b79..0769ce7 100644 --- a/docs/source/install.rst +++ b/docs/source/install.rst @@ -22,7 +22,7 @@ request through the `GitHub project page`_. If you write a clone to work with an incompatible shell, let me know and I will link to it from this page. -.. _github project page: https://GitHub.com/python-virtualenvwrapper/virtualenvwrapper/ +.. _GitHub project page: https://GitHub.com/python-virtualenvwrapper/virtualenvwrapper/ Windows Command Prompt ---------------------- From 47d3b58aa35b9714d6a64940f9b02dc8ceca270c Mon Sep 17 00:00:00 2001 From: Jason Myers Date: Sun, 15 Jan 2023 16:21:58 -0600 Subject: [PATCH 40/95] Updating template docs based on PR feedback --- docs/source/extensions.rst | 2 +- docs/source/projects.rst | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/source/extensions.rst b/docs/source/extensions.rst index 8814546..8519d24 100644 --- a/docs/source/extensions.rst +++ b/docs/source/extensions.rst @@ -45,7 +45,7 @@ Templates Below is a list of some of the templates available for use with :ref:`command-mkproject`. -.. _templates-github: +.. _templates-bitbucket: bitbucket --------- diff --git a/docs/source/projects.rst b/docs/source/projects.rst index 501b61f..8cc999d 100644 --- a/docs/source/projects.rst +++ b/docs/source/projects.rst @@ -23,8 +23,8 @@ A new project directory can be created empty, or populated using one or more :term:`template` plugins. Templates should be specified as arguments to :ref:`command-mkproject`. Multiple values can be provided to apply more than one template. For example, to check out a Mercurial -repository from a project on GitHub and create a new Django -site, combine the :ref:`templates-github` and +repository from a project on BitBucket and create a new Django +site, combine the :ref:`templates-bitbucket` and :ref:`templates-django` templates. :: From 344f09ca9696c3b523141fc7719b766f4bd5a908 Mon Sep 17 00:00:00 2001 From: Jason Myers Date: Mon, 16 Jan 2023 16:39:50 -0600 Subject: [PATCH 41/95] Fixing bitbucket in projects Signed-off-by: Jason Myers --- docs/source/projects.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/projects.rst b/docs/source/projects.rst index 8cc999d..d5f6e63 100644 --- a/docs/source/projects.rst +++ b/docs/source/projects.rst @@ -29,7 +29,7 @@ site, combine the :ref:`templates-bitbucket` and :: - $ mkproject -t github -t django my_site + $ mkproject -t bitbucket -t django my_site .. seealso:: From 35b792d88ec4d4ac8bcdfcfd76851c9b4e927bdb Mon Sep 17 00:00:00 2001 From: Doug Hellmann Date: Sat, 21 Jan 2023 09:07:31 -0500 Subject: [PATCH 42/95] docs: update language that implies there is only 1 maintainer --- docs/source/install.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/source/install.rst b/docs/source/install.rst index 0769ce7..f1b6f46 100644 --- a/docs/source/install.rst +++ b/docs/source/install.rst @@ -16,10 +16,10 @@ shells on OS X and Linux: * ``zsh`` It may work with other shells, so if you find that it does work with a -shell not listed here please let me know. If you can modify it to +shell not listed here please let us know. If you can modify it to work with another shell without completely rewriting it, then send a pull request through the `GitHub project page`_. If you write a clone to -work with an incompatible shell, let me know and I will link to it +work with an incompatible shell, let us know and we will link to it from this page. .. _GitHub project page: https://GitHub.com/python-virtualenvwrapper/virtualenvwrapper/ From cf90b2ed6f2de56ca33b54d04e0037f12c1dac8a Mon Sep 17 00:00:00 2001 From: Doug Hellmann Date: Sat, 21 Jan 2023 09:09:52 -0500 Subject: [PATCH 43/95] docs: clean up trailing whitespace --- docs/source/plugins.rst | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/source/plugins.rst b/docs/source/plugins.rst index 63e8e0c..e2fd808 100644 --- a/docs/source/plugins.rst +++ b/docs/source/plugins.rst @@ -80,7 +80,7 @@ techniques. The API is the same for every extension point. Each uses a Python function that takes a single argument, a list of strings passed to the -hook loader on the command line. +hook loader on the command line. :: @@ -106,7 +106,7 @@ user scripts when ``virtualenvwrapper.sh`` is loaded. def initialize(args): for filename, comment in GLOBAL_HOOKS: make_hook(os.path.join('$WORKON_HOME', filename), comment) - return + return .. _plugins-user-env: @@ -156,7 +156,7 @@ shell process. where examining the ``SHELL`` environment variable to generate different syntax for each case is the only way to achieve the desired result. - + Registering Entry Points ------------------------ @@ -200,9 +200,9 @@ application, use the ``-m`` option to the interpreter:: $ python -m virtualenvwrapper.hook_loader -h Usage: virtualenvwrapper.hook_loader [options] [] - + Manage hooks for virtualenvwrapper - + Options: -h, --help show this help message and exit -s, --source Print the shell commands to be run in the current @@ -213,7 +213,7 @@ application, use the ``-m`` option to the interpreter:: -q, --quiet Show less information on the console -n NAMES, --name=NAMES Only run the hook from the named plugin - + To run the extensions for the initialize hook:: $ python -m virtualenvwrapper.hook_loader -v initialize @@ -375,7 +375,7 @@ Plugins that define new operations can also define new extension points. No setup needs to be done to allow the hook loader to find the extensions; documenting the names and adding calls to ``virtualenvwrapper_run_hook`` is sufficient to cause them to be -invoked. +invoked. The hook loader assumes all extension point names start with ``virtualenvwrapper.`` and new plugins will want to use their own From d7365499b3fd442e92200e481c7a3711981ab78e Mon Sep 17 00:00:00 2001 From: Doug Hellmann Date: Sat, 21 Jan 2023 09:13:47 -0500 Subject: [PATCH 44/95] drop ksh support Fixes #11 Sem-Ver: api-break --- README.txt | 2 +- docs/source/install.rst | 1 - docs/source/plugins.rst | 2 +- tests/run_tests | 1 - tests/test_dir_stack.sh | 1 - tox.ini | 7 ------- virtualenvwrapper.sh | 10 +++------- 7 files changed, 5 insertions(+), 19 deletions(-) diff --git a/README.txt b/README.txt index bd42fbe..49a0fee 100644 --- a/README.txt +++ b/README.txt @@ -47,7 +47,7 @@ Supported Shells ================ virtualenvwrapper is a set of shell *functions* defined in Bourne -shell compatible syntax. It is tested under ``bash``, ``ksh``, and +shell compatible syntax. It is tested under ``bash`` and ``zsh``. It may work with other shells, so if you find that it does work with a shell not listed here please let us know by opening a `ticket on GitHub diff --git a/docs/source/install.rst b/docs/source/install.rst index f1b6f46..94de69e 100644 --- a/docs/source/install.rst +++ b/docs/source/install.rst @@ -12,7 +12,6 @@ shell compatible syntax. Its automated tests run under these shells on OS X and Linux: * ``bash`` -* ``ksh`` * ``zsh`` It may work with other shells, so if you find that it does work with a diff --git a/docs/source/plugins.rst b/docs/source/plugins.rst index e2fd808..4026837 100644 --- a/docs/source/plugins.rst +++ b/docs/source/plugins.rst @@ -150,7 +150,7 @@ shell process. .. warning:: virtualenvwrapper works under several shells with slightly - different syntax (bash, sh, zsh, ksh). Take this portability into + different syntax (bash, sh, zsh). Take this portability into account when defining source hooks. Sticking to the simplest possible syntax usually avoids problems, but there may be cases where examining the ``SHELL`` environment variable to generate diff --git a/tests/run_tests b/tests/run_tests index 68cb362..a29179b 100755 --- a/tests/run_tests +++ b/tests/run_tests @@ -61,7 +61,6 @@ do echo " SHELL=$SHELL" echo " BASH_VERSION=$BASH_VERSION" echo " ZSH_VERSION=$ZSH_VERSION" - echo " KSH_VERSION=$KSH_VERSION" echo " virtualenv=$(which virtualenv)" echo " test_shell_opts=$test_shell_opts" echo " ZSH=$ZSH_NAME $ZSH_EVAL_CONTEXT" diff --git a/tests/test_dir_stack.sh b/tests/test_dir_stack.sh index f86c9fc..e391754 100755 --- a/tests/test_dir_stack.sh +++ b/tests/test_dir_stack.sh @@ -29,7 +29,6 @@ tearDown() { } test_ticket_101 () { - [ ! -z "$KSH_VERSION" ] && echo "Skipping test under ksh" && return 0 mkvirtualenv some_env deactivate cd "$WORKON_HOME/start_here" diff --git a/tox.ini b/tox.ini index c97b5ef..3549d6a 100644 --- a/tox.ini +++ b/tox.ini @@ -14,7 +14,6 @@ setenv = allowlist_externals = bash zsh - ksh [testenv:fast] setenv = @@ -32,12 +31,6 @@ setenv = test_shell_opts = -o shwordsplit commands = zsh -o shwordsplit ./tests/run_tests {envdir} [] -[testenv:ksh] -basepython=python2.7 -setenv = - SHELL = /bin/ksh -commands = ksh ./tests/run_tests {envdir} [] - [testenv:docs] deps = -r{toxinidir}/requirements.txt diff --git a/virtualenvwrapper.sh b/virtualenvwrapper.sh index 79def0d..9ba3e81 100644 --- a/virtualenvwrapper.sh +++ b/virtualenvwrapper.sh @@ -121,11 +121,9 @@ fi # alias or even a shell function. Under bash and zsh, "builtin" forces # the use of a command that is part of the shell itself instead of an # alias, function, or external command, while "command" does something -# similar but allows external commands. Under ksh "builtin" registers -# a new command from a shared library, but "command" will pick up -# existing builtin commands. We need to use a builtin for cd because -# we are trying to change the state of the current shell, so we use -# "builtin" for bash and zsh but "command" under ksh. +# similar but allows external commands. We need to use a builtin for +# cd because we are trying to change the state of the current shell, +# so we use "builtin". function virtualenvwrapper_cd { if [ -n "${BASH:-}" ] then @@ -133,8 +131,6 @@ function virtualenvwrapper_cd { elif [ -n "${ZSH_VERSION:-}" ] then builtin \cd -q "$@" - else - command \cd "$@" fi } From e63d2c389ed276aa161bb50a27c77af94d96a50c Mon Sep 17 00:00:00 2001 From: Doug Hellmann Date: Sat, 21 Jan 2023 09:19:41 -0500 Subject: [PATCH 45/95] remove python2 from startup logic for finding the python interpreter Fixes #22 Sem-Ver: api-break --- virtualenvwrapper.sh | 28 ++++++++++------------------ 1 file changed, 10 insertions(+), 18 deletions(-) diff --git a/virtualenvwrapper.sh b/virtualenvwrapper.sh index 79def0d..b8e4a42 100644 --- a/virtualenvwrapper.sh +++ b/virtualenvwrapper.sh @@ -45,29 +45,21 @@ # # Locate the global Python where virtualenvwrapper is installed. -# Use the highest Python version if [ "${VIRTUALENVWRAPPER_PYTHON:-}" = "" ] then - for NAME in python3 python2 python - do - python_executable="$(which $NAME 2>/dev/null)" - if ! [ -z "$python_executable" ] - then - if $python_executable -m 'virtualenvwrapper.hook_loader' --help >/dev/null 2>&1 - then - VIRTUALENVWRAPPER_PYTHON=$python_executable - break - fi - fi - done - if [ "${VIRTUALENVWRAPPER_PYTHON:-}" = "" ] + _virtualenvwrapper_python_executable="$(which python3 2>/dev/null)" + if [ -n "$_virtualenvwrapper_python_executable" ] && $_virtualenvwrapper_python_executable -m 'virtualenvwrapper.hook_loader' --help >/dev/null 2>&1 then - echo -e "ERROR: Python with virtualenvwrapper module not found! -Either, install virtualenvwrapper module for standard python2 -or python3 or set VIRTUALENVWRAPPER_PYTHON variable manually." 1>&2 - return 1 + VIRTUALENVWRAPPER_PYTHON=$_virtualenvwrapper_python_executable fi fi +if [ "${VIRTUALENVWRAPPER_PYTHON:-}" = "" ] +then + echo -e "ERROR: Python with virtualenvwrapper module not found! +Either, install virtualenvwrapper module for the default python3 interpreter +or set VIRTUALENVWRAPPER_PYTHON to the interpreter to use." 1>&2 + return 1 +fi # Set the name of the virtualenv app to use. if [ "${VIRTUALENVWRAPPER_VIRTUALENV:-}" = "" ] From 838a628e821e7cf5b5c0a0ec2b9cee32f7d1e7b3 Mon Sep 17 00:00:00 2001 From: Doug Hellmann Date: Sat, 21 Jan 2023 09:34:00 -0500 Subject: [PATCH 46/95] mergify: add rules to label PRs based on pbr sem-ver data --- .mergify.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/.mergify.yml b/.mergify.yml index 4fbb008..6b41ced 100644 --- a/.mergify.yml +++ b/.mergify.yml @@ -33,6 +33,24 @@ pull_request_rules: add: - documentation + - name: Add breaking-change label + # https://docs.openstack.org/pbr/latest/user/features.html + conditions: + - "body~=Sem-Ver: api-break" + actions: + label: + add: + - "breaking change" + + - name: Add feature label + # https://docs.openstack.org/pbr/latest/user/features.html + conditions: + - "body~=Sem-Ver: feature" + actions: + label: + add: + - feature + - name: Automatic merge on approval conditions: - and: From ae23b7191c94b4c39556b28e64ff3f22056178db Mon Sep 17 00:00:00 2001 From: Doug Hellmann Date: Sat, 21 Jan 2023 09:41:49 -0500 Subject: [PATCH 47/95] tox: update doc build commands - Run html builder with warnings treated as errors. - Run the linkcheck builder. Fixes #15 --- tox.ini | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index c97b5ef..b629574 100644 --- a/tox.ini +++ b/tox.ini @@ -42,7 +42,9 @@ commands = ksh ./tests/run_tests {envdir} [] deps = -r{toxinidir}/requirements.txt -r{toxinidir}/docs/requirements.txt -commands = python setup.py build_sphinx +commands = + sphinx-build -W -j auto -b html -d docs/build/doctrees docs/source docs/build/html + sphinx-build -W -j auto -b linkcheck -d docs/build/doctrees docs/source docs/build/linkcheck [testenv:pkglint] deps= From e07bbdd93659e0a82635f1b62765350e55a0a338 Mon Sep 17 00:00:00 2001 From: Doug Hellmann Date: Sat, 21 Jan 2023 09:42:30 -0500 Subject: [PATCH 48/95] docs: remove broken link from tips list Also clean up trailing whitespace. --- docs/source/tips.rst | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/docs/source/tips.rst b/docs/source/tips.rst index c32bdf9..aec51f5 100644 --- a/docs/source/tips.rst +++ b/docs/source/tips.rst @@ -19,7 +19,7 @@ While the virtualenv ``activate`` script does attempt to provide an indicator in the prompt, it has various shortcomings, and cannot be customized. -However, it does also set a shell variable named +However, it does also set a shell variable named ``VIRTUAL_ENV`` which can be used as the basis for disabling the built-in prompt indicator and substituting an improved one, as a customization to ``.bashrc`` or ``.zshrc``:: @@ -27,7 +27,7 @@ as a customization to ``.bashrc`` or ``.zshrc``:: virtualenv_prompt() { # If not in a virtualenv, print nothing [[ "$VIRTUAL_ENV" == "" ]] && return - + # Distinguish between the shell where the virtualenv was activated # and its children local venv_name="${VIRTUAL_ENV##*/}" @@ -37,7 +37,7 @@ as a customization to ``.bashrc`` or ``.zshrc``:: echo "<${venv_name}> " fi } - + # Display a "we are in a virtualenv" indicator that works in child shells too VIRTUAL_ENV_DISABLE_PROMPT=1 PS1='$(virtualenv_prompt)'"$PS1" @@ -116,10 +116,6 @@ directory each time he runs ``cd``. If it finds a ``.venv`` file, it activates the environment named within. On leaving that directory, the current virtualenv is automatically deactivated. -`Harry Marr `__ -wrote a similar function that works with `git repositories -`__. - Installing Common Tools Automatically in New Environments ========================================================= From 4adb9b3e28c70bf09b8ee81ecd4cae173c030f4a Mon Sep 17 00:00:00 2001 From: Doug Hellmann Date: Sat, 21 Jan 2023 09:43:03 -0500 Subject: [PATCH 49/95] packaging: fix indentation of trove classifier for audience --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index 0ec5d5c..764868c 100644 --- a/setup.cfg +++ b/setup.cfg @@ -14,7 +14,7 @@ classifier = Programming Language :: Python :: 3.9 Programming Language :: Python :: 3.10 Programming Language :: Python :: 3.11 -Intended Audience :: Developers + Intended Audience :: Developers Environment :: Console keywords = virtualenv From e31583e680274a0670f0352f056517717723f5c8 Mon Sep 17 00:00:00 2001 From: Doug Hellmann Date: Sat, 21 Jan 2023 09:49:15 -0500 Subject: [PATCH 50/95] docs: fix or remove broken links --- docs/source/command_ref.rst | 2 +- docs/source/developers.rst | 2 +- docs/source/plugins.rst | 5 ++--- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/docs/source/command_ref.rst b/docs/source/command_ref.rst index eadb850..50997e7 100644 --- a/docs/source/command_ref.rst +++ b/docs/source/command_ref.rst @@ -57,7 +57,7 @@ installed. * :ref:`scripts-postmkvirtualenv` * `requirements file format`_ -.. _requirements file format: https://pip.pypa.io/en/latest/reference/pip_install/#requirements-file-format +.. _requirements file format: https://pip.pypa.io/en/stable/reference/requirements-file-format/ .. _command-mktmpenv: diff --git a/docs/source/developers.rst b/docs/source/developers.rst index 01e9e04..1c6c7d7 100644 --- a/docs/source/developers.rst +++ b/docs/source/developers.rst @@ -98,7 +98,7 @@ the ``tests`` directory. .. _shunit2: https://github.com/kward/shunit2 -.. _tox: https://tox.testrun.org/ +.. _tox: https://tox.wiki/ .. _developer-templates: diff --git a/docs/source/plugins.rst b/docs/source/plugins.rst index 63e8e0c..c601dbd 100644 --- a/docs/source/plugins.rst +++ b/docs/source/plugins.rst @@ -186,8 +186,7 @@ used). .. seealso:: - * `namespace packages `__ - * `Extensible Applications and Frameworks `__ + * `namespace packages `__ The Hook Loader --------------- @@ -257,7 +256,7 @@ messages. .. seealso:: * `Standard library documentation for logging `__ - * `PyMOTW for logging `__ + * `PyMOTW for logging `__ .. _plugins-extension-points: From af41484a4709503f6029830b91eb0ec0b4abb2a0 Mon Sep 17 00:00:00 2001 From: Carlton Gibson Date: Sat, 21 Jan 2023 19:24:31 +0100 Subject: [PATCH 51/95] Updated tested Python versions in README. As per the GHA workflow files, only Python 3.8+ are tested. --- README.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.txt b/README.txt index 49a0fee..415130e 100644 --- a/README.txt +++ b/README.txt @@ -61,7 +61,7 @@ we will link to it from this page. Python Versions =============== -virtualenvwrapper is tested under Python 2.6 - 3.6. +virtualenvwrapper is tested under Python 3.8 - 3.11. ======= Support From 4250f111de82d435711febe28977bb38bac27e94 Mon Sep 17 00:00:00 2001 From: Doug Hellmann Date: Sat, 28 Jan 2023 09:08:44 -0500 Subject: [PATCH 52/95] add github action for publishing packages Addresses #6 --- .github/workflows/python-publish.yaml | 40 +++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 .github/workflows/python-publish.yaml diff --git a/.github/workflows/python-publish.yaml b/.github/workflows/python-publish.yaml new file mode 100644 index 0000000..bfeb191 --- /dev/null +++ b/.github/workflows/python-publish.yaml @@ -0,0 +1,40 @@ +# This workflows will upload a Python Package using Twine when a release is created +# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries + +name: Upload Python Package + +on: + - push + +jobs: + build-n-publish: + name: Build and publish Python distributions to PyPI and TestPyPI + if: ${{ github.repository_owner == 'python-virtualenvwrapper' }} + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.x' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install setuptools wheel twine pbr + - name: Build sdist and wheel + run: | + python setup.py sdist bdist_wheel + - name: Publish distribution to Test PyPI + uses: pypa/gh-action-pypi-publish@master + with: + password: ${{ secrets.test_pypi_password }} + repository_url: https://test.pypi.org/legacy/ + - name: Publish distribution to PyPI + if: startsWith(github.ref, 'refs/tags') + uses: pypa/gh-action-pypi-publish@master + with: + password: ${{ secrets.pypi_password }} From a761f386a8aee8c395d5478a55c9fbad12f191c4 Mon Sep 17 00:00:00 2001 From: Doug Hellmann Date: Sat, 28 Jan 2023 09:29:55 -0500 Subject: [PATCH 53/95] switch to implicit namespaces Remove explicit namespace package handling. See https://peps.python.org/pep-0420/ Fixes #32 --- setup.cfg | 2 -- virtualenvwrapper/__init__.py | 4 ---- 2 files changed, 6 deletions(-) delete mode 100644 virtualenvwrapper/__init__.py diff --git a/setup.cfg b/setup.cfg index 764868c..470d25a 100644 --- a/setup.cfg +++ b/setup.cfg @@ -24,8 +24,6 @@ zip_safe = False [files] packages = virtualenvwrapper -namespace_packages = - virtualenvwrapper scripts = virtualenvwrapper.sh virtualenvwrapper_lazy.sh diff --git a/virtualenvwrapper/__init__.py b/virtualenvwrapper/__init__.py deleted file mode 100644 index 59336ae..0000000 --- a/virtualenvwrapper/__init__.py +++ /dev/null @@ -1,4 +0,0 @@ -"""virtualenvwrapper module -""" - -__import__('pkg_resources').declare_namespace(__name__) From 6f105539c2bdfc60148dc5ba4aec10ebbde1a287 Mon Sep 17 00:00:00 2001 From: Doug Hellmann Date: Sat, 28 Jan 2023 09:38:57 -0500 Subject: [PATCH 54/95] update pypi publishing action * update publishing action using latest instructions in https://github.com/marketplace/actions/pypi-publish * add debug info * change secret names to match docs * remove test upload (secret are not available in PR jobs, see https://securitylab.github.com/research/github-actions-preventing-pwn-requests/) --- .github/workflows/python-publish.yaml | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/.github/workflows/python-publish.yaml b/.github/workflows/python-publish.yaml index bfeb191..75a668f 100644 --- a/.github/workflows/python-publish.yaml +++ b/.github/workflows/python-publish.yaml @@ -28,13 +28,12 @@ jobs: - name: Build sdist and wheel run: | python setup.py sdist bdist_wheel - - name: Publish distribution to Test PyPI - uses: pypa/gh-action-pypi-publish@master - with: - password: ${{ secrets.test_pypi_password }} - repository_url: https://test.pypi.org/legacy/ - name: Publish distribution to PyPI - if: startsWith(github.ref, 'refs/tags') - uses: pypa/gh-action-pypi-publish@master + # This condition prevents PRs from being published as part of + # the test job. + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') + uses: pypa/gh-action-pypi-publish@v1.6.4 with: - password: ${{ secrets.pypi_password }} + password: ${{ secrets.PYPI_API_TOKEN }} + verbose: true + print_hash: true From a22a4e99ba11934225859c4673b328e9d4376f27 Mon Sep 17 00:00:00 2001 From: Doug Hellmann Date: Mon, 30 Jan 2023 20:00:30 -0500 Subject: [PATCH 55/95] add a --version option to the hook loader Use the hook loader --version option to report the version of virtualenvwrapper installed when the user runs the `virtualenvwrapper` command. Fixes #42 --- docs/source/command_ref.rst | 4 +++- tests/test_virtualenvwrapper.sh | 12 ++++++++++++ virtualenvwrapper.sh | 11 +++++++++++ virtualenvwrapper/hook_loader.py | 11 +++++++++++ 4 files changed, 37 insertions(+), 1 deletion(-) diff --git a/docs/source/command_ref.rst b/docs/source/command_ref.rst index 50997e7..4571703 100644 --- a/docs/source/command_ref.rst +++ b/docs/source/command_ref.rst @@ -591,7 +591,9 @@ Other Commands virtualenvwrapper ----------------- -Print a list of commands and their descriptions as basic help output. +Print a list of commands, their descriptions, and some details about +the version and locations used by virtualenvwrapper as basic help +output. Syntax:: diff --git a/tests/test_virtualenvwrapper.sh b/tests/test_virtualenvwrapper.sh index 529dff1..ecaef8e 100755 --- a/tests/test_virtualenvwrapper.sh +++ b/tests/test_virtualenvwrapper.sh @@ -26,4 +26,16 @@ test_virtualenvwrapper_script_set() { "echo $VIRTUALENVWRAPPER_SCRIPT | grep -q /virtualenvwrapper.sh" } +test_virtualenvwrapper_version() { + source "$test_dir/../virtualenvwrapper.sh" + typeset ver=$(_virtualenvwrapper_version) + assertTrue "version is empty" "[ -n $ver ]" +} + +test_virtualenvwrapper_help_shows_version() { + source "$test_dir/../virtualenvwrapper.sh" + typeset pattern="Version: $(_virtualenvwrapper_version)" + assertTrue "version not in command output" "virtualenvwrapper | grep \"$pattern\"" +} + . "$test_dir/shunit2" diff --git a/virtualenvwrapper.sh b/virtualenvwrapper.sh index 7eb4ca7..cf43626 100644 --- a/virtualenvwrapper.sh +++ b/virtualenvwrapper.sh @@ -1336,8 +1336,13 @@ function allvirtualenv { unset IFS } +function _virtualenvwrapper_version { + "$VIRTUALENVWRAPPER_PYTHON" -m 'virtualenvwrapper.hook_loader' --version +} + #:help:virtualenvwrapper: show this help message function virtualenvwrapper { + typeset version=$(_virtualenvwrapper_version) cat < Date: Sat, 11 Feb 2023 09:43:58 -0500 Subject: [PATCH 56/95] packaging: modernize packaging - Replace pbr with setuptools, setuptools_scm, and build. - Move most of the packaging settings into pyproject.toml. - Update tox settings to reflect packaging changes. - Update documentation build version detection. - Update documentation for entry points now that setup.cfg is removed. Fixes #33 Addresses #34 --- docs/source/conf.py | 8 +--- docs/source/plugins.rst | 23 ++++++----- pyproject.toml | 90 +++++++++++++++++++++++++++++++++++++++++ requirements.txt | 3 -- setup.cfg | 79 ------------------------------------ setup.py | 8 +++- tox.ini | 9 ++--- 7 files changed, 115 insertions(+), 105 deletions(-) create mode 100644 pyproject.toml delete mode 100644 requirements.txt delete mode 100644 setup.cfg diff --git a/docs/source/conf.py b/docs/source/conf.py index 1a79ec8..ab23616 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -13,7 +13,7 @@ # serve to show the default. import datetime -import subprocess +import importlib.metadata # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the @@ -51,11 +51,7 @@ # built documents. # # The short X.Y version. -version = subprocess.check_output([ - 'sh', '-c', - 'cd ../..; python setup.py --version', -]).decode('utf-8') -version = version.strip() +version = importlib.metadata.version('virtualenvwrapper') # The full version, including alpha/beta/rc tags. release = version diff --git a/docs/source/plugins.rst b/docs/source/plugins.rst index 6422930..4587355 100644 --- a/docs/source/plugins.rst +++ b/docs/source/plugins.rst @@ -162,25 +162,30 @@ Registering Entry Points The functions defined in the plugin need to be registered as *entry points* in order for virtualenvwrapper's hook loader to find them. -Entry points are configured in the ``setup.py`` (or ``setup.cfg`` when -using pbr) for your package by mapping the entry point name to the -function in the package that implements it. +Entry points are configured in the packaging instructions for your +package by mapping the entry point name to the function in the package +that implements it. -This partial copy of virtualenvwrapper's ``setup.cfg`` illustrates how +This partial copy of virtualenvwrapper's ``pyproject.toml`` illustrates how the ``initialize()`` and ``initialize_source()`` entry points are configured. -.. include:: ../../setup.cfg - :literal: - :start-after: [entry_points] +:: + + [project.entry-points."virtualenvwrapper.initialize"] + user_scripts = "virtualenvwrapper.user_scripts:initialize" + project = "virtualenvwrapper.project:initialize" + + [project.entry-points."virtualenvwrapper.initialize_source"] + user_scripts = "virtualenvwrapper.user_scripts:initialize_source" -The ``entry_points`` section maps the *group names* to lists of entry +Each entry points section maps the *group names* to lists of entry point specifiers. A different group name is defined by virtualenvwrapper for each extension point (see :ref:`plugins-extension-points`). The entry point specifiers are strings with the syntax ``name = -package.module:function``. By convention, the *name* of each entry +"package.module:function"``. By convention, the *name* of each entry point is the plugin name, but that is not required (the names are not used). diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..2233798 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,90 @@ +[build-system] +requires = ["setuptools", "setuptools_scm[toml]>=6.2"] +build-backend = "setuptools.build_meta" + +[project] +authors = [ + {name = "Doug Hellmann", email = "doug@doughellmann.com"}, + {name = "Jason Myers", email = "jason@mailthemyers.com"}, +] + +classifiers = [ + "Development Status :: 5 - Production/Stable", + "License :: OSI Approved :: MIT License", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Intended Audience :: Developers", + "Environment :: Console", +] + +name = "virtualenvwrapper" +description = "" +dynamic = ["version"] +keywords = ["virtualenv"] +license = {text = "MIT"} +readme = "README.txt" +requires-python = ">=3.8" + +dependencies = [ + "virtualenv", + "virtualenv-clone", + "stevedore", +] + +# https://github.com/pypa/setuptools_scm/ +[tool.setuptools_scm] + +[project.urls] +homepage = "https://virtualenvwrapper.readthedocs.io/" +repository = "https://github.com/python-virtualenvwrapper/virtualenvwrapper" + +[project.entry-points."virtualenvwrapper.initialize"] +user_scripts = "virtualenvwrapper.user_scripts:initialize" +project = "virtualenvwrapper.project:initialize" + +[project.entry-points."virtualenvwrapper.initialize_source"] +user_scripts = "virtualenvwrapper.user_scripts:initialize_source" + +[project.entry-points."virtualenvwrapper.pre_mkvirtualenv"] +user_scripts = "virtualenvwrapper.user_scripts:pre_mkvirtualenv" + +[project.entry-points."virtualenvwrapper.post_mkvirtualenv_source"] +user_scripts = "virtualenvwrapper.user_scripts:post_mkvirtualenv_source" + +[project.entry-points."virtualenvwrapper.pre_cpvirtualenv"] +user_scripts = "virtualenvwrapper.user_scripts:pre_cpvirtualenv" + +[project.entry-points."virtualenvwrapper.post_cpvirtualenv_source"] +user_scripts = "virtualenvwrapper.user_scripts:post_cpvirtualenv_source" + +[project.entry-points."virtualenvwrapper.pre_rmvirtualenv"] +user_scripts = "virtualenvwrapper.user_scripts:pre_rmvirtualenv" + +[project.entry-points."virtualenvwrapper.post_rmvirtualenv"] +user_scripts = "virtualenvwrapper.user_scripts:post_rmvirtualenv" + +[project.entry-points."virtualenvwrapper.project.pre_mkproject"] +project = "virtualenvwrapper.project:pre_mkproject" + +[project.entry-points."virtualenvwrapper.project.post_mkproject_source"] +project = "virtualenvwrapper.project:post_mkproject_source" + +[project.entry-points."virtualenvwrapper.pre_activate"] +user_scripts = "virtualenvwrapper.user_scripts:pre_activate" + +[project.entry-points."virtualenvwrapper.post_activate_source"] +project = "virtualenvwrapper.project:post_activate_source" +user_scripts = "virtualenvwrapper.user_scripts:post_activate_source" + +[project.entry-points."virtualenvwrapper.pre_deactivate_source"] +user_scripts = "virtualenvwrapper.user_scripts:pre_deactivate_source" + +[project.entry-points."virtualenvwrapper.post_deactivate_source"] +user_scripts = "virtualenvwrapper.user_scripts:post_deactivate_source" + +[project.entry-points."virtualenvwrapper.get_env_details"] +user_scripts = "virtualenvwrapper.user_scripts:get_env_details" diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 8f54551..0000000 --- a/requirements.txt +++ /dev/null @@ -1,3 +0,0 @@ -virtualenv -virtualenv-clone -stevedore diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 470d25a..0000000 --- a/setup.cfg +++ /dev/null @@ -1,79 +0,0 @@ -[metadata] -name = virtualenvwrapper -author = Doug Hellmann -author_email = doug@doughellmann.com -summary = Enhancements to virtualenv -description_file = README.txt -license = MIT -classifier = - Development Status :: 5 - Production/Stable - License :: OSI Approved :: MIT License - Programming Language :: Python - Programming Language :: Python :: 3 - Programming Language :: Python :: 3.8 - Programming Language :: Python :: 3.9 - Programming Language :: Python :: 3.10 - Programming Language :: Python :: 3.11 - Intended Audience :: Developers - Environment :: Console -keywords = - virtualenv -home_page = https://virtualenvwrapper.readthedocs.io/ -zip_safe = False - -[files] -packages = - virtualenvwrapper -scripts = - virtualenvwrapper.sh - virtualenvwrapper_lazy.sh - -[global] -zip_safe = False -setup-hooks = - pbr.hooks.setup_hook - -[entry_points] -virtualenvwrapper.initialize = - user_scripts = virtualenvwrapper.user_scripts:initialize - project = virtualenvwrapper.project:initialize -virtualenvwrapper.initialize_source = - user_scripts = virtualenvwrapper.user_scripts:initialize_source -virtualenvwrapper.pre_mkvirtualenv = - user_scripts = virtualenvwrapper.user_scripts:pre_mkvirtualenv -virtualenvwrapper.post_mkvirtualenv_source = - user_scripts = virtualenvwrapper.user_scripts:post_mkvirtualenv_source -virtualenvwrapper.pre_cpvirtualenv = - user_scripts = virtualenvwrapper.user_scripts:pre_cpvirtualenv -virtualenvwrapper.post_cpvirtualenv_source = - user_scripts = virtualenvwrapper.user_scripts:post_cpvirtualenv_source -virtualenvwrapper.pre_rmvirtualenv = - user_scripts = virtualenvwrapper.user_scripts:pre_rmvirtualenv -virtualenvwrapper.post_rmvirtualenv = - user_scripts = virtualenvwrapper.user_scripts:post_rmvirtualenv -virtualenvwrapper.project.pre_mkproject = - project = virtualenvwrapper.project:pre_mkproject -virtualenvwrapper.project.post_mkproject_source = - project = virtualenvwrapper.project:post_mkproject_source -virtualenvwrapper.pre_activate = - user_scripts = virtualenvwrapper.user_scripts:pre_activate -virtualenvwrapper.post_activate_source = - project = virtualenvwrapper.project:post_activate_source - user_scripts = virtualenvwrapper.user_scripts:post_activate_source -virtualenvwrapper.pre_deactivate_source = - user_scripts = virtualenvwrapper.user_scripts:pre_deactivate_source -virtualenvwrapper.post_deactivate_source = - user_scripts = virtualenvwrapper.user_scripts:post_deactivate_source -virtualenvwrapper.get_env_details = - user_scripts = virtualenvwrapper.user_scripts:get_env_details - -[pbr] -warnerrors = true - -[wheel] -universal = true - -[build_sphinx] -source-dir = docs/source -build-dir = docs/build -all_files = 1 diff --git a/setup.py b/setup.py index aa2d8a0..bb5e197 100644 --- a/setup.py +++ b/setup.py @@ -3,6 +3,10 @@ from setuptools import setup setup( - setup_requires=['pbr'], - pbr=True, + # Listing the scripts in pyproject.toml requires them to be python + # entry points for console scripts, but they are shell scripts. + scripts=[ + "virtualenvwrapper.sh", + "virtualenvwrapper_lazy.sh", + ], ) diff --git a/tox.ini b/tox.ini index cb2e757..dff8fbd 100644 --- a/tox.ini +++ b/tox.ini @@ -2,9 +2,7 @@ envlist = py,zsh,style [testenv] -install_command = pip install -U {opts} {packages} commands = bash ./tests/run_tests {envdir} [] -deps = -rrequirements.txt pass_env = HOME USER @@ -33,7 +31,6 @@ commands = zsh -o shwordsplit ./tests/run_tests {envdir} [] [testenv:docs] deps = - -r{toxinidir}/requirements.txt -r{toxinidir}/docs/requirements.txt commands = sphinx-build -W -j auto -b html -d docs/build/doctrees docs/source docs/build/html @@ -41,10 +38,10 @@ commands = [testenv:pkglint] deps= - pbr + build twine check-python-versions commands= - python setup.py sdist + python -m build twine check dist/*.tar.gz - check-python-versions --only setup.py,setup.cfg,.github/workflows/test.yml + check-python-versions --only pyproject.toml,.github/workflows/test.yml From 389179cef6904551350c1a447f2633941d0bad78 Mon Sep 17 00:00:00 2001 From: Doug Hellmann Date: Sat, 11 Feb 2023 11:26:06 -0500 Subject: [PATCH 57/95] tests: update tests to use the packaged version of the scripts The tests were always running the local source copy of virtualenvwrapper.sh, which does not ensure we are packaging and installing that file properly. This commit changes the logic for loading the wrappers so when the job is running under tox we always look in the virtualenv's bin directory. --- tests/setup.sh | 16 ++++++++++++++++ tests/test.sh | 2 +- tests/test_add2virtualenv.sh | 2 +- tests/test_allvirtualenv.sh | 2 +- tests/test_cd.sh | 2 +- tests/test_cd_alias.sh | 2 +- tests/test_cd_space_in_name.sh | 2 +- tests/test_cp.sh | 4 ++-- tests/test_cpvirtualenv.sh | 2 +- tests/test_deactivate.sh | 2 +- tests/test_derive_workon_home.sh | 2 +- tests/test_dir_stack.sh | 2 +- tests/test_expandpath.sh | 2 +- tests/test_hook_dir.sh | 2 +- tests/test_log_file.sh | 6 +++--- tests/test_ls.sh | 2 +- tests/test_mktmpenv.sh | 2 +- tests/test_mkvirtualenv.sh | 2 +- tests/test_mkvirtualenv_associate.sh | 2 +- tests/test_mkvirtualenv_install.sh | 2 +- tests/test_mkvirtualenv_requirements.sh | 2 +- tests/test_project.sh | 4 ++-- tests/test_project_activate.sh | 2 +- tests/test_project_cd.sh | 2 +- tests/test_project_mk.sh | 2 +- tests/test_project_templates.sh | 2 +- tests/test_rmvirtualenv.sh | 2 +- tests/test_run_hook.sh | 2 +- tests/test_setvirtualenvproject.sh | 2 +- tests/test_support.sh | 2 +- tests/test_tempfile.sh | 2 +- tests/test_virtualenvwrapper.sh | 2 +- tests/test_wipeenv.sh | 2 +- tests/test_workon.sh | 2 +- tox.ini | 5 +++-- 35 files changed, 56 insertions(+), 39 deletions(-) diff --git a/tests/setup.sh b/tests/setup.sh index 6e006fb..6ecd404 100755 --- a/tests/setup.sh +++ b/tests/setup.sh @@ -10,3 +10,19 @@ export WORKON_HOME=$(mktemp -d -t "WORKON_HOME.XXXX.$$") export PROJECT_HOME=$(mktemp -d -t "PROJECT_HOME.XXXX.$$") #unset HOOK_VERBOSE_OPTION + +SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" + +# This should point to VIRTUAL_ENV/bin when running under tox. +TEST_BIN_DIR=$(dirname $(which python)) + +load_wrappers() { + if [ "$USING_TOX" = "1" ]; then + # Use the version of the scripts installed as part of the + # package. + source "$TEST_BIN_DIR/virtualenvwrapper.sh" + else + echo "USING SOURCE VERSION OF SCRIPT" + source "$SCRIPTDIR/../virtualenvwrapper.sh" + fi +} diff --git a/tests/test.sh b/tests/test.sh index 0bd26e9..2c05920 100755 --- a/tests/test.sh +++ b/tests/test.sh @@ -6,7 +6,7 @@ source "$test_dir/setup.sh" oneTimeSetUp() { rm -rf "$WORKON_HOME" mkdir -p "$WORKON_HOME" - source "$test_dir/../virtualenvwrapper.sh" + load_wrappers } oneTimeTearDown() { diff --git a/tests/test_add2virtualenv.sh b/tests/test_add2virtualenv.sh index fedba20..e1a0cb3 100755 --- a/tests/test_add2virtualenv.sh +++ b/tests/test_add2virtualenv.sh @@ -6,7 +6,7 @@ source "$test_dir/setup.sh" oneTimeSetUp() { rm -rf "$WORKON_HOME" mkdir -p "$WORKON_HOME" - source "$test_dir/../virtualenvwrapper.sh" >/dev/null 2>&1 + load_wrappers >/dev/null 2>&1 } oneTimeTearDown() { diff --git a/tests/test_allvirtualenv.sh b/tests/test_allvirtualenv.sh index fd7b027..7cc26b9 100755 --- a/tests/test_allvirtualenv.sh +++ b/tests/test_allvirtualenv.sh @@ -6,8 +6,8 @@ source "$test_dir/setup.sh" oneTimeSetUp() { rm -rf "$WORKON_HOME" mkdir -p "$WORKON_HOME" + load_wrappers unset VIRTUAL_ENV - source "$test_dir/../virtualenvwrapper.sh" # These three env names must sort the same whether the OS considers leading whitespace or not. # "test" is after " env" and after "env", so the asserts work on OSX and Linux. mkvirtualenv test1 >/dev/null 2>&1 diff --git a/tests/test_cd.sh b/tests/test_cd.sh index a4cada2..1001204 100755 --- a/tests/test_cd.sh +++ b/tests/test_cd.sh @@ -6,8 +6,8 @@ source "$test_dir/setup.sh" oneTimeSetUp() { rm -rf "$WORKON_HOME" mkdir -p "$WORKON_HOME" + load_wrappers unset VIRTUAL_ENV - source "$test_dir/../virtualenvwrapper.sh" mkvirtualenv cd-test >/dev/null 2>&1 deactivate } diff --git a/tests/test_cd_alias.sh b/tests/test_cd_alias.sh index 4af8f70..e7ec6ae 100755 --- a/tests/test_cd_alias.sh +++ b/tests/test_cd_alias.sh @@ -6,8 +6,8 @@ source "$test_dir/setup.sh" oneTimeSetUp() { rm -rf "$WORKON_HOME" mkdir -p "$WORKON_HOME" + load_wrappers unset VIRTUAL_ENV - source "$test_dir/../virtualenvwrapper.sh" mkvirtualenv cd-test >/dev/null 2>&1 deactivate } diff --git a/tests/test_cd_space_in_name.sh b/tests/test_cd_space_in_name.sh index 157371d..281dcbf 100755 --- a/tests/test_cd_space_in_name.sh +++ b/tests/test_cd_space_in_name.sh @@ -7,8 +7,8 @@ oneTimeSetUp() { export WORKON_HOME="$WORKON_HOME/ this has spaces" rm -rf "$WORKON_HOME" mkdir -p "$WORKON_HOME" + load_wrappers unset VIRTUAL_ENV - source "$test_dir/../virtualenvwrapper.sh" # Only test with leading and internal spaces. Directory names with trailing spaces are legal, # and work with virtualenv on OSX, but error out on Linux. mkvirtualenv " env with space" >/dev/null 2>&1 diff --git a/tests/test_cp.sh b/tests/test_cp.sh index 3bd9196..b1b9b3d 100755 --- a/tests/test_cp.sh +++ b/tests/test_cp.sh @@ -6,14 +6,14 @@ source "$test_dir/setup.sh" setUp () { rm -rf "$WORKON_HOME" mkdir -p "$WORKON_HOME" - source "$test_dir/../virtualenvwrapper.sh" + load_wrappers rm -f "$TMPDIR/catch_output" echo } tearDown() { if type deactivate >/dev/null 2>&1 - then + then deactivate fi rm -rf "$WORKON_HOME" diff --git a/tests/test_cpvirtualenv.sh b/tests/test_cpvirtualenv.sh index ad7803f..b39fea0 100755 --- a/tests/test_cpvirtualenv.sh +++ b/tests/test_cpvirtualenv.sh @@ -6,7 +6,7 @@ source "$test_dir/setup.sh" setUp () { rm -rf "$WORKON_HOME" mkdir -p "$WORKON_HOME" - source "$test_dir/../virtualenvwrapper.sh" + load_wrappers echo } diff --git a/tests/test_deactivate.sh b/tests/test_deactivate.sh index a0afa11..bbc6414 100755 --- a/tests/test_deactivate.sh +++ b/tests/test_deactivate.sh @@ -6,7 +6,7 @@ source "$test_dir/setup.sh" oneTimeSetUp() { rm -rf "$WORKON_HOME" mkdir -p "$WORKON_HOME" - source "$test_dir/../virtualenvwrapper.sh" + load_wrappers mkvirtualenv "env1" } diff --git a/tests/test_derive_workon_home.sh b/tests/test_derive_workon_home.sh index 01b22ba..4f5ddd1 100755 --- a/tests/test_derive_workon_home.sh +++ b/tests/test_derive_workon_home.sh @@ -7,7 +7,7 @@ TMP_WORKON_HOME="$WORKON_HOME" oneTimeSetUp() { rm -rf "$TMP_WORKON_HOME" mkdir -p "$TMP_WORKON_HOME" - source "$test_dir/../virtualenvwrapper.sh" + load_wrappers echo $PYTHONPATH } diff --git a/tests/test_dir_stack.sh b/tests/test_dir_stack.sh index e391754..8383866 100755 --- a/tests/test_dir_stack.sh +++ b/tests/test_dir_stack.sh @@ -14,7 +14,7 @@ oneTimeTearDown() { setUp () { rm -rf "$WORKON_HOME" mkdir -p "$WORKON_HOME" - source "$test_dir/../virtualenvwrapper.sh" + load_wrappers mkdir "$WORKON_HOME/start_here" mkdir "$WORKON_HOME/on_the_stack" echo diff --git a/tests/test_expandpath.sh b/tests/test_expandpath.sh index 541df56..f96f67d 100755 --- a/tests/test_expandpath.sh +++ b/tests/test_expandpath.sh @@ -5,7 +5,7 @@ source "$test_dir/setup.sh" TMP_WORKON_HOME="$WORKON_HOME" oneTimeSetUp() { - source "$test_dir/../virtualenvwrapper.sh" + load_wrappers echo $PYTHONPATH } diff --git a/tests/test_hook_dir.sh b/tests/test_hook_dir.sh index f83b235..8c86e50 100755 --- a/tests/test_hook_dir.sh +++ b/tests/test_hook_dir.sh @@ -23,7 +23,7 @@ RUN_SCRIPTS="premkvirtualenv prermvirtualenv postrmvirtualenv preactivate get_en test_virtualenvwrapper_initialize() { export VIRTUALENVWRAPPER_HOOK_DIR="$WORKON_HOME/hooks" - source "$test_dir/../virtualenvwrapper.sh" + load_wrappers for hook in $SOURCE_SCRIPTS do assertTrue "Global $WORKON_HOME/$hook was not created" "[ -f $WORKON_HOME/hooks/$hook ]" diff --git a/tests/test_log_file.sh b/tests/test_log_file.sh index 73f57a6..4bdc317 100755 --- a/tests/test_log_file.sh +++ b/tests/test_log_file.sh @@ -9,13 +9,13 @@ setUp () { test_set_by_user() { export VIRTUALENVWRAPPER_LOG_FILE="$WORKON_HOME/hooks.log" - source "$test_dir/../virtualenvwrapper.sh" + load_wrappers assertTrue "Log file was not created" "[ -f $VIRTUALENVWRAPPER_LOG_FILE ]" } test_file_permissions() { export VIRTUALENVWRAPPER_LOG_FILE="$WORKON_HOME/hooks.log" - source "$test_dir/../virtualenvwrapper.sh" + load_wrappers perms=$(ls -l "$VIRTUALENVWRAPPER_LOG_FILE" | cut -f1 -d' ') #echo $perms assertTrue "Log file permissions are wrong: $perms" "echo $perms | grep '^-rw-rw'" @@ -25,7 +25,7 @@ test_not_set_by_user() { unset WORKON_HOME unset VIRTUALENVWRAPPER_LOG_FILE unset VIRTUALENVWRAPPER_HOOK_DIR - source "$test_dir/../virtualenvwrapper.sh" + load_wrappers assertSame "" "$VIRTUALENVWRAPPER_LOG_FILE" } diff --git a/tests/test_ls.sh b/tests/test_ls.sh index 25ceab2..18d0008 100755 --- a/tests/test_ls.sh +++ b/tests/test_ls.sh @@ -6,7 +6,7 @@ source "$test_dir/setup.sh" oneTimeSetUp() { rm -rf "$WORKON_HOME" mkdir -p "$WORKON_HOME" - source "$test_dir/../virtualenvwrapper.sh" + load_wrappers } oneTimeTearDown() { diff --git a/tests/test_mktmpenv.sh b/tests/test_mktmpenv.sh index 6a1171d..d2a8785 100755 --- a/tests/test_mktmpenv.sh +++ b/tests/test_mktmpenv.sh @@ -7,7 +7,7 @@ source "$test_dir/setup.sh" oneTimeSetUp() { rm -rf "$WORKON_HOME" mkdir -p "$WORKON_HOME" - source "$test_dir/../virtualenvwrapper.sh" + load_wrappers } oneTimeTearDown() { diff --git a/tests/test_mkvirtualenv.sh b/tests/test_mkvirtualenv.sh index 3c37dfe..d8ecf11 100755 --- a/tests/test_mkvirtualenv.sh +++ b/tests/test_mkvirtualenv.sh @@ -6,7 +6,7 @@ source "$test_dir/setup.sh" oneTimeSetUp() { rm -rf "$WORKON_HOME" mkdir -p "$WORKON_HOME" - source "$test_dir/../virtualenvwrapper.sh" + load_wrappers } oneTimeTearDown() { diff --git a/tests/test_mkvirtualenv_associate.sh b/tests/test_mkvirtualenv_associate.sh index 98526e0..e617f94 100755 --- a/tests/test_mkvirtualenv_associate.sh +++ b/tests/test_mkvirtualenv_associate.sh @@ -6,7 +6,7 @@ source "$test_dir/setup.sh" oneTimeSetUp() { rm -rf "$WORKON_HOME" mkdir -p "$WORKON_HOME" - source "$test_dir/../virtualenvwrapper.sh" + load_wrappers } oneTimeTearDown() { diff --git a/tests/test_mkvirtualenv_install.sh b/tests/test_mkvirtualenv_install.sh index 4cebd28..faf1652 100755 --- a/tests/test_mkvirtualenv_install.sh +++ b/tests/test_mkvirtualenv_install.sh @@ -6,7 +6,7 @@ source "$test_dir/setup.sh" oneTimeSetUp() { rm -rf "$WORKON_HOME" mkdir -p "$WORKON_HOME" - source "$test_dir/../virtualenvwrapper.sh" + load_wrappers } oneTimeTearDown() { diff --git a/tests/test_mkvirtualenv_requirements.sh b/tests/test_mkvirtualenv_requirements.sh index 84ac5ac..744d4fd 100755 --- a/tests/test_mkvirtualenv_requirements.sh +++ b/tests/test_mkvirtualenv_requirements.sh @@ -6,7 +6,7 @@ source "$test_dir/setup.sh" oneTimeSetUp() { rm -rf "$WORKON_HOME" mkdir -p "$WORKON_HOME" - source "$test_dir/../virtualenvwrapper.sh" + load_wrappers } oneTimeTearDown() { diff --git a/tests/test_project.sh b/tests/test_project.sh index f58d5c5..6f2c576 100755 --- a/tests/test_project.sh +++ b/tests/test_project.sh @@ -21,7 +21,7 @@ setUp () { } test_initialize() { - source "$test_dir/../virtualenvwrapper.sh" + load_wrappers for hook in premkproject postmkproject do assertTrue "Global $hook was not created" "[ -f $WORKON_HOME/$hook ]" @@ -32,7 +32,7 @@ test_initialize() { test_initialize_hook_dir() { export VIRTUALENVWRAPPER_HOOK_DIR="$WORKON_HOME/hooks" mkdir -p "$VIRTUALENVWRAPPER_HOOK_DIR" - source "$test_dir/../virtualenvwrapper.sh" + load_wrappers for hook in premkproject postmkproject do assertTrue "Global $hook was not created" "[ -f $VIRTUALENVWRAPPER_HOOK_DIR/$hook ]" diff --git a/tests/test_project_activate.sh b/tests/test_project_activate.sh index b566568..e4b52b3 100755 --- a/tests/test_project_activate.sh +++ b/tests/test_project_activate.sh @@ -8,7 +8,7 @@ oneTimeSetUp() { mkdir -p "$WORKON_HOME" rm -rf "$PROJECT_HOME" mkdir -p "$PROJECT_HOME" - source "$test_dir/../virtualenvwrapper.sh" + load_wrappers } # oneTimeTearDown() { diff --git a/tests/test_project_cd.sh b/tests/test_project_cd.sh index 77a2bae..e336139 100755 --- a/tests/test_project_cd.sh +++ b/tests/test_project_cd.sh @@ -8,7 +8,7 @@ oneTimeSetUp() { mkdir -p "$WORKON_HOME" rm -rf "$PROJECT_HOME" mkdir -p "$PROJECT_HOME" - source "$test_dir/../virtualenvwrapper.sh" + load_wrappers } oneTimeTearDown() { diff --git a/tests/test_project_mk.sh b/tests/test_project_mk.sh index 1e7eb1f..17a9b90 100755 --- a/tests/test_project_mk.sh +++ b/tests/test_project_mk.sh @@ -9,7 +9,7 @@ oneTimeSetUp() { rm -rf "$PROJECT_HOME" mkdir -p "$PROJECT_HOME" export VIRTUALENVWRAPPER_HOOK_DIR="$WORKON_HOME/hooks" - source "$test_dir/../virtualenvwrapper.sh" + load_wrappers } oneTimeTearDown() { diff --git a/tests/test_project_templates.sh b/tests/test_project_templates.sh index f75b777..5329cf6 100755 --- a/tests/test_project_templates.sh +++ b/tests/test_project_templates.sh @@ -9,7 +9,7 @@ oneTimeSetUp() { mkdir -p "$WORKON_HOME" rm -rf "$PROJECT_HOME" mkdir -p "$PROJECT_HOME" - source "$test_dir/../virtualenvwrapper.sh" + load_wrappers } oneTimeTearDown() { diff --git a/tests/test_rmvirtualenv.sh b/tests/test_rmvirtualenv.sh index a1bbe78..9836344 100755 --- a/tests/test_rmvirtualenv.sh +++ b/tests/test_rmvirtualenv.sh @@ -6,7 +6,7 @@ source "$test_dir/setup.sh" oneTimeSetUp() { rm -rf "$WORKON_HOME" mkdir -p "$WORKON_HOME" - source "$test_dir/../virtualenvwrapper.sh" + load_wrappers } oneTimeTearDown() { diff --git a/tests/test_run_hook.sh b/tests/test_run_hook.sh index e1e8644..7ea0b9d 100755 --- a/tests/test_run_hook.sh +++ b/tests/test_run_hook.sh @@ -6,7 +6,7 @@ source "$test_dir/setup.sh" oneTimeSetUp() { rm -rf "$WORKON_HOME" mkdir -p "$WORKON_HOME" - source "$test_dir/../virtualenvwrapper.sh" + load_wrappers } oneTimeTearDown() { diff --git a/tests/test_setvirtualenvproject.sh b/tests/test_setvirtualenvproject.sh index 766036c..c29dcd3 100755 --- a/tests/test_setvirtualenvproject.sh +++ b/tests/test_setvirtualenvproject.sh @@ -8,7 +8,7 @@ oneTimeSetUp() { mkdir -p "$WORKON_HOME" rm -rf "$PROJECT_HOME" mkdir -p "$PROJECT_HOME" - source "$test_dir/../virtualenvwrapper.sh" + load_wrappers } oneTimeTearDown() { diff --git a/tests/test_support.sh b/tests/test_support.sh index 20552d7..cf1ac23 100755 --- a/tests/test_support.sh +++ b/tests/test_support.sh @@ -6,7 +6,7 @@ source "$test_dir/setup.sh" oneTimeSetUp() { rm -rf "$WORKON_HOME" mkdir -p "$WORKON_HOME" - source "$test_dir/../virtualenvwrapper.sh" + load_wrappers } oneTimeTearDown() { diff --git a/tests/test_tempfile.sh b/tests/test_tempfile.sh index be1f89d..f3c0842 100755 --- a/tests/test_tempfile.sh +++ b/tests/test_tempfile.sh @@ -8,7 +8,7 @@ source "$test_dir/setup.sh" oneTimeSetUp() { rm -rf "$WORKON_HOME" mkdir -p "$WORKON_HOME" - source "$test_dir/../virtualenvwrapper.sh" + load_wrappers echo $PYTHONPATH } diff --git a/tests/test_virtualenvwrapper.sh b/tests/test_virtualenvwrapper.sh index 529dff1..d488d20 100755 --- a/tests/test_virtualenvwrapper.sh +++ b/tests/test_virtualenvwrapper.sh @@ -21,7 +21,7 @@ setUp () { } test_virtualenvwrapper_script_set() { - source "$test_dir/../virtualenvwrapper.sh" + load_wrappers assertTrue "VIRTUALENVWRAPPER_SCRIPT is not right: $VIRTUALENVWRAPPER_SCRIPT" \ "echo $VIRTUALENVWRAPPER_SCRIPT | grep -q /virtualenvwrapper.sh" } diff --git a/tests/test_wipeenv.sh b/tests/test_wipeenv.sh index 9b8895c..3eb7b71 100755 --- a/tests/test_wipeenv.sh +++ b/tests/test_wipeenv.sh @@ -6,7 +6,7 @@ source "$test_dir/setup.sh" setUp () { rm -rf "$WORKON_HOME" mkdir -p "$WORKON_HOME" - source "$test_dir/../virtualenvwrapper.sh" + load_wrappers echo } diff --git a/tests/test_workon.sh b/tests/test_workon.sh index 1e3aef7..25047f9 100755 --- a/tests/test_workon.sh +++ b/tests/test_workon.sh @@ -6,7 +6,7 @@ source "$test_dir/setup.sh" oneTimeSetUp() { rm -rf "$WORKON_HOME" mkdir -p "$WORKON_HOME" - source "$test_dir/../virtualenvwrapper.sh" + load_wrappers mkvirtualenv "test1" >/dev/null 2>&1 mkvirtualenv "test2" >/dev/null 2>&1 # Only test with leading and internal spaces. Directory names with trailing spaces are legal, diff --git a/tox.ini b/tox.ini index dff8fbd..48b11a7 100644 --- a/tox.ini +++ b/tox.ini @@ -7,7 +7,7 @@ pass_env = HOME USER setenv = - TOXIC = true + USING_TOX = 1 SHELL = /bin/bash allowlist_externals = bash @@ -15,7 +15,7 @@ allowlist_externals = [testenv:fast] setenv = - TOXIC = true + USING_TOX = 1 SHELL = /bin/bash FAIL_FAST = true @@ -25,6 +25,7 @@ commands = flake8 virtualenvwrapper docs/source/conf.py [testenv:zsh] setenv = + USING_TOX = 1 SHELL = /bin/zsh test_shell_opts = -o shwordsplit commands = zsh -o shwordsplit ./tests/run_tests {envdir} [] From b636de6febc1672f272f6d286ac0c6c80ece3068 Mon Sep 17 00:00:00 2001 From: Doug Hellmann Date: Sat, 11 Feb 2023 11:26:22 -0500 Subject: [PATCH 58/95] docs: switch to manually managed changelog We will want something nicer, but without pbr we don't get this generated content for free so this commit initializes the static content. Addresses #36 --- docs/source/history.rst | 1302 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 1301 insertions(+), 1 deletion(-) diff --git a/docs/source/history.rst b/docs/source/history.rst index 69ed4fe..0d46a23 100644 --- a/docs/source/history.rst +++ b/docs/source/history.rst @@ -1 +1,1301 @@ -.. include:: ../../ChangeLog +CHANGES +======= + +Unreleased +---------- + +* add a --version option to the hook loader +* modernize packaging + +6.0.0.0a1 +--------- + +* update pypi publishing action +* switch to implicit namespaces +* add github action for publishing packages +* Updated tested Python versions in README +* docs: fix or remove broken links +* packaging: fix indentation of trove classifier for audience +* docs: remove broken link from tips list +* tox: update doc build commands +* mergify: add rules to label PRs based on pbr sem-ver data +* remove python2 from startup logic for finding the python interpreter +* drop ksh support +* docs: clean up trailing whitespace +* docs: update language that implies there is only 1 maintainer +* Fixing bitbucket in projects +* Updating template docs +* missed ones +* Updating references to bitbucket +* require at least one reviewer to approve PRs +* ci(Mergify): configuration update +* pass user and home through from tox instead of using id to derive them +* fix wipeenv for editable packages +* skip some tempfile tests on macos +* adjust error message detection in hook tests +* update lssitepackages tests to not need easy\_install +* remove tests and features relying on --no-site-packages +* remove the test for making virtualenvs relocatable +* update tox config to not set basepython for zsh +* update tox to only use default python version +* update test runner to use python3 +* add a "fast" environment in tox to exit as soon as any test fails +* missed ones +* run all of the tests and accumulate errors +* expand the relative path for envdir to the full path +* Updating references to bitbucket +* update trove classifiers with more modern python versions +* add pkglint test and fix some warnings +* set python version for zsh job in ci +* update tox config for tox 4 +* do not specify python version for docs env in tox settings +* set the version of python to use for linter jobs +* fix linter action config +* add github action configuration for test jobs +* Merged in fix/space\_in\_mkvenv\_project\_path (pull request #50) +* Merged in Stephan-Sokolow/improve-zsh-prompt-tip-closes-332-1574470574700 (pull request #75) +* Merged in master (pull request #72) +* Merged in no-more-egrep-its-deprecated (pull request #84) +* replace deprecated \`egrep\` with \`grep -E\` +* Revert "Merged in 334 (pull request #78)" +* Fixing readme.txt +* Merged in 334 (pull request #78) +* Updating to support virtualenv 20+ +* Merged in readme-updates (pull request #76) +* Merged in fix-screencast-link (pull request #77) +* fix link to screencast +* improve some of the wording in the readme +* Improve Zsh prompt tip +* Merged in Shailesh-Vashishth/indexrst-edited-online-with-bitbucket-1566725355529 (pull request #74) +* index.rst edited online with Bitbucket +* Merged in master (pull request #73) +* fixup! Find the highest Python version with installed virtualenvwrapper +* Find the highest Python version with installed virtualenvwrapper + +4.8.4 +----- + +* Formatting change + +4.8.3 +----- + +* Upgrade sphinx, fix docs +* Merged in ukch/virtualenvwrapper/ukch/allow-building-docs-on-python-3-1529536003674 (pull request #71) +* Merged in techtonik/virtualenvwrapper/techtonik/toxini-edited-online-with-bitbucket-1525341850929 (pull request #69) +* Make mkvirtualenv work with interpreters whose paths have spaces +* Allow building docs on Python 3 +* Merged in hjkatz/virtualenvwrapper/fix/workon\_deactivate\_and\_tests (pull request #70) +* Fix bug with workon deactivate typeset -f ; Add test\_workon\_deactivate\_hooks +* Merged in JakobGM/virtualenvwrapper-1/JakobGM/use-code-blocks-in-order-to-allow-easier-1508879869188 (pull request #66) +* Use code blocks in order to allow easier copy-pasting +* Merged in JakobGM/virtualenvwrapper/JakobGM/fix-formatting-error-on-read-the-docs-t-1508876093482 (pull request #65) +* Fix formatting error + +4.8.2 +----- + +* Merged in jeffwidman/virtualenvwrapper-2/jeffwidman/update-rtd-url-they-now-use-io-rather-t-1505539237232 (pull request #63) +* Merged in jeffwidman/virtualenvwrapper-1/jeffwidman/add-python-36-to-pypi-trove-classifiers-1505539102243 (pull request #62) +* Merged in jeffwidman/virtualenvwrapper/jeffwidman/update-readme-with-current-test-status--1505538852189 (pull request #61) +* Update RTD url +* Add python 3.6 to Pypi trove classifiers +* Update readme with current test status + +4.8.1 +----- + +* New PBR doesn't like provides\_dist + +4.8.0 +----- + +* Merged in fix/263 (pull request #60) +* Merged in fix/296 (pull request #59) +* Fixing Documentation +* Update supported versions +* Adding python 3.6 +* Fixing run\_hook and tab\_completion +* First shot at Fixing #263 +* Adding a note about package managers +* Merged in zmwangx/virtualenvwrapper/always-export-virtualenvwrapper\_hook\_dir (pull request #55) +* Typo fix +* Merged in lendenmc/virtualenvwrapper (pull request #51) +* Merged in SpotlightKid/virtualenvwrapper/bugfix/distutils-sysconfig (pull request #56) +* Merged in dougharris/virtualenvwrapper (pull request #53) +* Merged in kk6/virtualenvwrapper/fix/wipeenv\_ignore\_setuptools\_dependencies (pull request #57) +* Merged in erickmk/virtualenvwrapper/erickmk/command\_refrst-edited-online-with-bitbuc-1491225971803 (pull request #58) +* Update sentence to make it more clear +* command\_ref.rst edited online with Bitbucket +* Fixes Issue #291 wipeenv ignore setuptools’s dependencies +* Import distutils.sysconfig properly (fixes #167) +* virtualenvwrapper.sh: always export VIRTUALENVWRAPPER\_HOOK\_DIR +* Fixed case where alternate deactivate didn't exist +* Makes workon more selective in its search for \`deactivate\` #285 +* Merged in sambrightman/virtualenvwrapper (pull request #52) +* Fix spelling mistake in error message +* Fix .kshrc sourcing error "'&>file' is nonstandard" +* Fixes Issues #248 +* Merged in lonetwin/virtualenvwrapper (pull request #48) + +4.7.2 +----- + +* Baseline testing to python27 +* Fixing naming in tests +* Merged in phd/virtualenvwrapper (pull request #46) +* Ignore \*.pyo byte-code files +* Fix docs: fix URLs whenever possible, change protocol to https +* Add wipeenv and allvirtualenv for lazy loading +* Remove one-time functions from the environment +* Fix the problem with lazy completion for bash +* Last set of docs +* Docs fixes +* Updating to virtualenvwrapper +* Last set of docs +* Docs fixes +* Merged in fix/issue-282-link-to-virtualenvwrapper (pull request #49) +* Updating to virtualenvwrapper +* Unset previously defined cd function rather than redefine it +* Merged in ismailsunni/virtualenvwrapper/ismailsunni/command\_refrst-edited-online-with-bitbuc-1454377958615 (pull request #44) +* command\_ref.rst edited online with Bitbucket Adding -d for remove extra path +* use a ref instead of hard-coded link in new tip +* Merged in kojiromike/virtualenvwrapper/deactivate-on-logout-tip (pull request #43) +* Add Deactivate-on-Logout Tip +* update REAMDE with new bug tracker URL +* more dir fixes for El Capitan +* add testing for python 3.5 +* temporary dir fixes for OS X El Capitan (10.11) +* update to work with tox 2.1.1 +* Merged in jveatch/virtualenvwrapper/fix-py26-logging (pull request #41) +* Pass stream as arg rather than kwarg to avoid py26 conflict. Fixes issue #274. StreamHandler arg was named strm in python 2.6 +* enhance verbose output of hook loader +* Merged in erilem/virtualenvwrapper/user-scheme-installation (pull request #38) +* Change install docs to use --user + +4.7.0 +----- + +* Merged in gnawybol/virtualenvwrapper/support\_MINGW64 (pull request #36) +* Detect MSYS if MSYSTEM is MINGW64 +* Merged in kdeldycke/virtualenvwrapper/kdeldycke/restore-overridden-cd-command-to-its-def-1435073839852 (pull request #34) +* Restore overridden cd command to its default builtin behaviour + +4.6.0 +----- + +* remove some explicit tox environments +* Merged in jessamynsmith/virtualenvwrapper/py34 (pull request #30) +* quiet some of the lsvirtualenv tests +* add test for previous patch +* Merged in robsonpeixoto/virtualenvwrapper/bug/265 (pull request #33) +* Removes empty when list all virtualenvs +* Merged in justinabrahms/virtualenvwrapper/justinabrahms/update-links-and-name-for-venv-post-1431982402822 (pull request #32) +* Update links and name for venv post +* Added testing and updated docs for python 3.4 +* Merged in jessamynsmith/virtualenvwrapper/env\_with\_space (pull request #28) +* Changes as per code review +* Added tests to verify that cpvirtualenv, lsvirtualenv, and mkproject work with spaces in env names +* Made rmvirtualenv work with spaces +* Added tests for leading spaces (trailing spaces don't work in Linux, so don't test them) +* Made lsvirtualenv and allvirtualenv work with spaces in env names +* Made cd command work with space in virtualenv name +* Fixed ordering in asserts for workon tests +* Made workon fully support virtualenvs with spaces in names +* fix default for VIRTUALENVWRAPPER\_WORKON\_CD + +4.5.0 +----- + +* Add -c/-n options to mktmpenv +* update mktmpenv test to assert changed directory +* Add test for creating venv with space in name + +4.4.1 +----- + +* Touch temporary file after a name is created +* document 'workon .' and give attribution +* Support "workon ." +* fix pep8 error +* make cd after workon optional +* fix sphinx build +* Merged in hjwp/virtualenvwrapper (pull request #25) +* Stop mangling the python argument to virtualenv +* ignore -f lines in pip freeze output +* Merged in bittner/virtualenvwrapper (pull request #22) +* hacked attempt to get round MSYS\_HOME environ dependency on windows/git-bash/msys +* Change "distribute" to "setuptools" in docs +* Merged in jessamynsmith/virtualenvwrapper (pull request #23) +* Override tox's desire to install pre-releases +* Reworded the documentation around user scripts vs plugin creation, to make it more clear which one you need. Also added a simple example of user scripts +* do not install distribute in test environments +* Correct spelling of "Bitbucket" +* Update issue tracker URL + +4.3.2 +----- + +* build universal wheels +* Merged in das\_g/virtualenvwrapper/das\_g/removed-gratuitous-preposition-1413208408920 (pull request #19) +* removed gratuitous preposition +* Fix test invocation for zsh +* add -q option to cd for zsh +* make run\_tests use the SHELL var to run test script + +4.3.1 +----- + +* pep8 and test updates for previous commit +* Make postmkproject use VIRTUALENVWRAPPER\_HOOK\_DIR +* Tell tox it is ok to run shells not installed in the virtualenv +* Set VIRTUALENVWRAPPER\_SCRIPT correctly for different shells +* Merged in nishikar/virtualenvwrapper (pull request #14) +* changed phrasing of environment not found message +* Add tests for wipenv with editable packages +* Remove obsolete information about pip environment vars +* Replace manually maintained history with ChangeLog +* Update doc build to fail if there are warnings + +4.3 +--- + +* remove announce.rst; move to blogging repository +* Merged in erikb85/virtualenvwrapper/erikb85/run-user-postactivate-after-changing-dir-1401272364804 (pull request #15) +* Run User Postactivate after changing dirs +* add link to sublimetext extension +* moved environment exists check below active environment check +* added no such environment prompt to rmvirtualenv if it does not exist +* updated pep8 +* clean up script mode changes +* forgotten comment +* trailing whitespace removed +* tabs expanded; mode difference +* changed comments and mode for sourced scripts +* ignore bin, include, lib +* mode constant for sourced-only files +* do not specify a version for pbr +* Merged in mjbrooks/virtualenvwrapper (pull request #12) +* use VIRTUALENVWRAPPER\_ENV\_BIN\_DIR throughout +* Extract basic help text from the script +* Add list of commands as basic help output +* update author email +* clean up comment about zsh behavior in lazy +* Fix syntax error (empty \`if\` block) + +4.2 +--- + +* update docs for 4.2 release +* update history for previous change; fix syntax issue in previous change +* update history +* Do not create hooks for rmproject +* make setvirtualenvproject honor relative paths +* Ensure hook directory exists +* fix indentation in virtualenvwrapper\_lazy.sh +* use valid syntax for creating tmpdir under linux +* stop python 3.2 tests +* stop using distribute for packaging the test templates +* fix merge issue from previous commit +* Fix mkvirtualenv -a relative paths +* minor: tabs to spaces +* Fix zsh crash caused by lazily loading the completions +* Fix hint in error message, when virtualenvwrapper\_run\_hook failed +* changed spelling of proj\_name calculation +* Fix \`which\` with virtualenvwrapper\_lazy.sh +* use virtualenvwrapper\_cd in project plugin +* document new force option in history +* Merged in claymcclure/virtualenvwrapper (pull request #2) +* update history for doc fix from dirn +* Merged in dirn/virtualenvwrapper/dirn/fix-documentation-for-allvirtualenv-the-1375587964876 (pull request #4) +* update history for cd command fix +* consolidate 'ls' tests +* update test to handle change easy\_install +* ignore any egg directories created while packaging +* add tests to make sure we override cd properly +* Merged in isbadawi/virtualenvwrapper (pull request #5) +* Always use virtualenvwrapper\_cd instead of cd +* Fix documentation for allvirtualenv +* Document \`mkproject --force\` usage +* Mention sphinxcontrib-bitbucket requirement +* Merged in mrdbr/virtualenvwrapper (pull request #3) +* add tmp- prefix to temporary envs +* Preserve quoting for allvirtualenv command arguments +* Add \`mkproject --force\` option +* Remove extraneous punctuation + +4.1.1 +----- + +* update history for 4.1.1 +* Merged in mordred/virtualenvwrapper (pull request #1) +* Take advantage of pbr 0.5.19 +* Working on packaging issue with 4.1 release + +4.1 +--- + +* prep for 4.1 release +* fix pep8 issue in user\_scripts.py +* quiet cdproject test +* one more parallel test issue +* use pbr for packaging +* Allow tests to run in parallel +* Fix virtualenv detection with spaces in WORKON\_HOME +* add license file +* Fix problem lsvirtualenv after previous commit +* Add allvirtualenv command +* Ensure that -p and --python options are consistent +* quiet tests +* add test for mkvirtualenv w/ site-packages +* ignore emacs TAGS file +* Provide a way to extend the lazy-loader +* Add wipeenv command +* Update ignore file +* remove trailing whitespace in tox.ini +* Quote paths +* Skip pushd/popd test under ksh +* Run the cdproject test in a subshell +* Show more details when running under zsh +* add doc explaining implementation choices +* add a warning to cpvirtualenv command docs +* fix rst in announcement file +* fix home page url +* add python 3.3 classifier +* Added tag 4.0 for changeset 2ba65a13f804 + +4.0 +--- + +* Prepare for 4.0 release +* Update Python 3 compatibility +* assume setuptools is available during the installation +* update tested-under version lists +* add attribution for previous fix to the history file +* Correct script name in error message +* reorg test runner to remove redundant test runs +* flake8 fixes for setup.py +* Prep 3.7.1 release +* Make --python option to mkvirtualenv not sticky +* Fix project template listing when none installed +* note change in the history file +* better prefix and fix for other help functions +* prevent workon\_help from polluting the global namespace +* Fixed broken screencast link +* Merged in dasevilla/virtualenvwrapper/link-fix (pull request #33) +* Update link to requirements docs +* Added tag 3.7 for changeset 303ff1485acb + +3.7 +--- + +* update version number +* Apply style to sphinx config file +* add link to flake8 in history +* use flake8 instead of pep8 for style checking +* Turn off logging by default +* Add help option to workon +* Add --help option to mkproject +* merge readme filename change +* Merged in jeffbyrnes/virtualenvwrapper (pull request #32) +* merge Add complete-time load to lazy loader +* Merged in upsuper/virtualenvwrapper (pull request #29) +* fix issue with toggleglobalsitepackages tests that was hidden by old test virtualenv +* show which virtualenv is used in tests +* do not check in test output +* Use $\_VIRTUALENVWRAPPER\_API instead of listing functions +* merge exclusion rules for doc build artifacts +* Added tag 3.6.1 for changeset c180ccae77b4 + +3.6.1 +----- + +* prepare 3.6.1 release +* Rename READMEs to be RST +* Added exclusion for docs/en, docs/es, and docs/ja to .hgignore +* Add complete-time load to lazy loader +* Fix link to setvirtualenvproject command +* merge fix for relative python interpreter option to mkvirtualenv +* Replace realpath with a more portable way of converting a relative path to an absolute path +* Fix typo in documentation +* Fix --python switch for virtualenv +* fix markup typo in announcement +* Added tag 3.6 for changeset 002a0ccdcc7a + +3.6 +--- + +* update version number before release, 2 +* update version number before release +* fix pep8 issues with setup.py +* fix pep8 issues with sphinx conf file +* Fix virtualenvwrapper\_show\_workon\_options under zsh with chpwd +* update history for previous change +* Update documentation to point to the real file where add2virtualenv command adds directories to PYTHONPATH +* update the links to the translated versions of the documentation +* change to the default theme for readthedocs.org +* move es and ja versions of docs to their own repositories +* add attribution to history file for previous patch +* fix issue with add2virtualenv and noclobber setting in shell; fixes #137 +* pep8 cleanup +* fix lazy-loader function definitions under zsh; fixes #144 +* use the right virtualenv binary to get help; fixes #148 +* convert hook loader to use stevedore +* fix reference in announcement +* Added tag 3.5 for changeset c93b81815391 + +3.5 +--- + +* bump version number and update announcement text +* fix whitespace and rename a few worker functions to be consistent with the rest +* document previous changes +* Use "command" to avoid aliases or functions that mask common utilities. fixes #119 +* quiet some test operations and check for error codes before continuing +* allow the caller to control which shells are used for tests; unset variables that might be inherited and give the wrong idea about what the current shell is for a test; export SHELL to point to the current shell +* add test for lazy loading via workon; addresses #144 +* update docs with link to virtualenvwrapper-win port; fixes #140 +* clean up cpvirtualenv documentation +* if cpvirtualenv fails to create the target directory, return an error code +* document cpvirtualenv addition +* merged upstream +* Forgot to uncommit the remove workon\_home in teardown +* update README with supported python versions +* Did not mean to commit isitepackages +* Update cpvirtualenv utilizing virtualenv-clone and allowing for external virutalenvs to be added to WORKON\_HOME +* fix xref endpoint used in install.rst +* Added tag 3.4 for changeset 07905d9135ac + +3.4 +--- + +* bump version +* update announcement +* clarify warning on tab completion +* add lazy loader +* move error reporting for bad python interpreter closer to where the error occurs +* Invoke the initialization hooks directly when testing for error with Python +* hide error messages +* fix section heading in announce blog post so the version number does not appear twice +* update announcement file for 3.3 release +* fix the requirement name +* remove old copy of requirements file +* add requirements file to try readthedocs again +* Added tag 3.3 for changeset 45877370548e + +3.3 +--- + +* prepare 3.3 release +* attribution for previous merge +* Merged in agriffis/virtualenvwrapper (pull request #22) +* clean up RST formatting +* attribution for previous merge +* Merged in barberj/vew/fix\_installing\_requirements\_after\_cd (pull request #21) +* Use spaces for indentation consistently instead of mixed spaces/tabs. No functional changes +* Quoting arguments to expandpath to allow for spaces in the arguments +* Update to get fully qualified path of requirments in case a directory change occurs before pip is called +* Clean up the temporary file in the virtualenvwrapper\_run\_hook error returns +* attribution for previous merge +* Merged in agriffis/virtualenvwrapper (pull request #20) +* Fix error handling in virtualenvwrapper\_tempfile; the typeset builtin will return success even if the command-substitution fails, so put them on separate lines +* catch --help option to mkvirtualenv; fixes #136 +* Remove the trap from virtualenvwrapper\_tempfile; the function is called in a command substitution, so the trap fires immediately to remove the file. There are ways to accomplish this, but they're complex and the caller is already explicitly rm'ing the file +* attribution for merging pull request 17 +* merge in hook listing and pep8 fixes +* pep8 changes +* Merged in bwanamarko/virtualenvwrapper (pull request #17) +* print the list of core hooks if no hook name is given in list mode +* attribution for previous merges +* Check that required test shells are available ahead of running tests. This avoids accidentally running tests with /bin/sh (dash) on Debian, which eventually deletes the ~/.virtualenvs directory. (Whoops.) +* Enforce running run\_tests under tox by setting/checking an env var +* another fix for msys users \* using lssitepackages \* keep $site\_packages in quotes in case of spaces +* fix bug for MSYS users - makes several folders, fails on shell startup \* if $WORKON\_HOME not defined, or folder missing, then when mkdir called must \* pass $WORKON\_HOME in double-quotes "$WORKON\_HOME" because there might be \* spaces that will be interpretted separately \* e.g. C:\Documents and Settings\.virtualenv makes 3 folders: \* "C:\Documents", "~/and" & "~/Settings/.virtualenv" +* update shell function virtualenvwrapper\_get\_site\_packages\_dir \* let MSYS users use lssitepackages & cdsitepackages \* replace $VIRTUAL\_ENV/bin with $VIRTUAL\_ENV/$VIRTUALENVWRAPPER\_ENV\_BIN\_DIR +* attribution for documentation work +* reset the default language +* revised the Japanese translation in plugins.rst +* revised the Japanese translation in index.rst +* merged the changes (r369:550) in extensions.rst +* merged the changes (r369:550) for Japanese translation in projects.rst +* merged the changes (r369:550) for Japanese translation in extensions.rst +* merged the changes (r369:550) for Japanese translation in developers.rst +* merged the changes (r369:550) for Japanese translation in tips.rst +* merged the changes (r369:550) for Japanese translation in scripts.rst +* merged the changes (r369:550) for Japanese translation +* merged the changes (r369:550) for Japanese translation +* changed LANGUAGE settings "en" to "ja" +* merged from original +* add attribution to history file for ralphbean's changes +* merge in permission changes from ralphbean +* Bypass the test for missing virtualenv if the user has it installed to the subset of the path needed for the shunit2 framework to function properly. Add a test for having VIRTUALENVWRAPER\_VIRTUALENV set to a program that does not exist +* Removed shebangs from scripts non-executable site-packages files +* Removed execution bit on virtualenvwrapper.sh +* update announcement blog post for 3.2 +* Added tag 3.2 for changeset dccf1a1abf4e + +3.2 +--- + +* bump version number +* Add a link target name for the rmvritualenv command +* Use distutils to get the site-packages directory. Fixes #112 +* more global test header cleanup +* Centralize setup of variables for tests. Change WORKON\_HOME and PROJECT\_HOME for tests to make them unique across runs, allowing simultaneous test runs in different sandboxes +* update history for previous merge +* Merged in ciberglo/virtualenvwrapper (pull request #13) +* add history details about license classification change +* Merged in ralphbean/virtualenvwrapper (pull request #14) +* attribution for previous commit +* Fix typo in documentation reported by Nick Martin +* Changed trove classifiers from BSD to MIT (like the README indicates.) +* add test for removing several environments +* changing rmvirtualenv message: Erasing --> Removing +* support to remove several environments at once +* remove blank spaces +* use typeset instead of local and provide attribution for the original fix +* Make project\_dir local so it doesn't clobber other variables +* Added tag 3.1 for changeset ebbb3ba81687 + +3.1 +--- + +* prepare release 3.1 +* quote the path as we are editing the pth file; fixes #132 +* update history file for previous change +* associate project before enabling the new virtualenv; fixes #122 +* add tags to announce.rst +* add a couple of debugging lines to the generated scripts +* Added tag 3.0.1 for changeset 14cf7e58d321 + +3.0.1 +----- + +* package release 3.0.1; fixes #126 +* Add test files to the sdist package. Addresses #126 +* Remove /usr/bin since apparently there are times when virtualenv is installed there due to vendor packages. Fixes #127 +* Added tag 3.0 for changeset 434b87ebc24a + +3.0 +--- + +* fix version info in trove classifiers, take 2 +* fix version info in trove classifiers +* use the version of python in the current virtualenv to install the template project into the tox virtualenv during the test +* merge in support for python 3.2 +* bump version number, update history, prepare announcement +* remove redundant test +* use the version of python in the virtualenv instead of depending on the PATH +* use packages available for python 3 +* use packages that can be installed under python 3 to test the -i option to mkvirtualenv +* get the output in a way that makes it work properly with grep +* include virtualenv in the test dependencies +* fix shell expression to get the python version +* fix indentation +* py3k compatibility +* py3k compatibility +* py3k compatibility +* Added tag 2.11.1 for changeset 12a1e0b65313 + +2.11.1 +------ + +* update history and version number for bug release +* Skiping re-initialization in subshells breaks tab completion, so go ahead and take the performance hit. Closes #121 +* quiet some tests +* announcement for 2.11 release +* Added tag 2.11 for changeset ff4d492c873c + +2.11 +---- + +* bump version number for release +* add VIRTUALENVWRAPPER\_PROJECT\_FILENAME; resolves issue 120 +* make log files group writable; resolves #62 +* shortcut initialization if it has run before +* Remove support for Python 2.4 and 2.5. Update tests to work with virtualenv 1.7, where --no-site-packages is now the default +* Add note about -a option to history file and clarify its description in the docs a bit +* documentation for -a flag +* test for 'mkvirtualenv -a ' +* add -a project\_path to mkvirtualenv usage summary +* associate a project with a venv at creation +* fix link to Justin Lily's helper post +* Added tag 2.10.1 for changeset 9e10c201a500 + +2.10.1 +------ + +* bump version to 2.10.1; closes #114 +* improve test for mktmpenv with options; addresses #114 +* change mktmpenv to always create an env name for the user; addresses #114 +* update announcement text +* bump version number +* document previous fix in history +* strip spaces from template names; fixes #111 +* fix template listing for python 2.4, which does not support the -m option with namespace packages +* if uuid is not available, use random to generate a name for the new environment +* Use old style string formatting instead of the format method to retain python 2.4 and 2.5 support +* add test to ensure templates are applied correctly +* get the version number from the packaging scripts +* add mktmpenv command from virtualenvwrapper.tmpenv +* add -i option to mkvirtualenv +* more test quieting +* quiet tests and add intermediate check for delete +* fix use of sed in add2virtualenv to be more portable +* quiet test +* Merged in miracle2k/virtualenvwrapper (pull request #6) +* merge in linux changes +* ignore temporary files created by editor +* variable name changes and other cleanup so the script does not bomb under ksh on ubunutu 11.04 +* run each test script in every shell before moving to the next script +* Make add2virtualenv tests work again, add new test code for new features +* Update lssitepackages to work with new pth filename +* Merged upstream +* add link to changelog in readme +* fix version number in history +* update announcement file +* Upgrade instructions +* Clean up help functions. Add documentation for new -r option to mkvirtualenv +* Add -r option to mkvirtualenv to install base requirements after the environment is created. Fix argument processing in mkproject so the correct template names are preserved +* merge virtualenvwrapper.project features into virtualenvwrapper +* convert function definition format so typeset works under ksh +* Merged upstream +* add link to powershell port +* Added tag 2.8 for changeset 279244c0fa41 + +2.8 +--- + +* set version in history and update announcement +* Added tag 2.8 for changeset 7e0abe005937 +* bump version number +* merge in patches from noirbizarre to add support for MSYS environment; clean up doc addition; fix resulting problem is lsvirtualenv +* Identify another --no-site-packages test and add one for cpvirtualenv using the default args variable; addresses #102 +* add test for --no-site-packages flag after cpvirtualenv; addresses #102 +* Escape uses of cd in case it is aliased. addresses #101 +* add a test to verify pushd/popd behavior; addresses #101 +* Set is\_msys to False when not in MSYS shell +* Avoid declaring the 'command\_exists' function for a one shot use +* Replaced all remaining 'bin' occurences by $VIRTUALENVWRAPPER\_ENV\_BIN\_DIR +* Use VIRTUALENVWRAPPER\_VIRTUALENV in cpvirtualenv. fixes #104 +* Merged in sharat87/virtualenvwrapper (pull request #1) +* Update documentation about mktemp +* VIRTUALENVWRAPPER\_VIRTUALENV\_ARGS not working with >1 args on zsh +* User scripts should be called based on new $VIRTUALENVWRAPPER\_ENV\_BIN\_DIR variable +* add some debugging and a test to try to reproduce problem with log directory variable; addresses #95 +* move tab completion initialization; expand support for tab completion in zsh (fixes #97) +* Added support for getopts with fallback on getopt +* Improved variable name: VIRTUALENVWRAPPER\_ENV\_BIN\_DIR instead of script\_folder and is\_msys instead of msys +* Document MSys installation +* Allow Win32 and Unix paths for MSYS\_HOME variable +* Added msys paths support +* update announce file +* Added tag 2.7.1 for changeset b20cf787d8e1 + +2.7.1 +----- + +* bump version number for bug release +* set log dir and hook dir variables after WORKON\_HOME is set; fixes #94 +* link to documentation about installing into user directory +* further installation doc clarification +* add a warning about installing into a virtualenv +* clarify instructions for running tests; fixes #92 +* report an error if there are no test scripts +* Added tag 2.7 for changeset ea378ef00313 + +2.7 +--- + +* update version and draft announcement +* add grep fix to history +* remove -e option from all calls to grep for better portability; fixes #85 +* nicer titles for configuration section +* reorg install docs to separate the customization stuff; add some comments about site-wide installation; fixes #87 +* make it possible to remove a virtualenv while inside it; fixes #83 +* pass VIRTUALENVWRAPPER\_VIRTUALENV\_ARGS when calling VIRTUALENVWRAPPER\_VIRTUALENV; fixes #89; fixes #87 +* add link to vim-virtualenv +* enable tab completion for showvirtualenv; fixes #78 +* clean up test instructions for developers; fixes #75 +* clear configuration variables before running tests +* fix typo in cpvirtualenv; fixes #71 +* Add VIRTUALENVWRAPPER\_LOG\_DIR variable +* Use VIRTUALENVWRAPPER\_HOOK\_DIR to control where the hooks are defined +* doc updates for VIRTUALENVWRAPPER\_VIRTUALENV +* fix tests to work under ksh on ubuntu 10.10 by using alternate syntax for capturing messages sent to stderr +* fix tempdir tests to work on ubuntu 10.10 +* merge pmclanahan's test changes and toggleglobalsitepackages +* Add attribution for recent patches to the history file +* fix tests for changes to virtualenvwrapper\_verify\_workon\_home +* suppress hook loader messages in tests +* change verbosity level when creating hook scripts so the messages can be suppressed in tests +* Added docs for the toggleglobalsitepackages command +* Added "toggleglobalsitepackages" command. Added tests for the new command +* Modified the test runner to reliably use the intended shells +* fix arg handling for lsvirtualenv under zsh - fixes issue #86 +* remove the custom functions from the sphinx config, since rtd does not support them +* trying readthedocs again +* ignore .orig files created by hg +* fix lsvirtualenv to read args in zsh +* remove the download url since I upload packages to pypi now +* translated 2.6.2/2.6.3 history into Japanese +* fixes issue 79 by enclosing WORKON\_HOME in quotes +* merged from original +* Added tag 2.6.3 for changeset 246ce68795ea + +2.6.3 +----- + +* tweak history +* Added tag 2.6.3 for changeset e7582879df06 +* more doc build changes +* add upload target +* Added tag 2.6.2 for changeset 625d85d3136f + +2.6.2 +----- + +* fix doc build for readthedocs.org +* add test for space in WORKON\_HOME to address #79 +* add a test to verify that when virtualenv fails to create an environment the hook scripts are not run. see #76 +* merged a few fixes and updated history +* update history +* merge in japanese translation of documentation, with a few markup fixes; disable spelling extension until there is a python 2.7 installer for it +* add spelling extension +* Added Japanese translation for the documentation Added to make html/website for the Japanese documentation Added the Japanese documentation link in original English index.rst +* restore download url +* Added tag 2.6.1 for changeset 445a58d5a05a + +2.6.1 +----- + +* version 2.6.1 +* fixes issue #73 by changing virtualenvwrapper\_get\_python\_version to only include the major and minor numbers +* add supported version info to readme so it appears on pypi page +* Added tag 2.6 for changeset b0f27c65fa64 + +2.6 +--- + +* bump version to 2.6 and document updates +* avoid specifying text mode when creating hook scripts (fixes #68) +* closes #70 by adding a list of supported shells and python versions to documentation and trove classifiers +* fix #60 by setting install\_requires instead of requires +* change the way we determine the python version +* convert test scripts to use tox instead of home-grown multi-version system in the Makefile +* create the WORKON\_HOME dir if it doesn't exist +* fix platforms definition so upload to pypi will work +* Added tag 2.5.3 for changeset dc74f106d8d2 + +2.5.3 +----- + +* point release before uploading sdist +* Added tag 2.5.2 for changeset f71ffbb996c4 + +2.5.2 +----- + +* Make lsvirtualenv work under zsh using patch from Zach Voase. Fixes #64 +* Added tag 2.5.1 for changeset 2ab678413a29 + +2.5.1 +----- + +* fix workon to list in brief mode +* Added tag 2.5 for changeset 80e2fcda77ac + +2.5 +--- + +* bump version +* add docs for showvirtualenv +* add showvirtualenv and re-implement lsvirtualenv with it +* Added tag 2.4 for changeset a85d80e88996 + +2.4 +--- + +* tweak history file +* Added tag 2.4 for changeset 64f858d461d4 +* add lsvirtualenv command with -l option +* Added tag 2.3 for changeset b9d4591458bb + +2.3 +--- + +* add get\_env\_details hook +* Added tag 2.2.2 for changeset 266a166f80da + +2.2.2 +----- + +* bump version to 2.2.2 +* check exit code of virtualenv before proceeding (fixes #56) +* use single quotes around regex with $ (see #55) +* update history with changes (see #57) +* escape more commands (see #57) +* incorporate patch from fredpalmer to escape grep calls (fixes #57) +* Added tag 2.2.1 for changeset 87d60f20a715 + +2.2.1 +----- + +* fix #50 by escaping rm before calling it +* Added tag 2.2.1 for changeset 66a89d019905 +* bump version to 2.2.1 +* convert path deriving code in startup of script to function so it is easier to test +* escape dollar sign in regex to resolve #53 +* add tests for GREP\_OPTIONS problem (ref #51) +* unset GREP\_OPTIONS before to use grep +* add support and bug tracker link to readme and docs +* ignore missing files in trap cleanup (see #38) +* address #37 with wording change in docs +* update history +* address issue #46 by escaping the calls to which +* Added tag 2.2 for changeset d5c5faecc92d + +2.2 +--- + +* bump version number +* more test refinements +* add trap to remove temporary file, see #38 +* more tempfile fixes +* changes to make the tests run on my linux host +* mention changes to address ticket 35 in history +* addresses ticket 35 by adding debugging instrumentation +* since we always use the same config dir, set it once +* unify sphinx config files +* use the sphinxcontrib.bitbucket extension for links to the issues and changesets in history.rst +* update history with recent changes +* fix tests; clean up contributed changes +* Fixing a bug in the call to mktemp +* Some cleanup after talking with dhellmann +* First pass at speeding things up by making fewer calls into Python. Needs review +* review for text added by Doug about the translation +* show python version in test progress messages +* fix #44 by updating the tests to run with python 2.7b1 +* fix #43 by switching the way the hook loader is run +* Added tag 2.1.1 for changeset 7540fc7d8e63 + +2.1.1 +----- + +* setting up for a release +* fix #42 by quieting the errors/warnings +* fix #41 by using the cached python where the wrappers are installed +* fix formatting of seealso block +* link to Manuel's home page instead of just the translation +* add link back to english docs +* add attribution for Manuel +* add link from english to spanish docs; update history +* shift output directory for html build so the sdist package looks nicer +* merge in spanish translation +* another attempt to address #35 +* added italic to deactivation +* announce translation +* english paragraph removed +* README translated +* first revision +* index revision +* markup fix +* aspell to plugins and fix some paragraphs +* aspell for script +* aspell to install +* aspell to index +* aspell to hooks +* aspell for extensions +* aspell for developers +* aspell for command\_ref +* another paragraph +* almost done for plugins.rst +* continue the translation +* continue the translation of plugins.rst +* remove the option that copy the static files: we don't have file to copy and it generate a WARNING in the sphinx compilation +* markup fixed +* remove translation from the toctree +* scripts.rst tranlated to spanish +* remove old version of translations.rst, we don't need this file anymore +* I don't think that we need to translate the ChangeLog +* extensions.rst translated +* tips.rst translated +* rst markup fixed +* typo fixed on english documentation +* fix the Makefile to generate the website documentation for 'en' and 'es' languages +* reorder the documents files in docs/LANGUAGE folders and modify the rules in the Makefile to build the documentation +* merge from Doug commit. Added the base.html template to make the website documentation +* Makefile modified to build "es" documentation +* put the base template in the repository +* developers.rst translated +* typo fixed +* continue plugins.rst translation +* Fix typo found by humitos +* starting with "Defining an Extension" +* start to translate plugins.rst +* hooks translated +* translations in the index page +* added some translated topics +* added the translation for install.rst +* index.rst translated to spanish +* fixed the right bug :) +* update announcement for 2.1 +* add emacs directive to readme +* Added tag 2.1 for changeset 241df6c36860 + +2.1 +--- + +* bump version +* rotate log file when it grows too big +* do not include website html in sdist +* do not include html docs inside virtualenvwrapper dir to avoid conflicts with other packages using that namespace +* fix mkvirtualenv -h +* doc updates +* add references to new extensions +* add -n and -l options to hook loader +* update docs with examples +* handle empty workon\_home dir properly +* support nondescructive argument to deactivate +* include a date value in the filename +* fix #34 by using python's tempfile module instead of a shell command +* add hooks for cpvirtualenv; make deactivate work better under ksh +* Update docs for mkvirtualenv to fix #30 +* fix #33 with improved installation instructions and a better error message +* use tempfile to create temporary files instead of the process id so the filenames are less predictable +* update contributing info +* add attribution for research work for ksh port +* add support for ksh (fixes #25) +* copy dist file to desktop after building +* Added tag 2.0.2 for changeset 6a51a81454ae + +2.0.2 +----- + +* update version and history +* fix #32 by removing use of 'with' ; add tests for python 2.6 and 2.5 +* sort ignore lines and add build directory +* Added tag 2.0.1 for changeset 91e1124c6831 + +2.0.1 +----- + +* update version and history +* add documentation about temp files +* fix #29 by checking TMPDIR and using a default if no value is found +* save draft of email for announcing new releases on python-announce +* Added tag 2.0 for changeset 54713c4552c2 + +2.0 +--- + +* fix install dir for web docs +* Added tag 2.0 for changeset 485e1999adf0 +* move todo list out of hg repo +* add namespace package declaration +* include more motivational background +* add help to Makefile +* merge 2.0 changes into tip +* status update +* even more doc cleanup +* doc restructuring +* remove rudundant 'source' from cli +* more doc cleanup +* more doc cleanup +* update extension entry point docs +* move make\_hooks functionality into user\_scripts, since they are related +* start overhauling doc content +* test cleanup and enhancement +* add VIRTUALENVWRAPPER\_LAST\_VIRTUAL\_ENV variable for postdeactivate scripts +* use the user's current shell as the default interpreter in the hook script +* quiet hook loader +* minor doc updates and formatting changes +* comment out debug logging +* all existing tests are passing again +* convert more hooks; stop running tests when we see a failure or error +* implement initialize hooks +* start implementing hook loader and a couple of sample hooks +* rename wrapper script +* add register rule +* update installation test +* don't need pavement.py any more +* add rules for updating website +* set version in Makefile before building html +* more tasks +* add test rules +* start moving from paver back to make and distribute +* reorg todo list +* add todo list and design notes for hook scripts +* Added tag 1.27 for changeset d64869519c2e + +1.27 +---- + +* add explicit check for virtualenv in the test +* Added tag 1.27 for changeset 3edf5f224815 +* bump version; pre-release code cleanup +* add note about relocatable side-effect +* undo merge, tests moved to separate files +* touch up tests +* flush formatting prints +* quiet tests +* ignore build files created by tests +* added test that copied virtualenv exists +* resolve conflict on tests dispatch +* added script to setup.py +* add testpackage setup.py +* Added tag 1.26 for changeset 51eef82a39d4 + +1.26 +---- + +* preparing version 1.26 for release +* fix #26 by quieting the error message during init and only showing it when an action is explicitly taken by the user +* remove directories likely to contain a site-wide virtualenv installation and hide the error message because we expect mkvirtualenv to fail +* break up the tests to make it easier to run only part of them +* run all tests on all shells +* Added tag 1.25 for changeset 06229877a640 + +1.25 +---- + +* add cdsitepackages arg handling from William McVey +* Added test for cdsitepackages with argument +* Updated with expanded capability of cdsitepackages to cd to a subdir +* Added tab completion and pathname argument handling to cdsitepackages +* I didn't know about 'sed -i', makes this a lot easier +* When echoing the current list of paths, do not include the 'import' lines +* Test for existance of path file was broken, used the wrong test +* New -d option to 'add2virtualenv' which allows removal of a path previously added +* Make sure that paths added via 'add2virtualenv' always end up being listed \*before\* regularily installed packages in sys.path. This ensures that you can always use the command to replace an installed package with a out-of-virtualenv version +* Added tag 1.24.2 for changeset f31869779141 + +1.24.2 +------ + +* update history and bump version +* update history +* add user-provided tips to the docs +* switch doc theme for packaged docs; add link to Rich Leland's screencast +* Added tag 1.24.1 for changeset 4a8870326d84 + +1.24.1 +------ + +* bump version num before new release +* add license and home page info to top of script +* Added tag 1.24 for changeset b243d023094b + +1.24 +---- + +* bump version and update history +* fix preactivate scripts; warn for existing scripts that need to be executable but are not +* Added tag 1.23 for changeset e55e8a54de7b + +1.23 +---- + +* prep for release +* test both mkvirtualenv hooks +* fix the postmkvirtualenv hook +* Added tag 1.22 for changeset c50385e9c99b + +1.22 +---- + +* bump version +* Added tag 1.22 for changeset eddb2921783c +* automatically create hook scripts +* add mode specification for emacs +* update README instructions +* Added tag 1.21 for changeset 2190584becc7 + +1.21 +---- + +* update version for new release +* Added tag 1.21 for changeset c11ee7913230 +* verify that virtualenv is installed; correct use of python to fix the WORKON\_HOME value; more tests +* improve handling for missing WORKON\_HOME variable or directory; add test for #18 - can't reproduce +* Added tag 1.20 for changeset ed873ac408ff + +1.20 +---- + +* prepare release +* minor code cleanup +* added simple lssitepackages test +* lssitepackages now also shows contents of virtualenv\_path\_extensions.pth, if that file exists +* added a white-line at the end +* added lssitepackages info +* added lssitepackages command +* moved main website source files +* Added tag 1.19 for changeset 8af191bfa3c8 + +1.19 +---- + +* fix for ticket #14: relative paths don't work with add2virtualenv +* incorporate patch from Sascha Brossmann to fix #15 +* Applying my own ridiculous formatting to the README file. Give me 72 characters or give me death! +* Added tag 1.18 for changeset 24190e878fa8 + +1.18 +---- + +* bump version number +* don't forget the destdir info +* add basic developer info to the documentation +* add docs for deactivate to resolve issue #12 +* fix issue #10 by removing warning and using an error at runtime +* Added tag 1.17.1 for changeset 10fbaab7da41 + +1.17.1 +------ + +* update pavement to use sphinxcontrib.paverutils +* Added tag 1.17 for changeset 749030a692a0 + +1.17 +---- + +* add installation test task +* incorporate personal site templates into a build that lets me generate hosted docs +* formatting tweaks +* add feature list; clean up hook list; fix bug in warning message generation +* cannot run package from command line, so just warn on import +* create a simple python package and include the documentation in it so it is installed by default +* clean up and update docs, reduce size of readme, start working on packaging changes +* import documentation contribution from Steve Steiner +* run the tests under zsh as well as explicitly invoking bash +* Added tag 1.16 for changeset 7d9dbc84f25d + +1.16 +---- + +* bump version +* remove todo list +* Redirect all error messages from stdout to stderr Added directory completion for cdvirtualenv +* Allow cdvirtualenv to take an argument which is a directory under the virtualenv root to change into +* Added tag 1.15 for changeset bddfac3c8fde + +1.15 +---- + +* prep release 1.15 +* error handling in mkvirtualenv +* add tests to sdist package +* Added tag 1.14 for changeset 6e54ea32a9d1 + +1.14 +---- + +* use dist\_dir option for sdist command +* Added tag 1.14 for changeset caf3f2a31fdd +* update version # +* Added tag 1.14 for changeset e31542a0d946 +* update change list +* fix virtualenvwrapper\_show\_workon\_options to use find again +* rewrite tests using shutil2 +* experimental version of deactivate wrapper +* Added tag 1.13 for changeset 7c40caf6ce6f + +1.13 +---- + +* add test.sh to manifest +* Added tag 1.13 for changeset 8e73805a97e1 +* fix for issue #5 +* Added tag 1.12 for changeset dda0e4d36a91 + +1.12 +---- + +* fix verification in navigation functions and add tests +* Add a couple of quick-navigation helper functions +* add attribution +* check return code from virtualenvwrapper\_verify\_workon\_home everywhere and return an error code if validation fails +* Update quick setup instructions to make them a little easier to follow and to fix a mistake in the order of some of the steps +* Added tag 1.11 for changeset 511994f15d58 + +1.11 +---- + +* run global postactivatehook before local; move release not to the correct version +* merge ChrisHas35's postactivatehook changes +* start 1.11 with optimization suggestion from ChrisHas35 +* Added tag 1.10 for changeset 274d4576d606 +* add global postactivate hook. related to #3 +* remove unnecssary egrep calls on show\_workon\_options. fixes #4 + +1.10 +---- + +* update change history +* Updated 'workon' to use find, to avoid problems with colorized 'ls' output +* Added tag 1.9 for changeset d8112e52eadc + +1.9 +--- + +* add more hooks based on suggestion from Chris Hasenpflug; add documentation +* Added tag 1.8.1 for changeset 8417344df8ff + +1.8.1 +----- + +* bump version number +* Added tag 1.8.1 for changeset dca76424222e +* fix argument processing in mkvirtualenv +* Added tag 1.8 for changeset ea5f27af83bb + +1.8 +--- + +* Fix for processing the argument list in mkvirtualenv from jorgevargas (#1) +* Added tag 1.7 for changeset 32f2a081d649 + +1.7 +--- + +* Clean up TODO list and svn keywords. Add license section to README +* Added tag 1.7 for changeset 54aa96a1c09f +* Ignore files generated by paver and the build process. Use a fixed version string in the pavement.py file +* update tags +* convert from make to paver 1.0 +* patches to rmvirtualenv to make it work with zsh from Byron Clark +* add note about zsh completion support +* add zsh completion support, courtesy of Ted Leung +* add docs; fix space issues +* remove premature release +* add path management feature contributed by James Bennett +* fix another typo, TEST, then add another useful message when the user tries to remove an active environment +* fix spelling mistake + +1.6.1 +----- + +* bug fix from John Shimek +* Add tab completion based on Arthur Koziel's version at http://arthurkoziel.com/2008/10/11/virtualenvwrapper-bash-completion/ +* fix the download url + +1.3 +--- + +* add setup.py and related pieces, including minimal docs +* usability patches from Alex Satrapa +* notes about what I still need to do +* cleanup +* predeactivate and postactivate hooks +* go ahead and change to the environment after creating it +* look for the workdir script and run it if we find it +* update comments +* add attribution +* keywords + +1.0 +--- + +* first copy +* start new project From 2fe0f73690e6f8f9a91b98e5f9aad6acdfb7b617 Mon Sep 17 00:00:00 2001 From: Doug Hellmann Date: Sat, 11 Feb 2023 11:17:06 -0500 Subject: [PATCH 59/95] pkglint: check both package formats --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index 48b11a7..ab01679 100644 --- a/tox.ini +++ b/tox.ini @@ -44,5 +44,5 @@ deps= check-python-versions commands= python -m build - twine check dist/*.tar.gz + twine check dist/*.tar.gz dist/*.whl check-python-versions --only pyproject.toml,.github/workflows/test.yml From f0b245f72705e3940bb66f432d3a0b6304c2cbce Mon Sep 17 00:00:00 2001 From: Doug Hellmann Date: Sat, 11 Feb 2023 13:46:08 -0500 Subject: [PATCH 60/95] docs: update requirements for build on rtd - Add importlib_metadata dependency for older python versions, which seems to be what is used on RTD. - Split the docs job out of the other style jobs and pin the version of Python to force the use of the separate library in CI builds of docs. - Update the mergify rules accordingly. --- .github/workflows/test.yml | 27 +++++++++++++++++++++++++++ .mergify.yml | 2 +- docs/requirements.txt | 2 ++ 3 files changed, 30 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3d39c3c..a075696 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -121,3 +121,30 @@ jobs: - name: Run run: tox -e ${{ matrix.tox-environment }} + + # Test build the docs + docs: + runs-on: ubuntu-latest + if: ${{ !startsWith(github.ref, 'refs/tags') }} + + strategy: + fail-fast: false + + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + # Pin this low because RTD doesn't seem to adopt new + # versions quickly and this ensures we don't have a + # dependency problem with importlib.metadata. + python-version: "3.9" + + - name: Install dependencies + run: python -m pip install tox + + - name: Run + run: tox -e docs diff --git a/.mergify.yml b/.mergify.yml index 6b41ced..ad3cb2c 100644 --- a/.mergify.yml +++ b/.mergify.yml @@ -54,7 +54,7 @@ pull_request_rules: - name: Automatic merge on approval conditions: - and: - - "check-success=style (docs)" + - "check-success=docs" - "check-success=style (style)" - "check-success=style (pkglint)" - "check-success=Test macOS (3.8)" diff --git a/docs/requirements.txt b/docs/requirements.txt index 0fca33e..1729741 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,3 +1,5 @@ # sphinxcontrib-bitbucket # sphinx>=1.1.2,!=1.2.0,!=1.3b1,<1.3 sphinx +# We need importlib.metadata, which was added in 3.10. +importlib_metadata;python_version<'3.10' From 5e0d73a324ffda0e75e9a963989ebb68153fdecb Mon Sep 17 00:00:00 2001 From: Doug Hellmann Date: Sat, 11 Feb 2023 14:42:05 -0500 Subject: [PATCH 61/95] pin python version in doc build test RTD uses python 3.7 --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a075696..438c5d5 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -141,7 +141,7 @@ jobs: # Pin this low because RTD doesn't seem to adopt new # versions quickly and this ensures we don't have a # dependency problem with importlib.metadata. - python-version: "3.9" + python-version: "3.7" - name: Install dependencies run: python -m pip install tox From dbd54a45a7f76fc80df1a3df4af9e663a57aaa34 Mon Sep 17 00:00:00 2001 From: Doug Hellmann Date: Sat, 11 Feb 2023 14:44:57 -0500 Subject: [PATCH 62/95] restore python 3.7 support This needs to be enabled for the package lint job to pass. The 3.7 jobs do not have to pass for Mergify to accept the PR. --- .github/workflows/test.yml | 1 + pyproject.toml | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 438c5d5..4de60e7 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -16,6 +16,7 @@ jobs: fail-fast: false matrix: python-version: + - 3.7 - 3.8 - 3.9 - "3.10" diff --git a/pyproject.toml b/pyproject.toml index 2233798..716d3e7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -13,6 +13,7 @@ classifiers = [ "License :: OSI Approved :: MIT License", "Programming Language :: Python", "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", @@ -27,7 +28,7 @@ dynamic = ["version"] keywords = ["virtualenv"] license = {text = "MIT"} readme = "README.txt" -requires-python = ">=3.8" +requires-python = ">=3.7" dependencies = [ "virtualenv", From 6be4cdac72f136d9a5a928cbd58c2cbc9b634475 Mon Sep 17 00:00:00 2001 From: Doug Hellmann Date: Sat, 11 Feb 2023 15:08:54 -0500 Subject: [PATCH 63/95] add virtualenvwrapper.version module Have setuptools_scm write a module with the package version so we don't need to use importlib.metadata to look up the value at runtime. This makes version handling more portable across versions of Python. --- .gitignore | 1 + docs/requirements.txt | 2 -- docs/source/conf.py | 5 +++-- pyproject.toml | 1 + tests/test_virtualenvwrapper.sh | 4 ++-- virtualenvwrapper/hook_loader.py | 8 ++++---- 6 files changed, 11 insertions(+), 10 deletions(-) diff --git a/.gitignore b/.gitignore index 606759f..df625c4 100644 --- a/.gitignore +++ b/.gitignore @@ -36,3 +36,4 @@ syntax: re ^web/ .python-version .eggs +/virtualenvwrapper/version.py diff --git a/docs/requirements.txt b/docs/requirements.txt index 1729741..0fca33e 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,5 +1,3 @@ # sphinxcontrib-bitbucket # sphinx>=1.1.2,!=1.2.0,!=1.3b1,<1.3 sphinx -# We need importlib.metadata, which was added in 3.10. -importlib_metadata;python_version<'3.10' diff --git a/docs/source/conf.py b/docs/source/conf.py index ab23616..6d46571 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -13,7 +13,8 @@ # serve to show the default. import datetime -import importlib.metadata + +import virtualenvwrapper.version # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the @@ -51,7 +52,7 @@ # built documents. # # The short X.Y version. -version = importlib.metadata.version('virtualenvwrapper') +version = virtualenvwrapper.version.version # The full version, including alpha/beta/rc tags. release = version diff --git a/pyproject.toml b/pyproject.toml index 716d3e7..1d1176a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -38,6 +38,7 @@ dependencies = [ # https://github.com/pypa/setuptools_scm/ [tool.setuptools_scm] +write_to = "virtualenvwrapper/version.py" [project.urls] homepage = "https://virtualenvwrapper.readthedocs.io/" diff --git a/tests/test_virtualenvwrapper.sh b/tests/test_virtualenvwrapper.sh index 15556ec..fe9e689 100755 --- a/tests/test_virtualenvwrapper.sh +++ b/tests/test_virtualenvwrapper.sh @@ -27,13 +27,13 @@ test_virtualenvwrapper_script_set() { } test_virtualenvwrapper_version() { - source "$test_dir/../virtualenvwrapper.sh" + load_wrappers typeset ver=$(_virtualenvwrapper_version) assertTrue "version is empty" "[ -n $ver ]" } test_virtualenvwrapper_help_shows_version() { - source "$test_dir/../virtualenvwrapper.sh" + load_wrappers typeset pattern="Version: $(_virtualenvwrapper_version)" assertTrue "version not in command output" "virtualenvwrapper | grep \"$pattern\"" } diff --git a/virtualenvwrapper/hook_loader.py b/virtualenvwrapper/hook_loader.py index 6e95e44..449e651 100644 --- a/virtualenvwrapper/hook_loader.py +++ b/virtualenvwrapper/hook_loader.py @@ -13,8 +13,9 @@ import os import sys -from stevedore import ExtensionManager -from stevedore import NamedExtensionManager +from stevedore import ExtensionManager, NamedExtensionManager + +import virtualenvwrapper.version LOG_FORMAT = '%(asctime)s %(levelname)s %(name)s %(message)s' @@ -89,8 +90,7 @@ def main(): options, args = parser.parse_args() if options.version: - import importlib.metadata - print(importlib.metadata.version('virtualenvwrapper')) + print(virtualenvwrapper.version.version) return 0 root_logger = logging.getLogger('virtualenvwrapper') From 8fc971c63078e6e7a2b4bc7b75cdefb04342637a Mon Sep 17 00:00:00 2001 From: Doug Hellmann Date: Sat, 11 Feb 2023 15:42:14 -0500 Subject: [PATCH 64/95] doc build take version from git when package not installed --- docs/source/conf.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/docs/source/conf.py b/docs/source/conf.py index 6d46571..3d8530e 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -14,7 +14,15 @@ import datetime -import virtualenvwrapper.version +# Try to import the version from our package, but if that fails +# because of the way the RTD build works fall back to at least using +# the git tag information. +try: + from virtualenvwrapper.version import version +except ImportError: + import subprocess + p = subprocess.run(['git', 'describe'], stdout=subprocess.PIPE) + version = p.stdout.decode('utf-8').strip() # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the @@ -52,7 +60,7 @@ # built documents. # # The short X.Y version. -version = virtualenvwrapper.version.version +# version = "SEE IMPORTS ABOVE" # The full version, including alpha/beta/rc tags. release = version From 72acd99b15b25bfc25af7eff9d92cbc16e5a26cf Mon Sep 17 00:00:00 2001 From: Doug Hellmann Date: Sun, 12 Feb 2023 09:39:12 -0500 Subject: [PATCH 65/95] docs: add read the docs configuration file Details from https://docs.readthedocs.io/en/stable/tutorial/index.html and https://mastodon.social/@hynek/109849829588314515 Addresses #49 --- .readthedocs.yaml | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 .readthedocs.yaml diff --git a/.readthedocs.yaml b/.readthedocs.yaml new file mode 100644 index 0000000..67875cf --- /dev/null +++ b/.readthedocs.yaml @@ -0,0 +1,12 @@ +version: 2 + +build: + os: "ubuntu-20.04" + tools: + python: "3.11" + +python: + # Install our python package before building the docs + install: + - method: pip + path: . From d896fb033447a845b2a764692a9752a316dbab4d Mon Sep 17 00:00:00 2001 From: Doug Hellmann Date: Sun, 12 Feb 2023 09:43:58 -0500 Subject: [PATCH 66/95] Revert "doc build take version from git when package not installed" This reverts commit 8fc971c63078e6e7a2b4bc7b75cdefb04342637a. We should not need this now that the rtd.org build is installing our package via pip. --- docs/source/conf.py | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/docs/source/conf.py b/docs/source/conf.py index 3d8530e..6d46571 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -14,15 +14,7 @@ import datetime -# Try to import the version from our package, but if that fails -# because of the way the RTD build works fall back to at least using -# the git tag information. -try: - from virtualenvwrapper.version import version -except ImportError: - import subprocess - p = subprocess.run(['git', 'describe'], stdout=subprocess.PIPE) - version = p.stdout.decode('utf-8').strip() +import virtualenvwrapper.version # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the @@ -60,7 +52,7 @@ # built documents. # # The short X.Y version. -# version = "SEE IMPORTS ABOVE" +version = virtualenvwrapper.version.version # The full version, including alpha/beta/rc tags. release = version From 5e330f400f1bc89b5f2ce63462e5bb3710f548cf Mon Sep 17 00:00:00 2001 From: Doug Hellmann Date: Sun, 12 Feb 2023 09:44:22 -0500 Subject: [PATCH 67/95] Revert "restore python 3.7 support" This reverts commit dbd54a45a7f76fc80df1a3df4af9e663a57aaa34. We no longer need this now that rtd.org is using 3.11. --- .github/workflows/test.yml | 1 - pyproject.toml | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4de60e7..438c5d5 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -16,7 +16,6 @@ jobs: fail-fast: false matrix: python-version: - - 3.7 - 3.8 - 3.9 - "3.10" diff --git a/pyproject.toml b/pyproject.toml index 1d1176a..0c88714 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -13,7 +13,6 @@ classifiers = [ "License :: OSI Approved :: MIT License", "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", @@ -28,7 +27,7 @@ dynamic = ["version"] keywords = ["virtualenv"] license = {text = "MIT"} readme = "README.txt" -requires-python = ">=3.7" +requires-python = ">=3.8" dependencies = [ "virtualenv", From 2f90581295b625c18d8b8d740c6db53581a17a8c Mon Sep 17 00:00:00 2001 From: Doug Hellmann Date: Sun, 12 Feb 2023 09:44:31 -0500 Subject: [PATCH 68/95] Revert "pin python version in doc build test" This reverts commit 5e0d73a324ffda0e75e9a963989ebb68153fdecb. --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 438c5d5..a075696 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -141,7 +141,7 @@ jobs: # Pin this low because RTD doesn't seem to adopt new # versions quickly and this ensures we don't have a # dependency problem with importlib.metadata. - python-version: "3.7" + python-version: "3.9" - name: Install dependencies run: python -m pip install tox From 1b86035e64dc0058d812abd74a74b5d1b81456e8 Mon Sep 17 00:00:00 2001 From: Doug Hellmann Date: Sun, 12 Feb 2023 09:45:28 -0500 Subject: [PATCH 69/95] docs: github action to test build should use same version rtd.org --- .github/workflows/test.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a075696..f90f4ed 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -138,10 +138,8 @@ jobs: - name: Set up Python uses: actions/setup-python@v4 with: - # Pin this low because RTD doesn't seem to adopt new - # versions quickly and this ensures we don't have a - # dependency problem with importlib.metadata. - python-version: "3.9" + # Pin this to the same version used on in .readthedocs.yaml + python-version: "3.11" - name: Install dependencies run: python -m pip install tox From 11c201ec9c08b5383f35fedeefa58a7c06a23583 Mon Sep 17 00:00:00 2001 From: Doug Hellmann Date: Sun, 12 Feb 2023 09:49:57 -0500 Subject: [PATCH 70/95] mergify: update documentation label rule to include rtd config file --- .mergify.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.mergify.yml b/.mergify.yml index ad3cb2c..c92fa0a 100644 --- a/.mergify.yml +++ b/.mergify.yml @@ -28,6 +28,7 @@ pull_request_rules: - "title~=^docs:" - "files~=docs" - "files~=.rst$" + - "files~=.readthedocs.yaml$" actions: label: add: From 78c0a298dc26453cf9eaef9096f119178d58b5bf Mon Sep 17 00:00:00 2001 From: Doug Hellmann Date: Sat, 18 Feb 2023 13:58:58 -0500 Subject: [PATCH 71/95] add dependabot config Add configuration to look for updates to github actions. --- .github/dependabot.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..7a1392c --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,13 @@ +# Via https://github.com/nedbat/scriv/blob/main/.github/dependabot.yml +# +# From: +# https://docs.github.com/en/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/keeping-your-actions-up-to-date-with-dependabot +# Set update schedule for GitHub Actions + +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + # Check for updates to GitHub Actions once a week + interval: "weekly" From 99170ad99ac12db41c2c4929c83f460886df1140 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 Mar 2023 20:07:37 +0000 Subject: [PATCH 72/95] Bump pypa/gh-action-pypi-publish from 1.6.4 to 1.7.1 Bumps [pypa/gh-action-pypi-publish](https://github.com/pypa/gh-action-pypi-publish) from 1.6.4 to 1.7.1. - [Release notes](https://github.com/pypa/gh-action-pypi-publish/releases) - [Commits](https://github.com/pypa/gh-action-pypi-publish/compare/v1.6.4...v1.7.1) --- updated-dependencies: - dependency-name: pypa/gh-action-pypi-publish dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- .github/workflows/python-publish.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-publish.yaml b/.github/workflows/python-publish.yaml index 75a668f..d80c901 100644 --- a/.github/workflows/python-publish.yaml +++ b/.github/workflows/python-publish.yaml @@ -32,7 +32,7 @@ jobs: # This condition prevents PRs from being published as part of # the test job. if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') - uses: pypa/gh-action-pypi-publish@v1.6.4 + uses: pypa/gh-action-pypi-publish@v1.7.1 with: password: ${{ secrets.PYPI_API_TOKEN }} verbose: true From 4cef53df5ea707403e72739f44d540a1898bf90b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 20:04:27 +0000 Subject: [PATCH 73/95] Bump pypa/gh-action-pypi-publish from 1.7.1 to 1.8.3 Bumps [pypa/gh-action-pypi-publish](https://github.com/pypa/gh-action-pypi-publish) from 1.7.1 to 1.8.3. - [Release notes](https://github.com/pypa/gh-action-pypi-publish/releases) - [Commits](https://github.com/pypa/gh-action-pypi-publish/compare/v1.7.1...v1.8.3) --- updated-dependencies: - dependency-name: pypa/gh-action-pypi-publish dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- .github/workflows/python-publish.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-publish.yaml b/.github/workflows/python-publish.yaml index d80c901..daa6376 100644 --- a/.github/workflows/python-publish.yaml +++ b/.github/workflows/python-publish.yaml @@ -32,7 +32,7 @@ jobs: # This condition prevents PRs from being published as part of # the test job. if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') - uses: pypa/gh-action-pypi-publish@v1.7.1 + uses: pypa/gh-action-pypi-publish@v1.8.3 with: password: ${{ secrets.PYPI_API_TOKEN }} verbose: true From d7b88d65db6a50ef36f23e324d234a8fad65b512 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 3 Apr 2023 20:02:19 +0000 Subject: [PATCH 74/95] Bump pypa/gh-action-pypi-publish from 1.8.3 to 1.8.5 Bumps [pypa/gh-action-pypi-publish](https://github.com/pypa/gh-action-pypi-publish) from 1.8.3 to 1.8.5. - [Release notes](https://github.com/pypa/gh-action-pypi-publish/releases) - [Commits](https://github.com/pypa/gh-action-pypi-publish/compare/v1.8.3...v1.8.5) --- updated-dependencies: - dependency-name: pypa/gh-action-pypi-publish dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- .github/workflows/python-publish.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-publish.yaml b/.github/workflows/python-publish.yaml index daa6376..232ae8b 100644 --- a/.github/workflows/python-publish.yaml +++ b/.github/workflows/python-publish.yaml @@ -32,7 +32,7 @@ jobs: # This condition prevents PRs from being published as part of # the test job. if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') - uses: pypa/gh-action-pypi-publish@v1.8.3 + uses: pypa/gh-action-pypi-publish@v1.8.5 with: password: ${{ secrets.PYPI_API_TOKEN }} verbose: true From e33b3296545bf07242ba55781477302258b91c81 Mon Sep 17 00:00:00 2001 From: Neal Joslin Date: Thu, 13 Apr 2023 15:23:37 -0400 Subject: [PATCH 75/95] Changed workon's env switching to use OR not $? --- virtualenvwrapper.sh | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/virtualenvwrapper.sh b/virtualenvwrapper.sh index cf43626..edd9631 100644 --- a/virtualenvwrapper.sh +++ b/virtualenvwrapper.sh @@ -759,16 +759,14 @@ function workon { # before switching so we use our override function, # if it exists, but make sure it's the deactivate function # we set up - type deactivate >/dev/null 2>&1 - if [ $? -eq 0 ] - then + ! type deactivate >/dev/null 2>&1 || { typeset -f deactivate | grep 'typeset env_postdeactivate_hook' >/dev/null 2>&1 if [ $? -eq 0 ] then deactivate unset -f deactivate >/dev/null 2>&1 fi - fi + } virtualenvwrapper_run_hook "pre_activate" "$env_name" From d78588e4f50f39fbbbb3b322b47a5cbe94f59026 Mon Sep 17 00:00:00 2001 From: Evan Chong <40609285+evantkchong@users.noreply.github.com> Date: Sat, 15 Apr 2023 06:29:31 +0800 Subject: [PATCH 76/95] Update the tested Python versions to match README The following commit https://github.com/python-virtualenvwrapper/virtualenvwrapper/commit/af41484a4709503f6029830b91eb0ec0b4abb2a0 missed out on updating the tested Python versions in the documentation --- docs/source/install.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/install.rst b/docs/source/install.rst index 94de69e..7271cab 100644 --- a/docs/source/install.rst +++ b/docs/source/install.rst @@ -75,7 +75,7 @@ can download virtualenvwrapper-powershell_ from PyPI. Python Versions =============== -virtualenvwrapper is tested under Python 2.7-3.6. +virtualenvwrapper is tested under Python 3.8 - 3.11. .. _install-basic: From e36060e8348bacc6d01269b42c201beda6bb4df5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 8 May 2023 20:01:28 +0000 Subject: [PATCH 77/95] Bump pypa/gh-action-pypi-publish from 1.8.5 to 1.8.6 Bumps [pypa/gh-action-pypi-publish](https://github.com/pypa/gh-action-pypi-publish) from 1.8.5 to 1.8.6. - [Release notes](https://github.com/pypa/gh-action-pypi-publish/releases) - [Commits](https://github.com/pypa/gh-action-pypi-publish/compare/v1.8.5...v1.8.6) --- updated-dependencies: - dependency-name: pypa/gh-action-pypi-publish dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- .github/workflows/python-publish.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-publish.yaml b/.github/workflows/python-publish.yaml index 232ae8b..527d2e5 100644 --- a/.github/workflows/python-publish.yaml +++ b/.github/workflows/python-publish.yaml @@ -32,7 +32,7 @@ jobs: # This condition prevents PRs from being published as part of # the test job. if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') - uses: pypa/gh-action-pypi-publish@v1.8.5 + uses: pypa/gh-action-pypi-publish@v1.8.6 with: password: ${{ secrets.PYPI_API_TOKEN }} verbose: true From 05ccf752512c74d212f746017f240c692f848983 Mon Sep 17 00:00:00 2001 From: Alfred Wingate Date: Mon, 19 Jun 2023 07:30:22 +0300 Subject: [PATCH 78/95] remove use of distutils * Python 3.11 deprecated distutils and Python 3.12 completely removed it * Removed find_package_data entirely as there was not package data to install Signed-off-by: Alfred Wingate --- tests/testtemplate/setup.py | 103 ------------------------------------ virtualenvwrapper.sh | 2 +- 2 files changed, 1 insertion(+), 104 deletions(-) diff --git a/tests/testtemplate/setup.py b/tests/testtemplate/setup.py index f18835e..6c9b794 100644 --- a/tests/testtemplate/setup.py +++ b/tests/testtemplate/setup.py @@ -5,102 +5,6 @@ from setuptools import setup, find_packages -from distutils.util import convert_path -from fnmatch import fnmatchcase - -import os -import sys - -############################################################################## -# find_package_data is an Ian Bicking creation. - -# Provided as an attribute, so you can append to these instead -# of replicating them: -standard_exclude = ('*.py', '*.pyc', '*~', '.*', '*.bak', '*.swp*') -standard_exclude_directories = ('.*', 'CVS', '_darcs', './build', - './dist', 'EGG-INFO', '*.egg-info') - - -def find_package_data( - where='.', package='', - exclude=standard_exclude, - exclude_directories=standard_exclude_directories, - only_in_packages=True, - show_ignored=False): - """ - Return a dictionary suitable for use in ``package_data`` - in a distutils ``setup.py`` file. - - The dictionary looks like:: - - {'package': [files]} - - Where ``files`` is a list of all the files in that package that - don't match anything in ``exclude``. - - If ``only_in_packages`` is true, then top-level directories that - are not packages won't be included (but directories under packages - will). - - Directories matching any pattern in ``exclude_directories`` will - be ignored; by default directories with leading ``.``, ``CVS``, - and ``_darcs`` will be ignored. - - If ``show_ignored`` is true, then all the files that aren't - included in package data are shown on stderr (for debugging - purposes). - - Note patterns use wildcards, or can be exact paths (including - leading ``./``), and all searching is case-insensitive. - - This function is by Ian Bicking. - """ - - out = {} - stack = [(convert_path(where), '', package, only_in_packages)] - while stack: - where, prefix, package, only_in_packages = stack.pop(0) - for name in os.listdir(where): - fn = os.path.join(where, name) - if os.path.isdir(fn): - bad_name = False - for pattern in exclude_directories: - if (fnmatchcase(name, pattern) - or fn.lower() == pattern.lower()): - bad_name = True - if show_ignored: - print >> sys.stderr, ( - "Directory %s ignored by pattern %s" - % (fn, pattern)) - break - if bad_name: - continue - if os.path.isfile(os.path.join(fn, '__init__.py')): - if not package: - new_package = name - else: - new_package = package + '.' + name - stack.append((fn, '', new_package, False)) - else: - stack.append((fn, prefix + name + '/', package, only_in_packages)) - elif package or not only_in_packages: - # is a file - bad_name = False - for pattern in exclude: - if (fnmatchcase(name, pattern) - or fn.lower() == pattern.lower()): - bad_name = True - if show_ignored: - print >> sys.stderr, ( - "File %s ignored by pattern %s" - % (fn, pattern)) - break - if bad_name: - continue - out.setdefault(package, []).append(prefix+name) - return out -############################################################################## - setup( name=PROJECT, version=VERSION, @@ -130,13 +34,6 @@ def find_package_data( packages=find_packages(), include_package_data=True, - # Scan the input for package information - # to grab any data files (text, images, etc.) - # associated with sub-packages. - package_data=find_package_data('mytemplates', - package='mytemplates', - only_in_packages=False, - ), entry_points={ 'virtualenvwrapper.project.template': [ diff --git a/virtualenvwrapper.sh b/virtualenvwrapper.sh index edd9631..afa5395 100644 --- a/virtualenvwrapper.sh +++ b/virtualenvwrapper.sh @@ -820,7 +820,7 @@ function virtualenvwrapper_get_python_version { # Prints the path to the site-packages directory for the current environment. function virtualenvwrapper_get_site_packages_dir { - "$VIRTUAL_ENV/$VIRTUALENVWRAPPER_ENV_BIN_DIR/python" -c "import distutils.sysconfig; print(distutils.sysconfig.get_python_lib())" + "$VIRTUAL_ENV/$VIRTUALENVWRAPPER_ENV_BIN_DIR/python" -c "import sysconfig; print(sysconfig.get_path('platlib'))" } # Path management for packages outside of the virtual env. From da927a0d64e039db1bab04f65563db94a7d07fb2 Mon Sep 17 00:00:00 2001 From: Alfred Wingate Date: Mon, 19 Jun 2023 07:34:57 +0300 Subject: [PATCH 79/95] install setuptools for test packages, use pip * setuptools isn't included in ensurepip in Python 3.12 * Use pip install instead of invoking setup.py directly, due to setuptools discouraging it and allowing updates for the tests packages to use PEP517 compliant build system to done seamlessly. Also don't need to invoke pip install -r requirements.txt. * editable_mode=compat is comparable to python setup.py develop. But setuptools doesn't guarantee the longevity of the feature. Removal of support for the legacy method would be a thing consider. Signed-off-by: Alfred Wingate --- tests/test_cp.sh | 2 +- tests/test_project_templates.sh | 2 +- tests/test_wipeenv.sh | 4 ++-- tests/testpackage/requirements.txt | 1 + tests/testtemplate/requirements.txt | 1 + 5 files changed, 6 insertions(+), 4 deletions(-) create mode 100644 tests/testpackage/requirements.txt create mode 100644 tests/testtemplate/requirements.txt diff --git a/tests/test_cp.sh b/tests/test_cp.sh index b1b9b3d..cadd5ea 100755 --- a/tests/test_cp.sh +++ b/tests/test_cp.sh @@ -23,7 +23,7 @@ test_new_env_activated () { mkvirtualenv "source" >/dev/null 2>&1 RC=$? assertEquals "0" "$RC" - (cd tests/testpackage && python setup.py install) >/dev/null 2>&1 + (cd tests/testpackage && pip install .) >/dev/null 2>&1 cpvirtualenv "source" "destination" >/dev/null 2>&1 rmvirtualenv "source" >/dev/null 2>&1 testscript="$(which testscript.py)" diff --git a/tests/test_project_templates.sh b/tests/test_project_templates.sh index 5329cf6..32c7fcf 100755 --- a/tests/test_project_templates.sh +++ b/tests/test_project_templates.sh @@ -4,7 +4,7 @@ test_dir=$(dirname $0) source "$test_dir/setup.sh" oneTimeSetUp() { - (cd "$test_dir/testtemplate" && rm -rf build && "$VIRTUAL_ENV/bin/python" setup.py install) + (cd "$test_dir/testtemplate" && rm -rf build && "$VIRTUAL_ENV/bin/python" -m pip install .) rm -rf "$WORKON_HOME" mkdir -p "$WORKON_HOME" rm -rf "$PROJECT_HOME" diff --git a/tests/test_wipeenv.sh b/tests/test_wipeenv.sh index 3eb7b71..f731580 100755 --- a/tests/test_wipeenv.sh +++ b/tests/test_wipeenv.sh @@ -20,7 +20,7 @@ tearDown() { test_wipeenv () { mkvirtualenv "wipetest" >/dev/null 2>&1 - (cd tests/testpackage && python setup.py install) >/dev/null 2>&1 + (cd tests/testpackage && pip install .) >/dev/null 2>&1 before="$(pip freeze)" assertTrue "testpackage not installed" "pip freeze | grep testpackage" wipeenv >/dev/null 2>&1 @@ -52,7 +52,7 @@ test_wipeenv_pip_e () { test_wipeenv_develop () { mkvirtualenv "wipetest" >/dev/null 2>&1 - (cd tests/testpackage && python setup.py develop) >/dev/null 2>&1 + (cd tests/testpackage && pip install -e . --config-settings editable_mode=compat) >/dev/null 2>&1 before="$(pip freeze)" assertTrue "testpackage not installed" "pip freeze | grep testpackage" wipeenv >/dev/null 2>&1 diff --git a/tests/testpackage/requirements.txt b/tests/testpackage/requirements.txt new file mode 100644 index 0000000..49fe098 --- /dev/null +++ b/tests/testpackage/requirements.txt @@ -0,0 +1 @@ +setuptools diff --git a/tests/testtemplate/requirements.txt b/tests/testtemplate/requirements.txt new file mode 100644 index 0000000..49fe098 --- /dev/null +++ b/tests/testtemplate/requirements.txt @@ -0,0 +1 @@ +setuptools From 73e6f60297fbdcc547c63f438556a205dc145e16 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 4 Sep 2023 19:06:31 +0000 Subject: [PATCH 80/95] Bump actions/checkout from 3 to 4 Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/python-publish.yaml | 2 +- .github/workflows/test.yml | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/python-publish.yaml b/.github/workflows/python-publish.yaml index 527d2e5..e3fa676 100644 --- a/.github/workflows/python-publish.yaml +++ b/.github/workflows/python-publish.yaml @@ -14,7 +14,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 - name: Set up Python diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f90f4ed..7d73553 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -22,7 +22,7 @@ jobs: - "3.11" steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 @@ -47,7 +47,7 @@ jobs: fail-fast: false steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 @@ -78,7 +78,7 @@ jobs: - "3.11" steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 @@ -107,7 +107,7 @@ jobs: - pkglint steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 @@ -131,7 +131,7 @@ jobs: fail-fast: false steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 From 8a1a6a50b7c5e31b41684febbafeb6431d25a48f Mon Sep 17 00:00:00 2001 From: Carlton Gibson Date: Thu, 7 Dec 2023 14:20:55 +0100 Subject: [PATCH 81/95] Fixed broken link in install docs. With setup.py usage deprecated in Python 3.12, the install guide was removed from the docs. Pin link to 3.11 version, pending a fuller modernization. --- docs/source/install.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/install.rst b/docs/source/install.rst index 7271cab..c7429dd 100644 --- a/docs/source/install.rst +++ b/docs/source/install.rst @@ -103,7 +103,7 @@ or:: An alternative to installing it into the global site-packages is to add it to `your user local directory -`__ +`__ (usually `~/.local`). :: From b8483762736bd3dc9c44a4a031bcde56a99a3452 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 4 Dec 2023 19:12:04 +0000 Subject: [PATCH 82/95] Bump pypa/gh-action-pypi-publish from 1.8.6 to 1.8.11 Bumps [pypa/gh-action-pypi-publish](https://github.com/pypa/gh-action-pypi-publish) from 1.8.6 to 1.8.11. - [Release notes](https://github.com/pypa/gh-action-pypi-publish/releases) - [Commits](https://github.com/pypa/gh-action-pypi-publish/compare/v1.8.6...v1.8.11) --- updated-dependencies: - dependency-name: pypa/gh-action-pypi-publish dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- .github/workflows/python-publish.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-publish.yaml b/.github/workflows/python-publish.yaml index e3fa676..9f54c9e 100644 --- a/.github/workflows/python-publish.yaml +++ b/.github/workflows/python-publish.yaml @@ -32,7 +32,7 @@ jobs: # This condition prevents PRs from being published as part of # the test job. if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') - uses: pypa/gh-action-pypi-publish@v1.8.6 + uses: pypa/gh-action-pypi-publish@v1.8.11 with: password: ${{ secrets.PYPI_API_TOKEN }} verbose: true From 1f329ee422e22f3b72d1173b13058d5cc83f3a76 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 11 Dec 2023 19:16:06 +0000 Subject: [PATCH 83/95] Bump actions/setup-python from 4 to 5 Bumps [actions/setup-python](https://github.com/actions/setup-python) from 4 to 5. - [Release notes](https://github.com/actions/setup-python/releases) - [Commits](https://github.com/actions/setup-python/compare/v4...v5) --- updated-dependencies: - dependency-name: actions/setup-python dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/python-publish.yaml | 2 +- .github/workflows/test.yml | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/python-publish.yaml b/.github/workflows/python-publish.yaml index 9f54c9e..3a33b00 100644 --- a/.github/workflows/python-publish.yaml +++ b/.github/workflows/python-publish.yaml @@ -18,7 +18,7 @@ jobs: with: fetch-depth: 0 - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: '3.x' - name: Install dependencies diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7d73553..aa74fe7 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -27,7 +27,7 @@ jobs: fetch-depth: 0 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} @@ -52,7 +52,7 @@ jobs: fetch-depth: 0 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: "3.11" @@ -83,7 +83,7 @@ jobs: fetch-depth: 0 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} @@ -112,7 +112,7 @@ jobs: fetch-depth: 0 - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: "3.11" @@ -136,7 +136,7 @@ jobs: fetch-depth: 0 - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: # Pin this to the same version used on in .readthedocs.yaml python-version: "3.11" From 8012c54eba7498a6dffa3d654ff7635af39b2f83 Mon Sep 17 00:00:00 2001 From: bendikro Date: Wed, 1 Nov 2023 15:53:08 +0100 Subject: [PATCH 84/95] Fix shell completion on FreeBSD sed on FreeBSD does not support '\s', and gives the error: "sed: 1: "/^\s*$/d": RE error: trailing backslash (\)" Fix by using POSIX bracket expression '[[:space:]]' --- virtualenvwrapper.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/virtualenvwrapper.sh b/virtualenvwrapper.sh index afa5395..66f0f07 100644 --- a/virtualenvwrapper.sh +++ b/virtualenvwrapper.sh @@ -586,7 +586,7 @@ function virtualenvwrapper_show_workon_options { | command \tr "\n" " " \ | command \sed "s|/$VIRTUALENVWRAPPER_ENV_BIN_DIR/activate |/|g" \ | command \tr "/" "\n" \ - | command \sed "/^\s*$/d" \ + | command \sed "/^[[:space:]]*$/d" \ | (unset GREP_OPTIONS; command \grep -E -v '^\*$') 2>/dev/null } From 2b731ff73f410455b5444496046526781cf515e7 Mon Sep 17 00:00:00 2001 From: Doug Hellmann Date: Thu, 21 Dec 2023 10:10:01 -0500 Subject: [PATCH 85/95] add python 3.12 to test matrix --- .github/workflows/test.yml | 1 + .mergify.yml | 1 + pyproject.toml | 1 + 3 files changed, 3 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index aa74fe7..fdf092d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -20,6 +20,7 @@ jobs: - 3.9 - "3.10" - "3.11" + - "3.12" steps: - uses: actions/checkout@v4 diff --git a/.mergify.yml b/.mergify.yml index c92fa0a..4d0825f 100644 --- a/.mergify.yml +++ b/.mergify.yml @@ -66,6 +66,7 @@ pull_request_rules: - "check-success=Test Ubuntu (3.9)" - "check-success=Test Ubuntu (3.10)" - "check-success=Test Ubuntu (3.11)" + - "check-success=Test Ubuntu (3.12)" - "check-success=Test Zsh" - "-draft" - "#approved-reviews-by>=1" diff --git a/pyproject.toml b/pyproject.toml index 0c88714..3e56976 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -17,6 +17,7 @@ classifiers = [ "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", "Intended Audience :: Developers", "Environment :: Console", ] From 15062c7fdfa07a3eb6ed2bb324c30e2e0968c4ad Mon Sep 17 00:00:00 2001 From: "Fabian P. Schmidt" Date: Sat, 4 Nov 2023 14:59:26 +0100 Subject: [PATCH 86/95] Improve error message for IOErrors --- virtualenvwrapper/hook_loader.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/virtualenvwrapper/hook_loader.py b/virtualenvwrapper/hook_loader.py index 449e651..cb2c865 100644 --- a/virtualenvwrapper/hook_loader.py +++ b/virtualenvwrapper/hook_loader.py @@ -146,14 +146,15 @@ def main(): log.debug('Saving sourcable %s hooks to %s', hook, options.script_filename) options.sourcing = True - output = open(options.script_filename, "w") try: - output.write('# %s\n' % hook) - # output.write('echo %s\n' % hook) - # output.write('set -x\n') - run_hooks(hook + '_source', options, args, output) - finally: - output.close() + with open(options.script_filename, "w") as output: + output.write('# %s\n' % hook) + # output.write('echo %s\n' % hook) + # output.write('set -x\n') + run_hooks(hook + '_source', options, args, output) + except (IOError, OSError) as e: + log.error('Error while writing to %s: \n %s', options.script_filename, e) + sys.exit(1) return 0 From 389610ec663399c084bf1c4f859f239234dbce6f Mon Sep 17 00:00:00 2001 From: Doug Hellmann Date: Thu, 21 Dec 2023 10:29:39 -0500 Subject: [PATCH 87/95] fix linter issue --- virtualenvwrapper/hook_loader.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/virtualenvwrapper/hook_loader.py b/virtualenvwrapper/hook_loader.py index cb2c865..7fd5177 100644 --- a/virtualenvwrapper/hook_loader.py +++ b/virtualenvwrapper/hook_loader.py @@ -153,7 +153,8 @@ def main(): # output.write('set -x\n') run_hooks(hook + '_source', options, args, output) except (IOError, OSError) as e: - log.error('Error while writing to %s: \n %s', options.script_filename, e) + log.error('Error while writing to %s: \n %s', + options.script_filename, e) sys.exit(1) return 0 From d4e8f4b54b73e946ebd6272bb205c2664f575be7 Mon Sep 17 00:00:00 2001 From: Doug Hellmann Date: Thu, 21 Dec 2023 10:33:51 -0500 Subject: [PATCH 88/95] auto-approve PRs by main contributors --- .mergify.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.mergify.yml b/.mergify.yml index 4d0825f..a11448d 100644 --- a/.mergify.yml +++ b/.mergify.yml @@ -69,7 +69,10 @@ pull_request_rules: - "check-success=Test Ubuntu (3.12)" - "check-success=Test Zsh" - "-draft" - - "#approved-reviews-by>=1" + - or: + - "#approved-reviews-by>=1" + - "author=dhellmann" + - "author=jasonamyers" actions: merge: method: merge From dde918adec9816b8431a99680d589e1a152e433b Mon Sep 17 00:00:00 2001 From: Doug Hellmann Date: Thu, 21 Dec 2023 10:34:02 -0500 Subject: [PATCH 89/95] auto-approve PRs from dependabot --- .mergify.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.mergify.yml b/.mergify.yml index a11448d..33f6c75 100644 --- a/.mergify.yml +++ b/.mergify.yml @@ -34,6 +34,14 @@ pull_request_rules: add: - documentation + - name: automatic approval for Dependabot pull requests + conditions: + - author=dependabot[bot] + actions: + review: + type: APPROVE + message: Automatically approving dependabot + - name: Add breaking-change label # https://docs.openstack.org/pbr/latest/user/features.html conditions: From 4d514e863b258c3798a8b4af3b1a9f1db9529932 Mon Sep 17 00:00:00 2001 From: Doug Hellmann Date: Thu, 21 Dec 2023 10:53:22 -0500 Subject: [PATCH 90/95] label PRs that can be automatically merged --- .mergify.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.mergify.yml b/.mergify.yml index 33f6c75..390f4eb 100644 --- a/.mergify.yml +++ b/.mergify.yml @@ -60,6 +60,17 @@ pull_request_rules: add: - feature + - name: Add automatic-merge label + conditions: + - or: + - "author=dhellmann" + - "author=jasonamyers" + - "label!=mergify" + actions: + label: + add: + - automatic-merge + - name: Automatic merge on approval conditions: - and: From 4538ef1b7409006a0d42f5f7d389dc0863b8acc4 Mon Sep 17 00:00:00 2001 From: Doug Hellmann Date: Thu, 21 Dec 2023 11:14:49 -0500 Subject: [PATCH 91/95] move linter dependencies to pyproject.toml --- pyproject.toml | 4 ++++ tox.ini | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 3e56976..cb55989 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -36,6 +36,10 @@ dependencies = [ "stevedore", ] +[project.optional-dependencies] +linter = [ + "flake8", +] # https://github.com/pypa/setuptools_scm/ [tool.setuptools_scm] write_to = "virtualenvwrapper/version.py" diff --git a/tox.ini b/tox.ini index ab01679..8305b6a 100644 --- a/tox.ini +++ b/tox.ini @@ -20,7 +20,7 @@ setenv = FAIL_FAST = true [testenv:style] -deps = flake8 +deps = .[linter] commands = flake8 virtualenvwrapper docs/source/conf.py [testenv:zsh] From 8d01e819aa822b237f23ebbab690e7d2d304ac9e Mon Sep 17 00:00:00 2001 From: Doug Hellmann Date: Thu, 21 Dec 2023 11:15:05 -0500 Subject: [PATCH 92/95] move build dependencies to pyproject.toml --- pyproject.toml | 6 ++++++ tox.ini | 5 +---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index cb55989..9da53ba 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -40,6 +40,12 @@ dependencies = [ linter = [ "flake8", ] +build = [ + "build", + "twine", + "check-python-versions", +] + # https://github.com/pypa/setuptools_scm/ [tool.setuptools_scm] write_to = "virtualenvwrapper/version.py" diff --git a/tox.ini b/tox.ini index 8305b6a..10187c2 100644 --- a/tox.ini +++ b/tox.ini @@ -38,10 +38,7 @@ commands = sphinx-build -W -j auto -b linkcheck -d docs/build/doctrees docs/source docs/build/linkcheck [testenv:pkglint] -deps= - build - twine - check-python-versions +deps=.[build] commands= python -m build twine check dist/*.tar.gz dist/*.whl From 4052c58d66fbc3d1b757e6f80bfad29820aec32d Mon Sep 17 00:00:00 2001 From: Doug Hellmann Date: Thu, 21 Dec 2023 11:15:20 -0500 Subject: [PATCH 93/95] fix the way packages are built in the public workflow --- .github/workflows/python-publish.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python-publish.yaml b/.github/workflows/python-publish.yaml index 3a33b00..07cd061 100644 --- a/.github/workflows/python-publish.yaml +++ b/.github/workflows/python-publish.yaml @@ -24,10 +24,10 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install setuptools wheel twine pbr + pip install .[build] - name: Build sdist and wheel run: | - python setup.py sdist bdist_wheel + python -m build - name: Publish distribution to PyPI # This condition prevents PRs from being published as part of # the test job. From 0ef778b1450fd7edd44df0ba680406bf29e1bfd8 Mon Sep 17 00:00:00 2001 From: Doug Hellmann Date: Thu, 21 Dec 2023 11:19:45 -0500 Subject: [PATCH 94/95] test python 3.12 on macos --- .github/workflows/test.yml | 1 + .mergify.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index fdf092d..74b0237 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -77,6 +77,7 @@ jobs: - 3.9 - "3.10" - "3.11" + - "3.12" steps: - uses: actions/checkout@v4 diff --git a/.mergify.yml b/.mergify.yml index 390f4eb..d898af4 100644 --- a/.mergify.yml +++ b/.mergify.yml @@ -81,6 +81,7 @@ pull_request_rules: - "check-success=Test macOS (3.9)" - "check-success=Test macOS (3.10)" - "check-success=Test macOS (3.11)" + - "check-success=Test macOS (3.12)" - "check-success=Test Ubuntu (3.8)" - "check-success=Test Ubuntu (3.9)" - "check-success=Test Ubuntu (3.10)" From 9856c87aff74e6c9b6647faf2ee37f9cb2e31bef Mon Sep 17 00:00:00 2001 From: Doug Hellmann Date: Thu, 21 Dec 2023 12:10:22 -0500 Subject: [PATCH 95/95] update release notes for 6.0.0.0a5 --- docs/source/history.rst | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/docs/source/history.rst b/docs/source/history.rst index 0d46a23..9d3e0cc 100644 --- a/docs/source/history.rst +++ b/docs/source/history.rst @@ -1,11 +1,18 @@ CHANGES ======= -Unreleased ----------- +6.0.0.0a5 +--------- * add a --version option to the hook loader * modernize packaging +* docs: update requirements for build on rtd +* docs: add read the docs configuration file +* Changed workon's env switching to use OR not $? by @Nealium (pull request #59) +* Fix issues for python 3.12 by @parona-source (pull request #68) +* Fix shell completion on FreeBSD by @bendikro (pull request #86) +* add python 3.12 to test matrix +* Improve error message for IOErrors by @kerel-fs (pull request #81) 6.0.0.0a1 ---------