Additional functionality
artgoldberg opened this issue · 1 comments
artgoldberg commented
virtualenv-api is quite useful. Thanks.
I presume it's possible to use a VirtualEnvironment() from the Python that created the VirtualEnvironment(). The code would look like this, for example:
env = VirtualEnvironment('/path/to/environment/name')
env.install('package_foo')
# modify sys.path to use env
# now import in env's context
import bar
# perhaps modify sys.path to stop using env
If so, these two methods would be helpful:
env.activate() # modify sys.path so that imports occur in env's context
env.deactivate() # undo env.activate()
Thanks, Arthur
sjkingo commented
Thanks Arthur!
We've looked at this idea before and I've thought it's definitely worth including - have just never got around to implementing it.
Do you have capacity to implement those new methods and associated tests?