packages/autorest.python/scripts/install.py [10:43]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
if not sys.version_info >= (3, 9, 0):
    raise Exception("Autorest for Python extension requires Python 3.9 at least")

try:
    import pip
except ImportError:
    raise Exception("Your Python installation doesn't have pip available")

try:
    import venv
except ImportError:
    raise Exception("Your Python installation doesn't have venv available")


# Now we have pip and Py >= 3.9, go to work

from pathlib import Path

from venvtools import ExtendedEnvBuilder, python_run

_ROOT_DIR = Path(__file__).parent.parent


def main():
    venv_path = _ROOT_DIR / "venv"
    if venv_path.exists():
        env_builder = venv.EnvBuilder(with_pip=True)
        venv_context = env_builder.ensure_directories(venv_path)
    else:
        env_builder = ExtendedEnvBuilder(with_pip=True, upgrade_deps=True)
        env_builder.create(venv_path)
        venv_context = env_builder.context

        python_run(venv_context, "pip", ["install", "-U", "pip"])
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



packages/typespec-python/scripts/install.py [10:43]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
if not sys.version_info >= (3, 9, 0):
    raise Exception("Autorest for Python extension requires Python 3.9 at least")

try:
    import pip
except ImportError:
    raise Exception("Your Python installation doesn't have pip available")

try:
    import venv
except ImportError:
    raise Exception("Your Python installation doesn't have venv available")


# Now we have pip and Py >= 3.9, go to work

from pathlib import Path

from venvtools import ExtendedEnvBuilder, python_run

_ROOT_DIR = Path(__file__).parent.parent


def main():
    venv_path = _ROOT_DIR / "venv"
    if venv_path.exists():
        env_builder = venv.EnvBuilder(with_pip=True)
        venv_context = env_builder.ensure_directories(venv_path)
    else:
        env_builder = ExtendedEnvBuilder(with_pip=True, upgrade_deps=True)
        env_builder.create(venv_path)
        venv_context = env_builder.context

        python_run(venv_context, "pip", ["install", "-U", "pip"])
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



