Improve virtualenv support & egg-link resolution

- add sys_path= kwarg to Script & Evaluator constructors

- store sys_path for each evaluator instance

- replace get_sys_path with get_venv_path

- get_venv_path: use addsitedir to load .pth extension files

- get_venv_path: look for egg-link files in all directories in path
This commit is contained in:
immerrr
2015-04-05 00:19:11 +02:00
parent 3eaa3b954a
commit 4eb3cf7921
20 changed files with 174 additions and 86 deletions

View File

@@ -0,0 +1,2 @@
# This file is here to force git to create the directory, as *.pth files only
# add existing directories.

View File

@@ -0,0 +1 @@
/path/from/egg-link

View File

@@ -0,0 +1 @@
./dir-from-foo-pth

View File

@@ -0,0 +1 @@
import smth; smth.extend_path()

View File

@@ -0,0 +1 @@
./relative/egg-link/path

View File

@@ -0,0 +1,6 @@
import sys
sys.path.append('/path/from/smth.py')
def extend_path():
sys.path.append('/path/from/smth.py:extend_path')

View File

@@ -0,0 +1,2 @@
# This file is here to force git to create the directory, as *.pth files only
# add existing directories.

View File

@@ -0,0 +1 @@
/path/from/egg-link

View File

@@ -0,0 +1 @@
./dir-from-foo-pth

View File

@@ -0,0 +1 @@
import smth; smth.extend_path()

View File

@@ -0,0 +1 @@
./relative/egg-link/path

View File

@@ -0,0 +1,6 @@
import sys
sys.path.append('/path/from/smth.py')
def extend_path():
sys.path.append('/path/from/smth.py:extend_path')