ruff: add bugbear across packages (#31917)

WIP, other packages will get in next PRs
This commit is contained in:
Mason Daugherty
2025-07-08 12:22:55 -04:00
committed by GitHub
parent 5b3e29f809
commit ae210c1590
33 changed files with 59 additions and 42 deletions

View File

@@ -134,19 +134,22 @@ def add(
typer.Argument(help="The dependency to add"),
] = None,
*,
api_path: Annotated[list[str], typer.Option(help="API paths to add")] = [],
api_path: Annotated[
Optional[list[str]],
typer.Option(help="API paths to add"),
] = None,
project_dir: Annotated[
Optional[Path],
typer.Option(help="The project directory"),
] = None,
repo: Annotated[
list[str],
Optional[list[str]],
typer.Option(help="Install templates from a specific github repo instead"),
] = [],
] = None,
branch: Annotated[
list[str],
Optional[list[str]],
typer.Option(help="Install templates from a specific branch"),
] = [],
] = None,
pip: Annotated[
bool,
typer.Option(
@@ -163,6 +166,12 @@ def add(
langchain app add extraction-openai-functions
langchain app add git+ssh://git@github.com/efriis/simple-pirate.git
"""
if branch is None:
branch = []
if repo is None:
repo = []
if api_path is None:
api_path = []
if not branch and not repo:
warnings.warn(
"Adding templates from the default branch and repo is deprecated."

View File

@@ -90,7 +90,7 @@ def new(
replacements = _process_name(name)
except ValueError as e:
typer.echo(e)
raise typer.Exit(code=1)
raise typer.Exit(code=1) from None
if name_class:
if not re.match(r"^[A-Z][a-zA-Z0-9]*$", name_class):