diff --git a/README.txt b/README.txt
index 2d386f6..63915dd 100644
--- a/README.txt
+++ b/README.txt
@@ -45,7 +45,7 @@ Installation
============
See the `project documentation
-`__ for
+`__ for
installation and setup instructions.
Supported Shells
@@ -71,7 +71,7 @@ Support
Join the `virtualenvwrapper Google Group
`__ to discuss
-issues and features.
+issues and features.
Report bugs via the `bug tracker on Bitbucket
`__.
@@ -92,7 +92,7 @@ Change Log
The `release history`_ is part of the project documentation.
-.. _release history: http://www.doughellmann.com/docs/virtualenvwrapper/history.html
+.. _release history: https://virtualenvwrapper.readthedocs.io/en/latest/history.html
=======
License
diff --git a/docs/requirements.txt b/docs/requirements.txt
index 7acfbd9..0fca33e 100644
--- a/docs/requirements.txt
+++ b/docs/requirements.txt
@@ -1,2 +1,3 @@
-sphinxcontrib-bitbucket
-sphinx>=1.1.2,!=1.2.0,!=1.3b1,<1.3
+# sphinxcontrib-bitbucket
+# sphinx>=1.1.2,!=1.2.0,!=1.3b1,<1.3
+sphinx
diff --git a/docs/source/conf.py b/docs/source/conf.py
index f089f60..1a79ec8 100644
--- a/docs/source/conf.py
+++ b/docs/source/conf.py
@@ -25,7 +25,7 @@
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
-extensions = ['sphinxcontrib.bitbucket']
+# extensions = ['sphinxcontrib.bitbucket']
bitbucket_project_url = 'https://bitbucket.org/virtualenvwrapper/virtualenvw' \
'rapper/'
@@ -54,7 +54,7 @@
version = subprocess.check_output([
'sh', '-c',
'cd ../..; python setup.py --version',
-])
+]).decode('utf-8')
version = version.strip()
# The full version, including alpha/beta/rc tags.
release = version
diff --git a/docs/source/developers.rst b/docs/source/developers.rst
index 259c0c2..83ce8e4 100644
--- a/docs/source/developers.rst
+++ b/docs/source/developers.rst
@@ -69,7 +69,7 @@ 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.4 through 2.7,
+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 individual test scripts, use a command like::
diff --git a/docs/source/scripts.rst b/docs/source/scripts.rst
index 4363f8a..30f4863 100644
--- a/docs/source/scripts.rst
+++ b/docs/source/scripts.rst
@@ -22,11 +22,11 @@ if you work on multiple projects, you want it to be specific to the project
you are currently working on. Wouldn't it be nice if it was set based on the
active virtualenv? You can achieve this with :ref:`scripts` as follows.
-If your :ref:`WORKON_HOME ` is set to ~/.virtualenvs:
+If your :ref:`WORKON_HOME ` is set to ~/.virtualenvs::
vim ~/.virtualenvs/premkvirtualenv
-Edit the file so it contains the following (for a default Django setup):
+Edit the file so it contains the following (for a default Django setup)::
# Automatically set django settings for the virtualenv
echo "export DJANGO_SETTINGS_MODULE=$1.settings" >> "$1/bin/activate"
diff --git a/tests/test_workon.sh b/tests/test_workon.sh
index 17656bb..1e3aef7 100755
--- a/tests/test_workon.sh
+++ b/tests/test_workon.sh
@@ -25,7 +25,7 @@ setUp () {
}
tearDown () {
- deactivate >/dev/null 2>&1
+ deactivate >/dev/null 2>&1
}
test_workon () {
@@ -50,7 +50,7 @@ test_workon_activate_hooks () {
touch "$TMPDIR/catch_output"
workon test1
-
+
output=$(cat "$TMPDIR/catch_output")
expected="GLOBAL preactivate
ENV preactivate
@@ -58,7 +58,7 @@ GLOBAL postactivate
ENV postactivate"
assertSame "$expected" "$output"
-
+
for t in pre post
do
rm -f "$WORKON_HOME/test1/bin/${t}activate"
@@ -66,6 +66,39 @@ ENV postactivate"
done
}
+test_workon_deactivate_hooks () {
+ for t in pre post
+ do
+ echo "#!/bin/sh" > "$WORKON_HOME/${t}deactivate"
+ echo "echo GLOBAL ${t}deactivate >> \"$TMPDIR/catch_output\"" >> "$WORKON_HOME/${t}deactivate"
+ chmod +x "$WORKON_HOME/${t}deactivate"
+
+ echo "#!/bin/sh" > "$WORKON_HOME/test2/bin/${t}deactivate"
+ echo "echo ENV ${t}deactivate >> \"$TMPDIR/catch_output\"" >> "$WORKON_HOME/test1/bin/${t}deactivate"
+ chmod +x "$WORKON_HOME/test1/bin/${t}deactivate"
+ done
+
+ rm -f "$TMPDIR/catch_output"
+ touch "$TMPDIR/catch_output"
+
+ workon test1
+ workon test2
+
+ output=$(cat "$TMPDIR/catch_output")
+ expected="ENV predeactivate
+GLOBAL predeactivate
+ENV postdeactivate
+GLOBAL postdeactivate"
+
+ assertSame "$expected" "$output"
+
+ for t in pre post
+ do
+ rm -f "$WORKON_HOME/test1/bin/${t}deactivate"
+ rm -f "$WORKON_HOME/${t}deactivate"
+ done
+}
+
test_virtualenvwrapper_show_workon_options () {
mkdir "$WORKON_HOME/not_env"
(cd "$WORKON_HOME"; ln -s test1 link_env)
diff --git a/tox.ini b/tox.ini
index 8c6ade5..ba242cc 100644
--- a/tox.ini
+++ b/tox.ini
@@ -1,12 +1,10 @@
[tox]
-envlist = py27,py26,py33,py34,py35,py36,zsh,ksh,style
+envlist = py27,py33,py34,py35,py36,zsh,ksh,style
[testenv]
install_command = pip install -U {opts} {packages}
commands = bash ./tests/run_tests {envdir} []
-deps = virtualenv
- virtualenv-clone
- stevedore
+deps = -rrequirements.txt
setenv =
TOXIC = true
SHELL = /bin/bash
@@ -19,18 +17,6 @@ whitelist_externals =
deps = flake8
commands = flake8 virtualenvwrapper docs/source/conf.py
-# Not sure why the basepython setting is needed, but on my system if
-# it isn't included then the python version picked up for 2.6 is
-# actually 2.7.
-#
-# IF THIS CAUSES YOU A PROBLEM COMMENT IT OUT BEFORE RUNNING THE TESTS.
-#
-[testenv:py26]
-basepython=python2.6
-setenv =
- SHELL = /bin/bash
-commands = bash ./tests/run_tests {envdir} []
-
[testenv:zsh]
basepython=python2.7
setenv =
diff --git a/virtualenvwrapper.sh b/virtualenvwrapper.sh
index 9c0b1ac..ade8ddd 100644
--- a/virtualenvwrapper.sh
+++ b/virtualenvwrapper.sh
@@ -755,7 +755,7 @@ function workon {
type deactivate >/dev/null 2>&1
if [ $? -eq 0 ]
then
- type deactivate | grep 'typeset env_postdeactivate_hook' >/dev/null 2>&1
+ typeset -f deactivate | grep 'typeset env_postdeactivate_hook' >/dev/null 2>&1
if [ $? -eq 0 ]
then
deactivate