added virtualenv hooks
merging with upstream