Skip to content

Commit e6b0201

Browse files
committed
Use VIRTUALENVWRAPPER_VIRTUALENV in cpvirtualenv. fixes #104
1 parent 51ba8db commit e6b0201

File tree

3 files changed

+19
-1
lines changed

3 files changed

+19
-1
lines changed

docs/en/history.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
Release History
33
===============
44

5+
dev
6+
7+
- Use VIRTUALENVWRAPPER_VIRTUALENV in `cpvirtualenv` (:bbissue:`104`).
8+
59
2.7.2
610

711
- Move setup code for tab completion later in the startup code so

tests/test_cp.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,20 @@ test_virtual_env_variable () {
4343
assertTrue "$WORKON_HOME not in $VIRTUAL_ENV" "echo $VIRTUAL_ENV | grep -q $WORKON_HOME"
4444
}
4545

46+
fake_virtualenv () {
47+
typeset envname="$1"
48+
touch "$envname/fake_virtualenv_was_here"
49+
virtualenv $@
50+
}
51+
52+
test_virtualenvwrapper_virtualenv_variable () {
53+
mkvirtualenv "source"
54+
export VIRTUALENVWRAPPER_VIRTUALENV=fake_virtualenv
55+
cpvirtualenv "source" "destination"
56+
unset VIRTUALENVWRAPPER_VIRTUALENV
57+
assertTrue "wrapper was not run" "[ -f $VIRTUAL_ENV/fake_virtualenv_was_here ]"
58+
}
59+
4660
test_source_relocatable () {
4761
mkvirtualenv "source"
4862
(cd tests/testpackage && python setup.py install) >/dev/null 2>&1

virtualenvwrapper.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -612,7 +612,7 @@ cpvirtualenv() {
612612
\chmod a+x "$script"
613613
done
614614

615-
virtualenv "$target_env" --relocatable
615+
"$VIRTUALENVWRAPPER_VIRTUALENV" "$target_env" --relocatable
616616
\sed "s/VIRTUAL_ENV\(.*\)$env_name/VIRTUAL_ENV\1$new_env/g" < "$source_env/bin/activate" > "$target_env/bin/activate"
617617

618618
(cd "$WORKON_HOME" && (

0 commit comments

Comments
 (0)