Skip to content

Commit 06f4dd3

Browse files
committed
Use distutils to get the site-packages directory. Fixes #112
1 parent 6fdb2e3 commit 06f4dd3

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

docs/en/history.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,13 @@ dev
1515
fix for :bbissue:`134`)
1616
- Extend :ref:`command-rmvirtualenv` to allow removing more than one
1717
environment at a time. (contributed by :bbuser:`ciberglo`)
18+
- Change the definition of
19+
``virtualenvwrapper_get_site_packages_dir`` to ask ``distutils``
20+
for the ``site-packages`` directory instead of trying to build the
21+
path ourselves in the shell script. This should resolve
22+
:bbissue:`112` and improve support for Python interpreters other
23+
than C Python. Thanks to Carl Meyer and Dario Bertini for their
24+
contributions toward the fix.
1825

1926
3.1
2027

tests/test_cp.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
test_dir=$(cd $(dirname $0) && pwd)
44
source "$test_dir/setup.sh"
55

6-
#unset HOOK_VERBOSE_OPTION
7-
86
setUp () {
97
rm -rf "$WORKON_HOME"
108
mkdir -p "$WORKON_HOME"

virtualenvwrapper.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -609,7 +609,7 @@ function virtualenvwrapper_get_python_version {
609609

610610
# Prints the path to the site-packages directory for the current environment.
611611
function virtualenvwrapper_get_site_packages_dir {
612-
echo "$VIRTUAL_ENV/lib/python`virtualenvwrapper_get_python_version`/site-packages"
612+
"$VIRTUAL_ENV/bin/python" -c "import distutils; print(distutils.sysconfig.get_python_lib())"
613613
}
614614

615615
# Path management for packages outside of the virtual env.

0 commit comments

Comments
 (0)