mirror of
https://github.com/hwchase17/langchain.git
synced 2025-10-23 11:16:58 +00:00
refactor(cli): target ruff 310 (#32985)
Use union types for optional parameters
This commit is contained in:
@@ -5,7 +5,7 @@ import re
|
||||
import shutil
|
||||
import subprocess
|
||||
from pathlib import Path
|
||||
from typing import Annotated, Optional, cast
|
||||
from typing import Annotated, cast
|
||||
|
||||
import typer
|
||||
from typing_extensions import TypedDict
|
||||
@@ -66,14 +66,14 @@ def new(
|
||||
),
|
||||
],
|
||||
name_class: Annotated[
|
||||
Optional[str],
|
||||
str | None,
|
||||
typer.Option(
|
||||
help="The name of the integration in PascalCase. e.g. `MyIntegration`."
|
||||
" This is used to name classes like `MyIntegrationVectorStore`",
|
||||
),
|
||||
] = None,
|
||||
src: Annotated[
|
||||
Optional[list[str]],
|
||||
list[str] | None,
|
||||
typer.Option(
|
||||
help="The name of the single template file to copy."
|
||||
" e.g. `--src integration_template/chat_models.py "
|
||||
@@ -81,7 +81,7 @@ def new(
|
||||
),
|
||||
] = None,
|
||||
dst: Annotated[
|
||||
Optional[list[str]],
|
||||
list[str] | None,
|
||||
typer.Option(
|
||||
help="The relative path to the integration package to place the new file in"
|
||||
". e.g. `my-integration/my_integration.py`",
|
||||
@@ -220,7 +220,7 @@ def create_doc(
|
||||
),
|
||||
],
|
||||
name_class: Annotated[
|
||||
Optional[str],
|
||||
str | None,
|
||||
typer.Option(
|
||||
help=(
|
||||
"The PascalCase name of the integration (e.g. `OpenAI`, "
|
||||
|
Reference in New Issue
Block a user