def create_virtualenv()

in dh_virtualenv/deployment.py [0:0]


    def create_virtualenv(self):
        # Specify interpreter and virtual environment options
        if self.builtin_venv:
            virtualenv = [self.python, '-m', 'venv']

            if self.use_system_packages:
                virtualenv.append('--system-site-packages')

        else:
            virtualenv = ['virtualenv']

            if self.use_system_packages:
                virtualenv.append('--system-site-packages')
            
            if self.python:
                virtualenv.extend(('--python', self.python))

            if self.setuptools:
                virtualenv.append('--setuptools')

            if self.verbose:
                virtualenv.append('--verbose')

        # Add in any user supplied virtualenv args
        if self.extra_virtualenv_arg:
            virtualenv.extend(self.extra_virtualenv_arg)

        virtualenv.append(self.package_dir)
        subprocess.check_call(virtualenv)

        # Due to Python bug https://bugs.python.org/issue24875
        # venv doesn't bootstrap pip/setuptools in the virtual
        # environment with --system-site-packages .
        # The workaround is to reconfigure it with this option
        # after it has been created.
        if self.builtin_venv and self.use_system_packages:
            virtualenv.append('--system-site-packages')
            subprocess.check_call(virtualenv)