azure-sdk-tools/packaging_tools/venvtools.py
def create_venv_with_package(packages):
    """Create a venv with these packages in a temp dir and yielf the env.

    packages should be an iterable of pip version instructio (e.g. package~=1.2.3)
    """
    with tempfile.TemporaryDirectory() as tempdir:
        myenv = create(tempdir, with_pip=True)
        pip_call = [
            myenv.env_exe,
            "-m",
            "pip",
            "install",
        ]
        subprocess.check_call(pip_call + ['-U', 'pip'])
        if packages:
            subprocess.check_call(pip_call + packages)
        yield myenv
def create_venv_with_package(packages):
    with tempfile.TemporaryDirectory() as tempdir:
        myenv = create(tempdir, with_pip=True)
        pip_call = [
            myenv.env_exe,
            "-m",
            "pip",
            "install",
        ]
        subprocess.check_call(pip_call + ['-U', 'pip'])
        if packages:
            subprocess.check_call(pip_call + packages)
        yield myenv
def create_venv_with_package ( packages ) : with tempfile . TemporaryDirectory ( ) as tempdir : myenv = create ( tempdir , with_pip = True ) pip_call = [ myenv . env_exe , "-m" , "pip" , "install" , ] subprocess . check_call ( pip_call + [ '-U' , 'pip' ] ) if packages : subprocess . check_call ( pip_call + packages ) yield myenv
Create a venv with these packages in a temp dir and yielf the env.

    packages should be an iterable of pip version instructio (e.g. package~=1.2.3)
Create a venv with these packages in a temp dir and yielf the env .