def _prepare_environment(ctx: Context, env_file: str, is_install_deps: bool) -> None: """ Prepare the AEA project environment. :param ctx: a context object. :param env_file: the path to the envrionemtn file. :param is_install_deps: whether to install the dependencies """ load_env_file(env_file) if is_install_deps: requirements_path = REQUIREMENTS if Path(REQUIREMENTS).exists() else None do_install(ctx, requirement=requirements_path)
def _prepare_environment(click_context, env_file: str, is_install_deps: bool) -> None: """ Prepare the AEA project environment. :param click_context: the click context :param env_file: the path to the envrionemtn file. :param is_install_deps: whether to install the dependencies """ load_env_file(env_file) if is_install_deps: if Path("requirements.txt").exists(): click_context.invoke(install, requirement="requirements.txt") else: click_context.invoke(install)
def _prepare_environment(ctx: Context, env_file: str, is_install_deps: bool) -> None: """ Prepare the AEA project environment. :param ctx: a context object. :param env_file: the path to the envrionemtn file. :param is_install_deps: whether to install the dependencies """ load_env_file(env_file) if is_install_deps: if Path("requirements.txt").exists(): do_install(ctx, requirement="requirements.txt") else: do_install(ctx)
def test_load_env_file(): """Test load env file updates process environment variables.""" load_env_file(Path(ROOT_DIR) / "tests" / "data" / "dot_env_file") assert os.getenv("TEST") == "yes"