File tree Expand file tree Collapse file tree 4 files changed +46
-1
lines changed Expand file tree Collapse file tree 4 files changed +46
-1
lines changed Original file line number Diff line number Diff line change
1
+ 2010-12-26 Doug Hellmann <
[email protected] >
2
+
3
+ * virtualenvwrapper.sh (virtualenvwrapper_get_python_version): Use
4
+ python's -V option and cut to get the version instead of a python
5
+ one-liner.
6
+
1
7
2010-12-24 Doug Hellmann <
[email protected] >
2
8
3
9
* virtualenvwrapper.sh (cpvirtualenv): Ensure that both pre hooks
Original file line number Diff line number Diff line change @@ -44,5 +44,10 @@ test_no_workon_home () {
44
44
WORKON_HOME=" $old_home "
45
45
}
46
46
47
+ test_get_site_packages_dir () {
48
+ d=$( virtualenvwrapper_get_site_packages_dir)
49
+ assertTrue " [ -d $d ]"
50
+ }
51
+
47
52
48
53
. " $test_dir /shunit2"
Original file line number Diff line number Diff line change
1
+ #! /bin/sh
2
+
3
+ # set -x
4
+
5
+ test_dir=$( cd $( dirname $0 ) && pwd)
6
+
7
+ export WORKON_HOME=" $( echo ${TMPDIR:-/ tmp} /WORKON_HOME | sed ' s|//|/|g' ) "
8
+
9
+ oneTimeSetUp () {
10
+ rm -rf " $WORKON_HOME "
11
+ mkdir -p " $WORKON_HOME "
12
+ source " $test_dir /../virtualenvwrapper.sh"
13
+ mkvirtualenv testing
14
+ }
15
+
16
+ oneTimeTearDown () {
17
+ rm -rf " $WORKON_HOME "
18
+ }
19
+
20
+ setUp () {
21
+ echo
22
+ rm -f " $test_dir /catch_output"
23
+ }
24
+
25
+ test_get_python_version () {
26
+ expected=" $( $VIRTUAL_ENV /bin/python -V 2>&1 | cut -f2 -d' ' ) "
27
+ echo " Expecting: $expected "
28
+ vers=$( virtualenvwrapper_get_python_version)
29
+ echo " Got : $vers "
30
+ assertSame " $expected " " $vers "
31
+ }
32
+
33
+
34
+ . " $test_dir /shunit2"
Original file line number Diff line number Diff line change @@ -407,7 +407,7 @@ virtualenvwrapper_get_python_version () {
407
407
# Uses the Python from the virtualenv because we're trying to
408
408
# determine the version installed there so we can build
409
409
# up the path to the site-packages directory.
410
- python -c ' import sys; print ".".join(str(p) for p in sys.version_info[:2]) '
410
+ python -V 2>&1 | cut -f2 -d ' '
411
411
}
412
412
413
413
# Prints the path to the site-packages directory for the current environment.
You can’t perform that action at this time.
0 commit comments