Well, think about it, probably you’re already aware about all advantages of using virtualenvs instead the system-wide pythons
I didn’t make up my mind about it, honestly. I know what virtualenvs are used for, but I was quite happy with my one and only latest python setup working for everything I need.
let’s say you want to test a particular plugin with certain versions of a python tool
Not sure, what you intend to do, but all Sublime Text plugins run on ST’s python 3.3 interpreter. Therefore testing ST plugins against several python versions is somewhat useless in the first place.
It was required only for plugins, which runs a deamon as separate (python) process. This is what Jedi - Autocompletion or the LSP packages do in order to run CPU expensive functions separately from ST. But IMHO this is a quite special use case of ST plugins.
An external tool / python script (pylint, flake, …) used by any ST plugin such as SublimeLinter is installed via pip and is just called as any other executable. Testing something against several python versions is not required here, too. Most of such packages even allow to setup explicit paths to the executables, which is the more direct way and maybe simpler than manipulating the environment.
The one and only every day life use case I can imagine was to create a dedicated python setup which is used by ST only.
Customizing the environment for a subprocess …
If you want to see how simple it is to add custom environment variables to an executed program, you can have a look onto the following PR. It does exactly that.
About your problem with other plugins not using your virtualenv variables …
The point is to get the environment updated before any other package is loaded.
To achieve that, you’ll need to name your package in a way that ensures it is loaded “first”.
Look at 0_package_control_loader.sublime-package
as an example, which is used by Package Control to extend python’s sys.path
to publish dependencies which are needed by some packages.
You’d maybe need a 0_virtualenv.sublime-package
to publish the environment early enough. In this case it is importand the package is zipped and placed in the Installed Packages
path.