views:

25

answers:

1

In SO question 3692928, I showed how I compiled and installed matplotlib in a virtualenv. One thing I did was suboptimal though—I manually set the basedirlist in setup.cfg and PREFIX in make.osx.

setup.cfg

[directories]
basedirlist = /Users/matthew/.virtualenvs/matplotlib-test

make.osx

PREFIX=/Users/matthew/.virtualenvs/matplotlib-test

Is there a way that I can automatically set these to the currently activated virtualenv?

A: 

Use the VIRTUAL_ENV environment variable:

setup.cfg

[directories]
basedirlist = ${VIRTUAL_ENV}

make.osx

PREFIX=${VIRTUAL_ENV}
Matthew Rankin