'Build the virtualenv and install the project into it.
Always build projects with a virtualenv.
:param build_env: Build environment to pass commands and execution through.'

def setup_environment(self):

    self.build_env.update_build(state=BUILD_STATE_INSTALLING)
    with self.project.repo_nonblockinglock(version=self.version, max_lock_age=getattr(settings, 'REPO_LOCK_SECONDS', 30)):
        self.python_env.delete_existing_build_dir()
        self.python_env.setup_base()
        self.python_env.install_core_requirements()
        self.python_env.install_user_requirements()
        self.python_env.install_package()
