Will run all CI because of _test change, but future PRs against CLI will
only trigger the new CLI one

Has a bunch of file changes related to formatting/linting.

No mypy yet - coming soon
This commit is contained in:
Erick Friis
2023-10-26 17:01:31 -07:00
committed by GitHub
parent 231d553824
commit 4db8d82c55
14 changed files with 150 additions and 48 deletions

View File

@@ -2,13 +2,14 @@
Manage installable hub packages.
"""
import typer
from typing import Optional
from typing_extensions import Annotated
from pathlib import Path
import re
import shutil
import subprocess
import re
from pathlib import Path
from typing import Optional
import typer
from typing_extensions import Annotated
hub = typer.Typer(no_args_is_help=True, add_completion=False)

View File

@@ -2,21 +2,23 @@
Manage LangServe application projects.
"""
import typer
from typing import Optional, List
from typing_extensions import Annotated
from pathlib import Path
import shutil
import subprocess
from pathlib import Path
from typing import List, Optional
import tomli
import typer
from langserve.packages import get_langserve_export, list_packages
from typing_extensions import Annotated
from langchain_cli.utils.events import create_events
from langchain_cli.utils.git import (
copy_repo,
update_repo,
parse_dependency_string,
update_repo,
)
from langchain_cli.utils.packages import get_package_root
from langchain_cli.utils.events import create_events
from langserve.packages import list_packages, get_langserve_export
import tomli
REPO_DIR = Path(typer.get_app_dir("langchain")) / "git_repos"
@@ -101,7 +103,8 @@ def add(
if len(repo) != 0:
if len(dependencies) != 0:
raise typer.BadParameter(
"Cannot specify both repo and dependencies. Please specify one or the other."
"Cannot specify both repo and dependencies. "
"Please specify one or the other."
)
dependencies = [f"git+https://github.com/{r}" for r in repo]
@@ -144,7 +147,8 @@ def add(
# detect name conflict
if langserve_export["package_name"] in installed_names:
typer.echo(
f"Package with name {langserve_export['package_name']} already installed. Skipping...",
f"Package with name {langserve_export['package_name']} already "
"installed. Skipping...",
)
continue
@@ -154,7 +158,8 @@ def add(
destination_path = package_dir / inner_api_path
if destination_path.exists():
typer.echo(
f"Endpoint {langserve_export['package_name']} already exists. Skipping...",
f"Endpoint {langserve_export['package_name']} already exists. "
"Skipping...",
)
continue
copy_repo(source_path, destination_path)