From a88bcec52d4313f4db8c2c6be3b49d36877e07ce Mon Sep 17 00:00:00 2001 From: Jakob Gerhard Martinussen Date: Tue, 24 Oct 2017 20:15:15 +0000 Subject: [PATCH 1/6] Fix formatting error On read the docs this is shown as one single line --- docs/source/scripts.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/source/scripts.rst b/docs/source/scripts.rst index 4363f8a..99b482e 100644 --- a/docs/source/scripts.rst +++ b/docs/source/scripts.rst @@ -29,6 +29,7 @@ If your :ref:`WORKON_HOME ` is set to ~/.virtualenvs: 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" Create a new virtualenv, and you should see DJANGO_SETTINGS_MODULE in your env! From 7d398012579e57f15f54af1e3a5591f94188659b Mon Sep 17 00:00:00 2001 From: Jakob Gerhard Martinussen Date: Tue, 24 Oct 2017 21:17:57 +0000 Subject: [PATCH 2/6] Use code blocks in order to allow easier copy-pasting Currently when you copy these code snippets, quotes are formatted wrongly, resulting in errors. --- docs/source/scripts.rst | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/docs/source/scripts.rst b/docs/source/scripts.rst index 99b482e..30f4863 100644 --- a/docs/source/scripts.rst +++ b/docs/source/scripts.rst @@ -22,14 +22,13 @@ 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" Create a new virtualenv, and you should see DJANGO_SETTINGS_MODULE in your env! From 2b9646781f57496435fb93ba57cd2e072411d1b1 Mon Sep 17 00:00:00 2001 From: Harrison Katz Date: Thu, 31 May 2018 10:23:04 -0400 Subject: [PATCH 3/6] Fix bug with workon deactivate typeset -f ; Add test_workon_deactivate_hooks --- tests/test_workon.sh | 39 ++++++++++++++++++++++++++++++++++++--- virtualenvwrapper.sh | 2 +- 2 files changed, 37 insertions(+), 4 deletions(-) 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/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 From f280f0f38fcd4cbcd38a36b94bca1e775615a4b7 Mon Sep 17 00:00:00 2001 From: Joel Cross Date: Wed, 20 Jun 2018 23:07:07 +0000 Subject: [PATCH 4/6] Allow building docs on Python 3 --- docs/source/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/conf.py b/docs/source/conf.py index f089f60..d1e81c2 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -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 From 459ce5e138af135bc6c590364ea907416dfbcee0 Mon Sep 17 00:00:00 2001 From: anatoly techtonik Date: Sun, 4 Nov 2018 14:34:37 +0000 Subject: [PATCH 5/6] Merged in techtonik/virtualenvwrapper/techtonik/toxini-edited-online-with-bitbucket-1525341850929 (pull request #69) Drop Python 2.6 support in tox * tox.ini: get dependencies from requirements.txt * Fix tox tests for Python 2.6 They fail because of missing NullHandler (#289) * Python 2.6 support is dropped https://bitbucket.org/virtualenvwrapper/virtualenvwrapper/pull-requests/69/fix-tests-with-python-26/diff#comment-63267802 * tox.ini: drop Python 2.6 support * developers.rst: update supported Python versions Approved-by: Jason Myers --- docs/source/developers.rst | 2 +- tox.ini | 18 ++---------------- 2 files changed, 3 insertions(+), 17 deletions(-) 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/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 = From c5d08eafa6f270495eeafa982323a6a982d3aa71 Mon Sep 17 00:00:00 2001 From: Jason Myers Date: Sat, 9 Feb 2019 11:05:06 -0600 Subject: [PATCH 6/6] Upgrade sphinx, fix docs Signed-off-by: Jason Myers --- README.txt | 6 +++--- docs/requirements.txt | 5 +++-- docs/source/conf.py | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) 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 d1e81c2..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/'