From fb9ce95184c6c4fb597235c39d334871183d2032 Mon Sep 17 00:00:00 2001 From: Mauricio Cruz <67650037+mauriciocruzdeveloper@users.noreply.github.com> Date: Mon, 25 Mar 2024 22:09:51 -0300 Subject: [PATCH] cli[patch]: Fix Tuple typing problem when create new langchain app (#19141) Thank you for contributing to LangChain! When run command langchain app new my-app, i get this error: File "/home/mauricio/.local/lib/python3.8/site-packages/langchain_cli/utils/pyproject.py", line 15, in pyproject_toml: Path, local_editable_dependencies: Iterable[tuple[str, Path]] TypeError: 'type' object is not subscriptable This PR fix the error. --- libs/cli/langchain_cli/utils/pyproject.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/cli/langchain_cli/utils/pyproject.py b/libs/cli/langchain_cli/utils/pyproject.py index 6bf85417e7d..07ce465e2c1 100644 --- a/libs/cli/langchain_cli/utils/pyproject.py +++ b/libs/cli/langchain_cli/utils/pyproject.py @@ -1,5 +1,5 @@ from pathlib import Path -from typing import Any, Dict, Iterable +from typing import Any, Dict, Iterable, Tuple from tomlkit import dump, inline_table, load from tomlkit.items import InlineTable @@ -12,7 +12,7 @@ def _get_dep_inline_table(path: Path) -> InlineTable: def add_dependencies_to_pyproject_toml( - pyproject_toml: Path, local_editable_dependencies: Iterable[tuple[str, Path]] + pyproject_toml: Path, local_editable_dependencies: Iterable[Tuple[str, Path]] ) -> None: """Add dependencies to pyproject.toml.""" with open(pyproject_toml, encoding="utf-8") as f: