Hello community,
here is the log from the commit of package python-virtualenvwrapper for
openSUSE:Factory checked in at 2013-04-02 12:53:25
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-virtualenvwrapper (Old)
and /work/SRC/openSUSE:Factory/.python-virtualenvwrapper.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-virtualenvwrapper", Maintainer is ""
Changes:
--------
---
/work/SRC/openSUSE:Factory/python-virtualenvwrapper/python-virtualenvwrapper.changes
2013-03-17 10:13:36.000000000 +0100
+++
/work/SRC/openSUSE:Factory/.python-virtualenvwrapper.new/python-virtualenvwrapper.changes
2013-04-02 12:53:27.000000000 +0200
@@ -1,0 +2,17 @@
+Sat Mar 16 18:08:16 UTC 2013 - [email protected]
+
+- Update to 3.7:
+ - Improve tab-completion support for users of the lazy-loading
+ mode. (upsuper)
+ - Add --help option to mkproject.
+ - Add --help option to workon.
+ - Turn off logging from the hook loader by default, and replace
+ VIRTUALENVWRAPPER_LOG_DIR environment variable with
+ VIRTUALENVWRAPPER_LOG_FILE. The rotating log behavior remains
+ the same. The motivation for this change is the race condition
+ caused by that rotating behavior, especially when the wrappers are
+ being used by users with different permissions and
+ umasks. (152)
+ - Use flake8 for style checking.
+
+-------------------------------------------------------------------
Old:
----
virtualenvwrapper-3.6.1.tar.bz2
New:
----
virtualenvwrapper-3.7.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-virtualenvwrapper.spec ++++++
--- /var/tmp/diff_new_pack.XDHX8P/_old 2013-04-02 12:53:29.000000000 +0200
+++ /var/tmp/diff_new_pack.XDHX8P/_new 2013-04-02 12:53:29.000000000 +0200
@@ -17,7 +17,7 @@
Name: python-virtualenvwrapper
-Version: 3.6.1
+Version: 3.7
Release: 0
Url: http://www.doughellmann.com/projects/virtualenvwrapper/
Summary: Enhancements to virtualenv
@@ -63,7 +63,6 @@
%files
%defattr(-,root,root,-)
-%doc README.txt
%{python_sitelib}/*
%{_bindir}/virtualenvwrapper.sh
%{_bindir}/virtualenvwrapper_lazy.sh
++++++ virtualenvwrapper-3.6.1.tar.bz2 -> virtualenvwrapper-3.7.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/virtualenvwrapper-3.6.1/PKG-INFO
new/virtualenvwrapper-3.7/PKG-INFO
--- old/virtualenvwrapper-3.6.1/PKG-INFO 2013-03-08 13:17:03.000000000
+0100
+++ new/virtualenvwrapper-3.7/PKG-INFO 2013-03-16 15:36:20.000000000 +0100
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: virtualenvwrapper
-Version: 3.6.1
+Version: 3.7
Summary: Enhancements to virtualenv
Home-page: http://www.doughellmann.com/projects/virtualenvwrapper/
Author: Doug Hellmann
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/virtualenvwrapper-3.6.1/README.txt
new/virtualenvwrapper-3.7/README.txt
--- old/virtualenvwrapper-3.6.1/README.txt 2012-06-10 20:26:27.000000000
+0200
+++ new/virtualenvwrapper-3.7/README.txt 1970-01-01 01:00:00.000000000
+0100
@@ -1,110 +0,0 @@
-.. -*- mode: rst -*-
-
-#################
-virtualenvwrapper
-#################
-
-virtualenvwrapper is a set of extensions to Ian Bicking's `virtualenv
-<http://pypi.python.org/pypi/virtualenv>`_ tool. The extensions include
-wrappers for creating and deleting virtual environments and otherwise
-managing your development workflow, making it easier to work on more
-than one project at a time without introducing conflicts in their
-dependencies.
-
-========
-Features
-========
-
-1. Organizes all of your virtual environments in one place.
-
-2. Wrappers for creating, copying and deleting environments, including
- user-configurable hooks.
-
-3. Use a single command to switch between environments.
-
-4. Tab completion for commands that take a virtual environment as
- argument.
-
-5. User-configurable hooks for all operations.
-
-6. Plugin system for more creating sharable extensions.
-
-Rich Leland has created a short `screencast
-<http://mathematism.com/2009/jul/30/presentation-pip-and-virtualenv/>`__
-showing off the features of virtualenvwrapper.
-
-============
-Installation
-============
-
-See the `project documentation
-<http://www.doughellmann.com/docs/virtualenvwrapper/>`__ for
-installation and setup instructions.
-
-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.
-
-Python Versions
-===============
-
-virtualenvwrapper is tested under Python 2.6, 2.7 and 3.2.
-
-=======
-Support
-=======
-
-Join the `virtualenvwrapper Google Group
-<http://groups.google.com/group/virtualenvwrapper/>`__ to discuss
-issues and features.
-
-Report bugs via the `bug tracker on BitBucket
-<http://bitbucket.org/dhellmann/virtualenvwrapper/>`__.
-
-Shell Aliases
-=============
-
-Since virtualenvwrapper is largely a shell script, it uses shell
-commands for a lot of its actions. If your environment makes heavy
-use of shell aliases or other customizations, you may encounter
-issues. Before reporting bugs in the bug tracker, please test
-*without* your aliases enabled. If you can identify the alias causing
-the problem, that will help make virtualenvwrapper more robust.
-
-==========
-Change Log
-==========
-
-The `release history`_ is part of the project documentation.
-
-.. _release history:
http://www.doughellmann.com/docs/virtualenvwrapper/history.html
-
-=======
-License
-=======
-
-Copyright Doug Hellmann, All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Doug Hellmann not be used
-in advertising or publicity pertaining to distribution of the software
-without specific, written prior permission.
-
-DOUG HELLMANN DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
-INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
-EVENT SHALL DOUG HELLMANN BE LIABLE FOR ANY SPECIAL, INDIRECT OR
-CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
-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.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/virtualenvwrapper-3.6.1/docs/source/conf.py
new/virtualenvwrapper-3.7/docs/source/conf.py
--- old/virtualenvwrapper-3.6.1/docs/source/conf.py 2012-08-18
22:58:01.000000000 +0200
+++ new/virtualenvwrapper-3.7/docs/source/conf.py 2013-03-16
15:33:58.000000000 +0100
@@ -3,7 +3,8 @@
# virtualenvwrapper documentation build configuration file, created by
# sphinx-quickstart on Thu May 28 22:35:13 2009.
#
-# This file is execfile()d with the current directory set to its containing
dir.
+# This file is execfile()d with the current directory set to its
+# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
@@ -19,10 +20,11 @@
# documentation root, use os.path.abspath to make it absolute, like shown here.
#sys.path.append(os.path.abspath('.'))
-# -- General configuration
-----------------------------------------------------
+# -- General configuration ---------------------------------------------------
-# Add any Sphinx extension module names here, as strings. They can be
extensions
-# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
+# 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']
bitbucket_project_url = 'http://bitbucket.org/dhellmann/virtualenvwrapper/'
@@ -48,7 +50,10 @@
# built documents.
#
# The short X.Y version.
-version = subprocess.check_output(['sh', '-c', 'cd ../..; python setup.py
--version'])
+version = subprocess.check_output([
+ 'sh', '-c',
+ 'cd ../..; python setup.py --version',
+])
version = version.strip()
# The full version, including alpha/beta/rc tags.
release = version
@@ -70,7 +75,8 @@
# for source files.
exclude_trees = ['_build']
-# The reST default role (used for this markup: `text`) to use for all
documents.
+# The reST default role (used for this markup: `text`) to use for all
+# documents.
#default_role = None
# If true, '()' will be appended to :func: etc. cross-reference text.
@@ -91,7 +97,7 @@
#modindex_common_prefix = []
-# -- Options for HTML output
---------------------------------------------------
+# -- Options for HTML output -------------------------------------------------
# The theme to use for HTML and HTML Help pages. Major themes that come with
# Sphinx are currently 'default' and 'sphinxdoc'.
@@ -165,7 +171,7 @@
htmlhelp_basename = 'virtualenvwrapperdoc'
-# -- Options for LaTeX output
--------------------------------------------------
+# -- Options for LaTeX output ------------------------------------------------
# The paper size ('letter' or 'a4').
#latex_paper_size = 'letter'
@@ -174,10 +180,11 @@
#latex_font_size = '10pt'
# Grouping the document tree into LaTeX files. List of tuples
-# (source start file, target name, title, author, documentclass
[howto/manual]).
+# (source start file, target name, title, author, documentclass
+# [howto/manual]).
latex_documents = [
- ('index', 'virtualenvwrapper.tex', u'virtualenvwrapper Documentation',
- u'Doug Hellmann', 'manual'),
+ ('index', 'virtualenvwrapper.tex', u'virtualenvwrapper Documentation',
+ u'Doug Hellmann', 'manual'),
]
# The name of an image file (relative to this directory) to place at the top of
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/virtualenvwrapper-3.6.1/docs/source/history.rst
new/virtualenvwrapper-3.7/docs/source/history.rst
--- old/virtualenvwrapper-3.6.1/docs/source/history.rst 2013-03-08
13:12:05.000000000 +0100
+++ new/virtualenvwrapper-3.7/docs/source/history.rst 2013-03-16
15:32:38.000000000 +0100
@@ -2,6 +2,23 @@
Release History
===============
+3.7
+
+ - Improve tab-completion support for users of the lazy-loading
+ mode. (:bbuser:`upsuper`)
+ - Add ``--help`` option to ``mkproject``.
+ - Add ``--help`` option to ``workon``.
+ - Turn off logging from the hook loader by default, and replace
+ ``VIRTUALENVWRAPPER_LOG_DIR`` environment variable with
+ ``VIRTUALENVWRAPPER_LOG_FILE``. The rotating log behavior remains
+ the same. The motivation for this change is the race condition
+ caused by that rotating behavior, especially when the wrappers are
+ being used by users with different permissions and
+ umasks. (:bbissue:`152`)
+ - Use flake8_ for style checking.
+
+.. _flake8: https://pypi.python.org/pypi/flake8
+
3.6.1
- Replace realpath with a more portable way of converting a relative
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/virtualenvwrapper-3.6.1/docs/source/install.rst
new/virtualenvwrapper-3.7/docs/source/install.rst
--- old/virtualenvwrapper-3.6.1/docs/source/install.rst 2012-07-20
21:11:43.000000000 +0200
+++ new/virtualenvwrapper-3.7/docs/source/install.rst 2013-03-15
00:25:37.000000000 +0100
@@ -220,14 +220,14 @@
* :ref:`scripts`
-.. _variable-VIRTUALENVWRAPPER_LOG_DIR:
+.. _variable-VIRTUALENVWRAPPER_LOG_FILE:
Location of Hook Logs
---------------------
-The variable ``VIRTUALENVWRAPPER_LOG_DIR`` tells virtualenvwrapper
+The variable ``VIRTUALENVWRAPPER_LOG_FILE`` tells virtualenvwrapper
where the logs for the hook loader should be written. The default is
-``$WORKON_HOME``.
+to not log from the hooks.
.. _variable-VIRTUALENVWRAPPER_VIRTUALENV:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/virtualenvwrapper-3.6.1/setup.py
new/virtualenvwrapper-3.7/setup.py
--- old/virtualenvwrapper-3.6.1/setup.py 2013-03-08 13:12:18.000000000
+0100
+++ new/virtualenvwrapper-3.7/setup.py 2013-03-16 15:32:31.000000000 +0100
@@ -1,7 +1,7 @@
#!/usr/bin/env python
PROJECT = 'virtualenvwrapper'
-VERSION = '3.6.1'
+VERSION = '3.7'
# Bootstrap installation of Distribute
import distribute_setup
@@ -15,7 +15,7 @@
import sys
try:
- long_description = open('README.txt', 'rt').read()
+ long_description = open('README.rst', 'rt').read()
except IOError:
long_description = ''
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/virtualenvwrapper-3.6.1/tests/run_tests
new/virtualenvwrapper-3.7/tests/run_tests
--- old/virtualenvwrapper-3.6.1/tests/run_tests 2012-06-10 20:27:02.000000000
+0200
+++ new/virtualenvwrapper-3.7/tests/run_tests 2013-03-14 22:50:00.000000000
+0100
@@ -40,7 +40,7 @@
exit 1
fi
-# Force the tox virtualenv to be active.
+# Force the tox virtualenv to be active.
#
# Since this script runs from within a separate shell created by tox,
# the name of the virtualenv (in $VIRTUAL_ENV) is inherited, but the
@@ -87,6 +87,7 @@
echo " $($VIRTUALENVWRAPPER_PYTHON -V 2>&1)"
echo " PYTHONPATH=$PYTHONPATH"
echo " SHELL=$test_shell"
+ echo " virtualenv=$(which virtualenv)"
echo
export SHUNIT_PARENT="$test_script"
$test_shell $test_shell_opts $test_script || exit 1
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/virtualenvwrapper-3.6.1/tests/test.sh
new/virtualenvwrapper-3.7/tests/test.sh
--- old/virtualenvwrapper-3.6.1/tests/test.sh 2012-06-19 22:59:58.000000000
+0200
+++ new/virtualenvwrapper-3.7/tests/test.sh 2013-03-15 00:26:44.000000000
+0100
@@ -26,7 +26,6 @@
assertTrue "Global $WORKON_HOME/$hook was not created" "[ -f
$WORKON_HOME/$hook ]"
assertTrue "Global $WORKON_HOME/$hook is not executable" "[ -x
$WORKON_HOME/$hook ]"
done
- assertTrue "Log file was not created" "[ -f $WORKON_HOME/hook.log ]"
export pre_test_dir=$(cd "$test_dir"; pwd)
echo "echo GLOBAL initialize >> \"$pre_test_dir/catch_output\"" >>
"$WORKON_HOME/initialize"
virtualenvwrapper_initialize
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/virtualenvwrapper-3.6.1/tests/test.sh.orig
new/virtualenvwrapper-3.7/tests/test.sh.orig
--- old/virtualenvwrapper-3.6.1/tests/test.sh.orig 2012-06-10
20:27:02.000000000 +0200
+++ new/virtualenvwrapper-3.7/tests/test.sh.orig 1970-01-01
01:00:00.000000000 +0100
@@ -1,119 +0,0 @@
-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
- rm -f "$test_dir/catch_output"
- unset VIRTUALENVWRAPPER_INITIALIZED
-}
-
-test_virtualenvwrapper_initialize() {
- assertTrue "Initialized" virtualenvwrapper_initialize
- for hook in premkvirtualenv postmkvirtualenv prermvirtualenv
postrmvirtualenv preactivate postactivate predeactivate postdeactivate
- do
- assertTrue "Global $WORKON_HOME/$hook was not created" "[ -f
$WORKON_HOME/$hook ]"
- assertTrue "Global $WORKON_HOME/$hook is not executable" "[ -x
$WORKON_HOME/$hook ]"
- done
- assertTrue "Log file was not created" "[ -f $WORKON_HOME/hook.log ]"
- export pre_test_dir=$(cd "$test_dir"; pwd)
- echo "echo GLOBAL initialize >> \"$pre_test_dir/catch_output\"" >>
"$WORKON_HOME/initialize"
- virtualenvwrapper_initialize
- output=$(cat "$test_dir/catch_output")
- expected="GLOBAL initialize"
- assertSame "$expected" "$output"
-}
-
-test_virtualenvwrapper_space_in_workon_home() {
- before="$WORKON_HOME"
- export WORKON_HOME="$WORKON_HOME/this has spaces"
- expected="$WORKON_HOME"
- mkdir -p "$expected"
- virtualenvwrapper_initialize
- RC=$?
- assertSame "$expected" "$WORKON_HOME"
- assertSame "0" "$RC"
- export WORKON_HOME="$before"
-}
-
-test_virtualenvwrapper_verify_workon_home() {
- assertTrue "WORKON_HOME not verified" virtualenvwrapper_verify_workon_home
-}
-
-test_virtualenvwrapper_verify_workon_home_missing_dir() {
- old_home="$WORKON_HOME"
- WORKON_HOME="$WORKON_HOME/not_there"
- assertTrue "Directory already exists" "[ ! -d \"$WORKON_HOME\" ]"
- virtualenvwrapper_verify_workon_home >"$old_home/output" 2>&1
- output=$(cat "$old_home/output")
- assertSame "NOTE: Virtual environments directory $WORKON_HOME does not
exist. Creating..." "$output"
- WORKON_HOME="$old_home"
-}
-
-test_virtualenvwrapper_verify_workon_home_missing_dir_quiet() {
- old_home="$WORKON_HOME"
- WORKON_HOME="$WORKON_HOME/not_there_quiet"
- assertTrue "Directory already exists" "[ ! -d \"$WORKON_HOME\" ]"
- output=$(virtualenvwrapper_verify_workon_home -q 2>&1)
- assertSame "" "$output"
- WORKON_HOME="$old_home"
-}
-
-test_virtualenvwrapper_verify_workon_home_missing_dir_grep_options() {
- old_home="$WORKON_HOME"
- WORKON_HOME="$WORKON_HOME/not_there"
- # This should prevent the message from being found if it isn't
- # unset correctly.
- export GREP_OPTIONS="--count"
- assertTrue "WORKON_HOME not verified" virtualenvwrapper_verify_workon_home
- WORKON_HOME="$old_home"
- unset GREP_OPTIONS
-}
-
-test_python_interpreter_set_incorrectly() {
- return_to="$(pwd)"
- cd "$WORKON_HOME"
- mkvirtualenv no_wrappers >/dev/null 2>&1
- RC=$?
- assertEquals "0" "$RC"
- expected="ImportError: No module named virtualenvwrapper.hook_loader"
- # test_shell is set by tests/run_tests
- if [ "$test_shell" = "" ]
- then
- export test_shell=$SHELL
- fi
-
subshell_output=$(VIRTUALENVWRAPPER_PYTHON="$WORKON_HOME/no_wrappers/bin/python"
$test_shell $return_to/virtualenvwrapper.sh 2>&1)
- #echo "$subshell_output"
- echo "$subshell_output" | grep -q "$expected" 2>&1
- found_it=$?
- #echo "$found_it"
- assertTrue "Expected \'$expected\', got: \'$subshell_output\'" "[
$found_it -eq 0 ]"
- assertFalse "Failed to detect invalid Python location"
"VIRTUALENVWRAPPER_PYTHON=$VIRTUAL_ENV/bin/python virtualenvwrapper_run_hook
initialize >/dev/null 2>&1"
- cd "$return_to"
- deactivate
-}
-
-test_virtualenvwrapper_verify_virtualenv(){
- assertTrue "Verified unable to verify virtualenv"
virtualenvwrapper_verify_virtualenv
-
- VIRTUALENVWRAPPER_VIRTUALENV="thiscannotpossiblyexist123"
- assertFalse "Incorrectly verified virtualenv"
virtualenvwrapper_verify_virtualenv
-}
-
-test_virtualenvwrapper_verify_virtualenv_clone(){
- assertTrue "Verified unable to verify virtualenv_clone"
virtualenvwrapper_verify_virtualenv_clone
-
- VIRTUALENVWRAPPER_VIRTUALENV_CLONE="thiscannotpossiblyexist123"
- assertFalse "Incorrectly verified virtualenv_clone"
virtualenvwrapper_verify_virtualenv_clone
-}
-
-. "$test_dir/shunit2"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/virtualenvwrapper-3.6.1/tests/test.sh~
new/virtualenvwrapper-3.7/tests/test.sh~
--- old/virtualenvwrapper-3.6.1/tests/test.sh~ 2012-06-10 20:27:40.000000000
+0200
+++ new/virtualenvwrapper-3.7/tests/test.sh~ 2012-06-19 22:59:58.000000000
+0200
@@ -86,7 +86,7 @@
cd "$WORKON_HOME"
mkvirtualenv no_wrappers >/dev/null 2>&1
RC=$?
- assertEquals "0" "$RC"
+ assertEquals "mkvirtualenv return code wrong" "0" "$RC"
expected="ImportError: No module named virtualenvwrapper.hook_loader"
# test_shell is set by tests/run_tests
if [ "$test_shell" = "" ]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/virtualenvwrapper-3.6.1/tests/test_cp.sh.orig
new/virtualenvwrapper-3.7/tests/test_cp.sh.orig
--- old/virtualenvwrapper-3.6.1/tests/test_cp.sh.orig 2012-06-10
20:27:03.000000000 +0200
+++ new/virtualenvwrapper-3.7/tests/test_cp.sh.orig 1970-01-01
01:00:00.000000000 +0100
@@ -1,137 +0,0 @@
-#!/bin/sh
-
-test_dir=$(cd $(dirname $0) && pwd)
-source "$test_dir/setup.sh"
-
-setUp () {
- rm -rf "$WORKON_HOME"
- mkdir -p "$WORKON_HOME"
- source "$test_dir/../virtualenvwrapper.sh"
- rm -f "$test_dir/catch_output"
- echo
-}
-
-tearDown() {
- if type deactivate >/dev/null 2>&1
- then
- deactivate
- fi
- rm -rf "$WORKON_HOME"
-}
-
-test_new_env_activated () {
- mkvirtualenv "source"
- (cd tests/testpackage && python setup.py install) >/dev/null 2>&1
- cpvirtualenv "source" "destination"
- rmvirtualenv "source"
- testscript="$(which testscript.py)"
- assertTrue "Environment test script not found in path" "[
$WORKON_HOME/destination/bin/testscript.py -ef $testscript ]"
- testscriptcontent="$(cat $testscript)"
- assertTrue "No cpvirtualenvtest in $testscriptcontent" "echo
$testscriptcontent | grep cpvirtualenvtest"
- assertTrue virtualenvwrapper_verify_active_environment
-}
-
-test_virtual_env_variable () {
- mkvirtualenv "source"
- cpvirtualenv "source" "destination"
- assertSame "Wrong virtualenv name" "destination" $(basename "$VIRTUAL_ENV")
- assertTrue "$WORKON_HOME not in $VIRTUAL_ENV" "echo $VIRTUAL_ENV | grep -q
$WORKON_HOME"
-}
-
-fake_virtualenv () {
- typeset envname="$1"
- touch "$envname/fake_virtualenv_was_here"
- virtualenv $@
-}
-
-test_virtualenvwrapper_virtualenv_variable () {
- mkvirtualenv "source"
- export VIRTUALENVWRAPPER_VIRTUALENV=fake_virtualenv
- cpvirtualenv "source" "destination"
- unset VIRTUALENVWRAPPER_VIRTUALENV
- assertTrue "wrapper was not run" "[ -f
$VIRTUAL_ENV/fake_virtualenv_was_here ]"
-}
-
-test_source_relocatable () {
- mkvirtualenv "source"
- (cd tests/testpackage && python setup.py install) >/dev/null 2>&1
- assertTrue "virtualenv --relocatable \"$WORKON_HOME/source\""
- cpvirtualenv "source" "destination"
- 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 () {
- out="$(cpvirtualenv virtualenvthatdoesntexist foo)"
- assertSame "$out" "virtualenvthatdoesntexist virtualenv doesn't exist"
-}
-
-test_hooks () {
- mkvirtualenv "source"
-
- export pre_test_dir=$(cd "$test_dir"; pwd)
-
- # Set the interpreter of the hook script to the simple shell
- echo "#!/bin/sh" > "$WORKON_HOME/premkvirtualenv"
- echo "echo GLOBAL premkvirtualenv \`pwd\` \"\$@\" >>
\"$pre_test_dir/catch_output\"" >> "$WORKON_HOME/premkvirtualenv"
- chmod +x "$WORKON_HOME/premkvirtualenv"
-
- echo "echo GLOBAL postmkvirtualenv >> $test_dir/catch_output" >
"$WORKON_HOME/postmkvirtualenv"
-
- # Set the interpreter of the hook script to the simple shell
- echo "#!/bin/sh" > "$WORKON_HOME/precpvirtualenv"
- echo "echo GLOBAL precpvirtualenv \`pwd\` \"\$@\" >>
\"$pre_test_dir/catch_output\"" >> "$WORKON_HOME/precpvirtualenv"
- chmod +x "$WORKON_HOME/precpvirtualenv"
-
- # Set the interpreter of the hook script to the simple shell
- echo "#!/bin/sh" > "$WORKON_HOME/postcpvirtualenv"
- echo "echo GLOBAL postcpvirtualenv >> $test_dir/catch_output" >
"$WORKON_HOME/postcpvirtualenv"
-
- cpvirtualenv "source" "destination"
-
- output=$(cat "$test_dir/catch_output")
- workon_home_as_pwd=$(cd $WORKON_HOME; pwd)
-
- expected="GLOBAL precpvirtualenv $workon_home_as_pwd source destination
-GLOBAL premkvirtualenv $workon_home_as_pwd destination
-GLOBAL postmkvirtualenv
-GLOBAL postcpvirtualenv"
-
- assertSame "$expected" "$output"
-
- rm -f "$WORKON_HOME/premkvirtualenv"
- rm -f "$WORKON_HOME/postmkvirtualenv"
-}
-
-test_no_site_packages () {
- # See issue #102
- mkvirtualenv "source" --no-site-packages >/dev/null 2>&1
- cpvirtualenv "source" "destination"
-
ngsp_file="$VIRTUALENVWRAPPER_ENV_SITE_PACKAGES/../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"
-
ngsp_file="$VIRTUALENVWRAPPER_ENV_SITE_PACKAGES/../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"
-
ngsp_file="$VIRTUALENVWRAPPER_ENV_SITE_PACKAGES/../no-global-site-packages.txt"
- assertTrue "$ngsp_file does not exist in copied env" "[ -f \"$ngsp_file\"
]"
-}
-
-. "$test_dir/shunit2"
-
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/virtualenvwrapper-3.6.1/tests/test_log_dir.sh
new/virtualenvwrapper-3.7/tests/test_log_dir.sh
--- old/virtualenvwrapper-3.6.1/tests/test_log_dir.sh 2012-06-10
20:27:03.000000000 +0200
+++ new/virtualenvwrapper-3.7/tests/test_log_dir.sh 1970-01-01
01:00:00.000000000 +0100
@@ -1,34 +0,0 @@
-#!/bin/sh
-
-test_dir=$(cd $(dirname $0) && pwd)
-source "$test_dir/setup.sh"
-
-setUp () {
- echo
-}
-
-test_set_by_user() {
- export VIRTUALENVWRAPPER_LOG_DIR="$WORKON_HOME/logs"
- mkdir -p "$VIRTUALENVWRAPPER_LOG_DIR"
- source "$test_dir/../virtualenvwrapper.sh"
- assertTrue "Log file was not created" "[ -f $WORKON_HOME/logs/hook.log ]"
-}
-
-test_file_permissions() {
- export VIRTUALENVWRAPPER_LOG_DIR="$WORKON_HOME/logs"
- mkdir -p "$VIRTUALENVWRAPPER_LOG_DIR"
- source "$test_dir/../virtualenvwrapper.sh"
- perms=$(ls -l "$WORKON_HOME/logs/hook.log" | cut -f1 -d' ')
- #echo $perms
- assertTrue "Log file permissions are wrong: $perms" "echo $perms | grep
'^-rw-rw'"
-}
-
-test_not_set_by_user() {
- unset WORKON_HOME
- unset VIRTUALENVWRAPPER_LOG_DIR
- unset VIRTUALENVWRAPPER_HOOK_DIR
- source "$test_dir/../virtualenvwrapper.sh"
- assertSame "$WORKON_HOME" "$VIRTUALENVWRAPPER_LOG_DIR"
-}
-
-. "$test_dir/shunit2"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/virtualenvwrapper-3.6.1/tests/test_log_dir.sh~
new/virtualenvwrapper-3.7/tests/test_log_dir.sh~
--- old/virtualenvwrapper-3.6.1/tests/test_log_dir.sh~ 2012-06-10
20:27:03.000000000 +0200
+++ new/virtualenvwrapper-3.7/tests/test_log_dir.sh~ 1970-01-01
01:00:00.000000000 +0100
@@ -1,37 +0,0 @@
-#!/bin/sh
-
-#set -x
-
-test_dir=$(cd $(dirname $0) && pwd)
-
-export WORKON_HOME="$(echo ${TMPDIR:-/tmp}/WORKON_HOME | sed 's|//|/|g')"
-
-setUp () {
- echo
-}
-
-test_set_by_user() {
- export VIRTUALENVWRAPPER_LOG_DIR="$WORKON_HOME/logs"
- mkdir -p "$VIRTUALENVWRAPPER_LOG_DIR"
- source "$test_dir/../virtualenvwrapper.sh"
- assertTrue "Log file was not created" "[ -f $WORKON_HOME/logs/hook.log ]"
-}
-
-test_file_permissions() {
- export VIRTUALENVWRAPPER_LOG_DIR="$WORKON_HOME/logs"
- mkdir -p "$VIRTUALENVWRAPPER_LOG_DIR"
- source "$test_dir/../virtualenvwrapper.sh"
- perms=$(ls -l "$WORKON_HOME/logs/hook.log" | cut -f1 -d' ')
- #echo $perms
- assertTrue "Log file permissions are wrong: $perms" "echo $perms | grep
'^-rw-rw'"
-}
-
-test_not_set_by_user() {
- unset WORKON_HOME
- unset VIRTUALENVWRAPPER_LOG_DIR
- unset VIRTUALENVWRAPPER_HOOK_DIR
- source "$test_dir/../virtualenvwrapper.sh"
- assertSame "$WORKON_HOME" "$VIRTUALENVWRAPPER_LOG_DIR"
-}
-
-. "$test_dir/shunit2"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/virtualenvwrapper-3.6.1/tests/test_log_file.sh
new/virtualenvwrapper-3.7/tests/test_log_file.sh
--- old/virtualenvwrapper-3.6.1/tests/test_log_file.sh 1970-01-01
01:00:00.000000000 +0100
+++ new/virtualenvwrapper-3.7/tests/test_log_file.sh 2013-03-15
00:29:18.000000000 +0100
@@ -0,0 +1,32 @@
+#!/bin/sh
+
+test_dir=$(cd $(dirname $0) && pwd)
+source "$test_dir/setup.sh"
+
+setUp () {
+ echo
+}
+
+test_set_by_user() {
+ export VIRTUALENVWRAPPER_LOG_FILE="$WORKON_HOME/hooks.log"
+ source "$test_dir/../virtualenvwrapper.sh"
+ 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"
+ perms=$(ls -l "$VIRTUALENVWRAPPER_LOG_FILE" | cut -f1 -d' ')
+ #echo $perms
+ assertTrue "Log file permissions are wrong: $perms" "echo $perms | grep
'^-rw-rw'"
+}
+
+test_not_set_by_user() {
+ unset WORKON_HOME
+ unset VIRTUALENVWRAPPER_LOG_FILE
+ unset VIRTUALENVWRAPPER_HOOK_DIR
+ source "$test_dir/../virtualenvwrapper.sh"
+ assertSame "" "$VIRTUALENVWRAPPER_LOG_FILE"
+}
+
+. "$test_dir/shunit2"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/virtualenvwrapper-3.6.1/tests/test_log_file.sh~
new/virtualenvwrapper-3.7/tests/test_log_file.sh~
--- old/virtualenvwrapper-3.6.1/tests/test_log_file.sh~ 1970-01-01
01:00:00.000000000 +0100
+++ new/virtualenvwrapper-3.7/tests/test_log_file.sh~ 2013-03-15
00:27:38.000000000 +0100
@@ -0,0 +1,34 @@
+#!/bin/sh
+
+test_dir=$(cd $(dirname $0) && pwd)
+source "$test_dir/setup.sh"
+
+setUp () {
+ echo
+}
+
+test_set_by_user() {
+ export VIRTUALENVWRAPPER_LOG_DIR="$WORKON_HOME/logs"
+ mkdir -p "$VIRTUALENVWRAPPER_LOG_DIR"
+ source "$test_dir/../virtualenvwrapper.sh"
+ assertTrue "Log file was not created" "[ -f $WORKON_HOME/logs/hook.log ]"
+}
+
+test_file_permissions() {
+ export VIRTUALENVWRAPPER_LOG_DIR="$WORKON_HOME/logs"
+ mkdir -p "$VIRTUALENVWRAPPER_LOG_DIR"
+ source "$test_dir/../virtualenvwrapper.sh"
+ perms=$(ls -l "$WORKON_HOME/logs/hook.log" | cut -f1 -d' ')
+ #echo $perms
+ assertTrue "Log file permissions are wrong: $perms" "echo $perms | grep
'^-rw-rw'"
+}
+
+test_not_set_by_user() {
+ unset WORKON_HOME
+ unset VIRTUALENVWRAPPER_LOG_DIR
+ unset VIRTUALENVWRAPPER_HOOK_DIR
+ source "$test_dir/../virtualenvwrapper.sh"
+ assertSame "$WORKON_HOME" "$VIRTUALENVWRAPPER_LOG_DIR"
+}
+
+. "$test_dir/shunit2"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/virtualenvwrapper-3.6.1/tests/test_run_hook.sh
new/virtualenvwrapper-3.7/tests/test_run_hook.sh
--- old/virtualenvwrapper-3.6.1/tests/test_run_hook.sh 2012-06-10
20:27:04.000000000 +0200
+++ new/virtualenvwrapper-3.7/tests/test_run_hook.sh 2013-03-15
00:59:20.000000000 +0100
@@ -64,11 +64,4 @@
assertSame "Errno 13] Permission denied" "$error"
}
-test_virtualenvwrapper_run_hook_without_log_dir() {
- old_log_dir="$VIRTUALENVWRAPPER_LOG_DIR"
- unset VIRTUALENVWRAPPER_LOG_DIR
- assertFalse "virtualenvwrapper_run_hook initialize"
- export VIRTUALENVWRAPPER_LOG_DIR="$old_log_dir"
-}
-
. "$test_dir/shunit2"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/virtualenvwrapper-3.6.1/tests/test_run_hook.sh~
new/virtualenvwrapper-3.7/tests/test_run_hook.sh~
--- old/virtualenvwrapper-3.6.1/tests/test_run_hook.sh~ 2012-06-10
20:27:04.000000000 +0200
+++ new/virtualenvwrapper-3.7/tests/test_run_hook.sh~ 2012-06-10
20:27:04.000000000 +0200
@@ -1,10 +1,7 @@
#!/bin/sh
-#set -x
-
test_dir=$(cd $(dirname $0) && pwd)
-
-export WORKON_HOME="$(echo ${TMPDIR:-/tmp}/WORKON_HOME | sed 's|//|/|g')"
+source "$test_dir/setup.sh"
oneTimeSetUp() {
rm -rf "$WORKON_HOME"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/virtualenvwrapper-3.6.1/tests/test_toggleglobalsitepackages.sh
new/virtualenvwrapper-3.7/tests/test_toggleglobalsitepackages.sh
--- old/virtualenvwrapper-3.6.1/tests/test_toggleglobalsitepackages.sh
2012-06-10 20:27:04.000000000 +0200
+++ new/virtualenvwrapper-3.7/tests/test_toggleglobalsitepackages.sh
2013-03-14 23:13:13.000000000 +0100
@@ -16,24 +16,24 @@
setUp () {
echo
rm -f "$test_dir/catch_output"
- mkvirtualenv --system-site-packages "globaltest" >/dev/null 2>&1
}
tearDown () {
deactivate >/dev/null 2>&1
- rmvirtualenv "globaltest" >/dev/null 2>&1
}
test_toggleglobalsitepackages () {
-
ngsp_file="`virtualenvwrapper_get_site_packages_dir`/../no-global-site-packages.txt"
- assertTrue "$ngsp_file does not exist" "[ -f \"$ngsp_file\" ]"
+ 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" "[ -f \"$ngsp_file\" ]"
+ 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`"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/virtualenvwrapper-3.6.1/tests/test_toggleglobalsitepackages.sh~
new/virtualenvwrapper-3.7/tests/test_toggleglobalsitepackages.sh~
--- old/virtualenvwrapper-3.6.1/tests/test_toggleglobalsitepackages.sh~
2012-06-10 20:27:04.000000000 +0200
+++ new/virtualenvwrapper-3.7/tests/test_toggleglobalsitepackages.sh~
2012-06-10 20:27:04.000000000 +0200
@@ -1,10 +1,7 @@
#!/bin/sh
-#set -x
-
test_dir=$(cd $(dirname $0) && pwd)
-
-export WORKON_HOME="$(echo ${TMPDIR:-/tmp}/WORKON_HOME | sed 's|//|/|g')"
+source "$test_dir/setup.sh"
oneTimeSetUp() {
rm -rf "$WORKON_HOME"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/virtualenvwrapper-3.6.1/tox.ini
new/virtualenvwrapper-3.7/tox.ini
--- old/virtualenvwrapper-3.6.1/tox.ini 2012-07-20 17:32:11.000000000 +0200
+++ new/virtualenvwrapper-3.7/tox.ini 2013-03-16 15:34:19.000000000 +0100
@@ -1,5 +1,5 @@
[tox]
-envlist = py27,py26,py32,pep8
+envlist = py27,py26,py32,style
[testenv]
commands = bash ./tests/run_tests {envdir} []
@@ -9,9 +9,9 @@
setenv =
TOXIC = true
-[testenv:pep8]
-deps = pep8==1.1
-commands = pep8 --ignore=E501 --repeat --show-source virtualenvwrapper
+[testenv:style]
+deps = flake8
+commands = flake8 virtualenvwrapper docs/source/conf.py
# Not sure why this is needed, but on my system if it isn't included then
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/virtualenvwrapper-3.6.1/virtualenvwrapper/hook_loader.py
new/virtualenvwrapper-3.7/virtualenvwrapper/hook_loader.py
--- old/virtualenvwrapper-3.6.1/virtualenvwrapper/hook_loader.py
2012-07-20 17:28:07.000000000 +0200
+++ new/virtualenvwrapper-3.7/virtualenvwrapper/hook_loader.py 2013-03-15
23:28:11.000000000 +0100
@@ -34,7 +34,7 @@
usage='usage: %prog [options] <hook> [<arguments>]',
prog='virtualenvwrapper.hook_loader',
description='Manage hooks for virtualenvwrapper',
- )
+ )
parser.add_option(
'-S', '--script',
@@ -42,21 +42,21 @@
'result to <file>',
dest='script_filename',
default=None,
- )
+ )
parser.add_option(
'-s', '--source',
help='Print the shell commands to be run in the current shell',
action='store_true',
dest='sourcing',
default=False,
- )
+ )
parser.add_option(
'-l', '--list',
help='Print a list of the plugins available for the given hook',
action='store_true',
default=False,
dest='listing',
- )
+ )
parser.add_option(
'-v', '--verbose',
help='Show more information on the console',
@@ -64,37 +64,38 @@
const=2,
default=1,
dest='verbose_level',
- )
+ )
parser.add_option(
'-q', '--quiet',
help='Show less information on the console',
action='store_const',
const=0,
dest='verbose_level',
- )
+ )
parser.add_option(
'-n', '--name',
help='Only run the hook from the named plugin',
action='append',
dest='names',
default=[],
- )
+ )
parser.disable_interspersed_args() # stop when on option without an '-'
options, args = parser.parse_args()
root_logger = logging.getLogger('')
# Set up logging to a file
- root_logger.setLevel(logging.DEBUG)
- file_handler = GroupWriteRotatingFileHandler(
- os.path.expandvars(os.path.join('$VIRTUALENVWRAPPER_LOG_DIR',
- 'hook.log')),
- maxBytes=10240,
- backupCount=1,
- )
- formatter = logging.Formatter(LOG_FORMAT)
- file_handler.setFormatter(formatter)
- root_logger.addHandler(file_handler)
+ logfile = os.environ.get('VIRTUALENVWRAPPER_LOG_FILE')
+ if logfile:
+ root_logger.setLevel(logging.DEBUG)
+ file_handler = GroupWriteRotatingFileHandler(
+ logfile,
+ maxBytes=10240,
+ backupCount=1,
+ )
+ formatter = logging.Formatter(LOG_FORMAT)
+ file_handler.setFormatter(formatter)
+ root_logger.addHandler(file_handler)
# Send higher-level messages to the console, too
console = logging.StreamHandler()
@@ -188,23 +189,24 @@
def list_hooks(output=None):
if output is None:
output = sys.stdout
- for hook in itertools.chain(
- ('_'.join(h)
- for h in itertools.product(['pre', 'post'],
- ['mkvirtualenv',
- 'rmvirtualenv',
- 'activate',
- 'deactivate',
- 'cpvirtualenv',
- ])
- ),
- ['initialize',
- 'get_env_details',
- 'project.pre_mkproject',
- 'project.post_mkproject',
- 'project.template',
- ]
- ):
+ static_names = [
+ 'initialize',
+ 'get_env_details',
+ 'project.pre_mkproject',
+ 'project.post_mkproject',
+ 'project.template',
+ ]
+ pre_post_hooks = (
+ '_'.join(h)
+ for h in itertools.product(['pre', 'post'],
+ ['mkvirtualenv',
+ 'rmvirtualenv',
+ 'activate',
+ 'deactivate',
+ 'cpvirtualenv',
+ ])
+ )
+ for hook in itertools.chain(static_names, pre_post_hooks):
output.write(hook + '\n')
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/virtualenvwrapper-3.6.1/virtualenvwrapper/project.py
new/virtualenvwrapper-3.7/virtualenvwrapper/project.py
--- old/virtualenvwrapper-3.6.1/virtualenvwrapper/project.py 2012-07-20
17:32:33.000000000 +0200
+++ new/virtualenvwrapper-3.7/virtualenvwrapper/project.py 2013-03-15
23:29:00.000000000 +0100
@@ -15,7 +15,8 @@
GLOBAL_HOOKS = [
# mkproject
("premkproject",
- "This hook is run after a new project is created and before it is
activated."),
+ "This hook is run after a new project is created "
+ "and before it is activated."),
("postmkproject",
"This hook is run after a new project is activated."),
@@ -24,20 +25,20 @@
"This hook is run before a project is deleted."),
("postrmproject",
"This hook is run after a project is deleted."),
- ]
+]
def initialize(args):
"""Set up user hooks
"""
for filename, comment in GLOBAL_HOOKS:
- make_hook(os.path.join('$VIRTUALENVWRAPPER_HOOK_DIR', filename),
comment)
+ make_hook(os.path.join('$VIRTUALENVWRAPPER_HOOK_DIR', filename),
+ comment)
return
def pre_mkproject(args):
log.debug('pre_mkproject %s', str(args))
- envname = args[0]
run_global('premkproject', *args)
return
@@ -56,5 +57,6 @@
#
# Change to the project directory
#
-[ -f "$VIRTUAL_ENV/$VIRTUALENVWRAPPER_PROJECT_FILENAME" ] && cd "$(cat
\"$VIRTUAL_ENV/$VIRTUALENVWRAPPER_PROJECT_FILENAME\")"
+[ -f "$VIRTUAL_ENV/$VIRTUALENVWRAPPER_PROJECT_FILENAME" ] && \
+ cd "$(cat \"$VIRTUAL_ENV/$VIRTUALENVWRAPPER_PROJECT_FILENAME\")"
"""
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/virtualenvwrapper-3.6.1/virtualenvwrapper/user_scripts.py
new/virtualenvwrapper-3.7/virtualenvwrapper/user_scripts.py
--- old/virtualenvwrapper-3.6.1/virtualenvwrapper/user_scripts.py
2012-07-20 17:32:56.000000000 +0200
+++ new/virtualenvwrapper-3.7/virtualenvwrapper/user_scripts.py 2013-03-15
23:33:56.000000000 +0100
@@ -16,11 +16,9 @@
log = logging.getLogger(__name__)
# Are we running under msys
-if (sys.platform == 'win32'
- and
- os.environ.get('OS') == 'Windows_NT'
- and
- os.environ.get('MSYSTEM') == 'MINGW32'):
+if sys.platform == 'win32' and \
+ os.environ.get('OS') == 'Windows_NT' and \
+ os.environ.get('MSYSTEM') == 'MINGW32':
is_msys = True
script_folder = 'Scripts'
else:
@@ -59,11 +57,13 @@
GLOBAL_HOOKS = [
# initialize
("initialize",
- "This hook is run during the startup phase when loading
virtualenvwrapper.sh."),
+ "This hook is run during the startup phase "
+ "when loading virtualenvwrapper.sh."),
# mkvirtualenv
("premkvirtualenv",
- "This hook is run after a new virtualenv is created and before it is
activated."),
+ "This hook is run after a new virtualenv is created "
+ "and before it is activated."),
("postmkvirtualenv",
"This hook is run after a new virtualenv is activated."),
@@ -89,7 +89,7 @@
("get_env_details",
"This hook is run when the list of virtualenvs is printed "
"so each name can include details."),
- ]
+]
LOCAL_HOOKS = [
@@ -109,7 +109,7 @@
("get_env_details",
"This hook is run when the list of virtualenvs is printed "
"in 'long' mode so each name can include details."),
- ]
+]
def make_hook(filename, comment):
@@ -149,7 +149,8 @@
#
# Run user-provided scripts
#
-[ -f "$VIRTUALENVWRAPPER_HOOK_DIR/initialize" ] && source
"$VIRTUALENVWRAPPER_HOOK_DIR/initialize"
+[ -f "$VIRTUALENVWRAPPER_HOOK_DIR/initialize" ] && \
+ source "$VIRTUALENVWRAPPER_HOOK_DIR/initialize"
"""
@@ -157,7 +158,8 @@
log.debug('pre_mkvirtualenv %s', str(args))
envname = args[0]
for filename, comment in LOCAL_HOOKS:
- make_hook(get_path('$WORKON_HOME', envname, script_folder, filename),
comment)
+ make_hook(get_path('$WORKON_HOME', envname, script_folder, filename),
+ comment)
run_global('premkvirtualenv', *args)
return
@@ -167,7 +169,8 @@
#
# Run user-provided scripts
#
-[ -f "$VIRTUALENVWRAPPER_HOOK_DIR/postmkvirtualenv" ] && source
"$VIRTUALENVWRAPPER_HOOK_DIR/postmkvirtualenv"
+[ -f "$VIRTUALENVWRAPPER_HOOK_DIR/postmkvirtualenv" ] && \
+ source "$VIRTUALENVWRAPPER_HOOK_DIR/postmkvirtualenv"
"""
@@ -175,7 +178,8 @@
log.debug('pre_cpvirtualenv %s', str(args))
envname = args[0]
for filename, comment in LOCAL_HOOKS:
- make_hook(get_path('$WORKON_HOME', envname, script_folder, filename),
comment)
+ make_hook(get_path('$WORKON_HOME', envname, script_folder, filename),
+ comment)
run_global('precpvirtualenv', *args)
return
@@ -185,7 +189,8 @@
#
# Run user-provided scripts
#
-[ -f "$VIRTUALENVWRAPPER_HOOK_DIR/postcpvirtualenv" ] && source
"$VIRTUALENVWRAPPER_HOOK_DIR/postcpvirtualenv"
+[ -f "$VIRTUALENVWRAPPER_HOOK_DIR/postcpvirtualenv" ] && \
+ source "$VIRTUALENVWRAPPER_HOOK_DIR/postcpvirtualenv"
"""
@@ -204,7 +209,8 @@
def pre_activate(args):
log.debug('pre_activate')
run_global('preactivate', *args)
- script_path = get_path('$WORKON_HOME', args[0], script_folder,
'preactivate')
+ script_path = get_path('$WORKON_HOME', args[0],
+ script_folder, 'preactivate')
run_script(script_path, *args)
return
@@ -215,8 +221,10 @@
#
# Run user-provided scripts
#
-[ -f "$VIRTUALENVWRAPPER_HOOK_DIR/postactivate" ] && source
"$VIRTUALENVWRAPPER_HOOK_DIR/postactivate"
-[ -f "$VIRTUAL_ENV/$VIRTUALENVWRAPPER_ENV_BIN_DIR/postactivate" ] && source
"$VIRTUAL_ENV/$VIRTUALENVWRAPPER_ENV_BIN_DIR/postactivate"
+[ -f "$VIRTUALENVWRAPPER_HOOK_DIR/postactivate" ] && \
+ source "$VIRTUALENVWRAPPER_HOOK_DIR/postactivate"
+[ -f "$VIRTUAL_ENV/$VIRTUALENVWRAPPER_ENV_BIN_DIR/postactivate" ] && \
+ source "$VIRTUAL_ENV/$VIRTUALENVWRAPPER_ENV_BIN_DIR/postactivate"
"""
@@ -226,8 +234,10 @@
#
# Run user-provided scripts
#
-[ -f "$VIRTUAL_ENV/$VIRTUALENVWRAPPER_ENV_BIN_DIR/predeactivate" ] && source
"$VIRTUAL_ENV/$VIRTUALENVWRAPPER_ENV_BIN_DIR/predeactivate"
-[ -f "$VIRTUALENVWRAPPER_HOOK_DIR/predeactivate" ] && source
"$VIRTUALENVWRAPPER_HOOK_DIR/predeactivate"
+[ -f "$VIRTUAL_ENV/$VIRTUALENVWRAPPER_ENV_BIN_DIR/predeactivate" ] && \
+ source "$VIRTUAL_ENV/$VIRTUALENVWRAPPER_ENV_BIN_DIR/predeactivate"
+[ -f "$VIRTUALENVWRAPPER_HOOK_DIR/predeactivate" ] && \
+ source "$VIRTUALENVWRAPPER_HOOK_DIR/predeactivate"
"""
@@ -238,8 +248,10 @@
# Run user-provided scripts
#
VIRTUALENVWRAPPER_LAST_VIRTUAL_ENV="$WORKON_HOME/%(env_name)s"
-[ -f "$WORKON_HOME/%(env_name)s/bin/postdeactivate" ] && source
"$WORKON_HOME/%(env_name)s/bin/postdeactivate"
-[ -f "$VIRTUALENVWRAPPER_HOOK_DIR/postdeactivate" ] && source
"$VIRTUALENVWRAPPER_HOOK_DIR/postdeactivate"
+[ -f "$WORKON_HOME/%(env_name)s/bin/postdeactivate" ] && \
+ source "$WORKON_HOME/%(env_name)s/bin/postdeactivate"
+[ -f "$VIRTUALENVWRAPPER_HOOK_DIR/postdeactivate" ] && \
+ source "$VIRTUALENVWRAPPER_HOOK_DIR/postdeactivate"
unset VIRTUALENVWRAPPER_LAST_VIRTUAL_ENV
""" % {'env_name': args[0]}
@@ -247,7 +259,8 @@
def get_env_details(args):
log.debug('get_env_details')
run_global('get_env_details', *args)
- script_path = get_path('$WORKON_HOME', args[0], script_folder,
'get_env_details')
+ script_path = get_path('$WORKON_HOME', args[0],
+ script_folder, 'get_env_details')
run_script(script_path, *args)
return
@@ -263,7 +276,8 @@
'''
path = os.path.expanduser(os.path.expandvars(os.path.join(*args)))
if is_msys:
- # MSYS accept unix or Win32 and sometimes it drives to mixed style
paths
+ # MSYS accept unix or Win32 and sometimes
+ # it drives to mixed style paths
if re.match(r'^/[a-zA-Z](/|^)', path):
# msys path could starts with '/c/'-form drive letter
path = ''.join((path[1], ':', path[2:]))
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/virtualenvwrapper-3.6.1/virtualenvwrapper.egg-info/PKG-INFO
new/virtualenvwrapper-3.7/virtualenvwrapper.egg-info/PKG-INFO
--- old/virtualenvwrapper-3.6.1/virtualenvwrapper.egg-info/PKG-INFO
2013-03-08 13:17:01.000000000 +0100
+++ new/virtualenvwrapper-3.7/virtualenvwrapper.egg-info/PKG-INFO
2013-03-16 15:36:20.000000000 +0100
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: virtualenvwrapper
-Version: 3.6.1
+Version: 3.7
Summary: Enhancements to virtualenv
Home-page: http://www.doughellmann.com/projects/virtualenvwrapper/
Author: Doug Hellmann
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/virtualenvwrapper-3.6.1/virtualenvwrapper.egg-info/SOURCES.txt
new/virtualenvwrapper-3.7/virtualenvwrapper.egg-info/SOURCES.txt
--- old/virtualenvwrapper-3.6.1/virtualenvwrapper.egg-info/SOURCES.txt
2013-03-08 13:17:02.000000000 +0100
+++ new/virtualenvwrapper-3.7/virtualenvwrapper.egg-info/SOURCES.txt
2013-03-16 15:36:20.000000000 +0100
@@ -1,5 +1,4 @@
MANIFEST.in
-README.txt
distribute_setup.py
setup.py
tox.ini
@@ -62,14 +61,12 @@
tests/setup.sh~
tests/shunit2
tests/test.sh
-tests/test.sh.orig
tests/test.sh~
tests/test_add2virtualenv.sh
tests/test_add2virtualenv.sh~
tests/test_cd.sh
tests/test_cd.sh~
tests/test_cp.sh
-tests/test_cp.sh.orig
tests/test_cp.sh~
tests/test_cpvirtualenv.sh
tests/test_deactivate.sh
@@ -87,8 +84,8 @@
tests/test_lazy_loaded.sh~
tests/test_lazy_run.sh
tests/test_lazy_run.sh~
-tests/test_log_dir.sh
-tests/test_log_dir.sh~
+tests/test_log_file.sh
+tests/test_log_file.sh~
tests/test_ls.sh
tests/test_ls.sh~
tests/test_mktmpenv.sh
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/virtualenvwrapper-3.6.1/virtualenvwrapper.sh
new/virtualenvwrapper-3.7/virtualenvwrapper.sh
--- old/virtualenvwrapper-3.6.1/virtualenvwrapper.sh 2012-12-19
23:46:22.000000000 +0100
+++ new/virtualenvwrapper-3.7/virtualenvwrapper.sh 2013-03-15
23:11:25.000000000 +0100
@@ -202,12 +202,6 @@
hook_script="$(virtualenvwrapper_tempfile ${1}-hook)" || return 1
- if [ -z "$VIRTUALENVWRAPPER_LOG_DIR" ]
- then
- echo "ERROR: VIRTUALENVWRAPPER_LOG_DIR is not set." 1>&2
- command \rm -f "$hook_script"
- return 1
- fi
"$VIRTUALENVWRAPPER_PYTHON" -c 'from virtualenvwrapper.hook_loader import
main; main()' $HOOK_VERBOSE_OPTION --script "$hook_script" "$@"
result=$?
@@ -286,12 +280,6 @@
export VIRTUALENVWRAPPER_HOOK_DIR="$WORKON_HOME"
fi
- # Set the location of the hook script logs
- if [ "$VIRTUALENVWRAPPER_LOG_DIR" = "" ]
- then
- export VIRTUALENVWRAPPER_LOG_DIR="$WORKON_HOME"
- fi
-
virtualenvwrapper_run_hook "initialize"
virtualenvwrapper_setup_tab_completion
@@ -619,11 +607,51 @@
echo
}
+# Show help for workon
+function workon_help {
+ echo "Usage: workon env_name"
+ echo ""
+ echo " Deactivate any currently activated virtualenv"
+ echo " and activate the named environment, triggering"
+ echo " any hooks in the process."
+ echo ""
+ echo " workon"
+ echo ""
+ echo " Print a list of available environments."
+ echo " (See also lsvirtualenv -b)"
+ echo ""
+ echo " workon (-h|--help)"
+ echo ""
+ echo " Show this help message."
+ echo ""
+}
+
# List or change working virtual environments
#
# Usage: workon [environment_name]
#
function workon {
+ in_args=( "$@" )
+
+ if [ -n "$ZSH_VERSION" ]
+ then
+ i=1
+ tst="-le"
+ else
+ i=0
+ tst="-lt"
+ fi
+ while [ $i $tst $# ]
+ do
+ a="${in_args[$i]}"
+ case "$a" in
+ -h|--help)
+ workon_help;
+ return 0;;
+ esac
+ i=$(( $i + 1 ))
+ done
+
typeset env_name="$1"
if [ "$env_name" = "" ]
then
@@ -972,9 +1000,8 @@
while [ $i $tst $# ]
do
a="${in_args[$i]}"
- # echo "arg $i : $a"
case "$a" in
- -h)
+ -h|--help)
mkproject_help;
return;;
-t)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/virtualenvwrapper-3.6.1/virtualenvwrapper_lazy.sh
new/virtualenvwrapper-3.7/virtualenvwrapper_lazy.sh
--- old/virtualenvwrapper-3.6.1/virtualenvwrapper_lazy.sh 2012-07-20
17:08:04.000000000 +0200
+++ new/virtualenvwrapper-3.7/virtualenvwrapper_lazy.sh 2013-03-14
23:52:27.000000000 +0100
@@ -31,4 +31,14 @@
done
}
+# Set up completion functions to virtualenvwrapper_load
+function virtualenvwrapper_setup_lazy_completion {
+ if [ -n "$BASH" ] ; then
+ complete -o nospace -F virtualenvwrapper_load $(echo
${_VIRTUALENVWRAPPER_API})
+ elif [ -n "$ZSH_VERSION" ] ; then
+ compctl -K virtualenvwrapper_load $(echo ${_VIRTUALENVWRAPPER_API})
+ fi
+}
+
virtualenvwrapper_setup_lazy_loader
+virtualenvwrapper_setup_lazy_completion
--
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]