ruff: more rules across the board & fixes (#31898)

* standardizes ruff dep version across all `pyproject.toml` files
* cli: ruff rules and corrections
* langchain: rules and corrections
This commit is contained in:
Mason Daugherty
2025-07-07 17:48:01 -04:00
committed by GitHub
parent 706a66eccd
commit e7eac27241
408 changed files with 2783 additions and 1671 deletions

View File

@@ -11,7 +11,9 @@ from langchain_cli.utils.packages import get_langserve_export, get_package_root
app = typer.Typer(no_args_is_help=True, add_completion=False)
app.add_typer(
template_namespace.package_cli, name="template", help=template_namespace.__doc__
template_namespace.package_cli,
name="template",
help=template_namespace.__doc__,
)
app.add_typer(app_namespace.app_cli, name="app", help=app_namespace.__doc__)
app.add_typer(
@@ -32,7 +34,7 @@ app.command(
)
def version_callback(show_version: bool) -> None:
def version_callback(show_version: bool) -> None: # noqa: FBT001
if show_version:
typer.echo(f"langchain-cli {__version__}")
raise typer.Exit
@@ -40,8 +42,8 @@ def version_callback(show_version: bool) -> None:
@app.callback()
def main(
version: bool = typer.Option(
False,
version: bool = typer.Option( # noqa: FBT001
False, # noqa: FBT003
"--version",
"-v",
help="Print the current CLI version.",
@@ -56,10 +58,12 @@ def main(
def serve(
*,
port: Annotated[
Optional[int], typer.Option(help="The port to run the server on")
Optional[int],
typer.Option(help="The port to run the server on"),
] = None,
host: Annotated[
Optional[str], typer.Option(help="The host to run the server on")
Optional[str],
typer.Option(help="The host to run the server on"),
] = None,
) -> None:
"""Start the LangServe app, whether it's a template or an app."""