2023-07-21 19:37:21 +00:00
|
|
|
[tool.poetry]
|
|
|
|
name = "langchain-monorepo"
|
|
|
|
version = "0.0.1"
|
|
|
|
description = "LangChain mono-repo"
|
|
|
|
authors = []
|
|
|
|
license = "MIT"
|
|
|
|
readme = "README.md"
|
2023-08-04 14:31:39 +00:00
|
|
|
repository = "https://www.github.com/langchain-ai/langchain"
|
2023-07-21 19:37:21 +00:00
|
|
|
|
|
|
|
|
|
|
|
[tool.poetry.dependencies]
|
2024-09-16 22:08:22 +00:00
|
|
|
python = ">=3.9,<4.0"
|
2023-07-21 19:37:21 +00:00
|
|
|
|
2023-10-29 22:50:09 +00:00
|
|
|
[tool.poetry.group.lint.dependencies]
|
infra: update mypy 1.10, ruff 0.5 (#23721)
```python
"""python scripts/update_mypy_ruff.py"""
import glob
import tomllib
from pathlib import Path
import toml
import subprocess
import re
ROOT_DIR = Path(__file__).parents[1]
def main():
for path in glob.glob(str(ROOT_DIR / "libs/**/pyproject.toml"), recursive=True):
print(path)
with open(path, "rb") as f:
pyproject = tomllib.load(f)
try:
pyproject["tool"]["poetry"]["group"]["typing"]["dependencies"]["mypy"] = (
"^1.10"
)
pyproject["tool"]["poetry"]["group"]["lint"]["dependencies"]["ruff"] = (
"^0.5"
)
except KeyError:
continue
with open(path, "w") as f:
toml.dump(pyproject, f)
cwd = "/".join(path.split("/")[:-1])
completed = subprocess.run(
"poetry lock --no-update; poetry install --with typing; poetry run mypy . --no-color",
cwd=cwd,
shell=True,
capture_output=True,
text=True,
)
logs = completed.stdout.split("\n")
to_ignore = {}
for l in logs:
if re.match("^(.*)\:(\d+)\: error:.*\[(.*)\]", l):
path, line_no, error_type = re.match(
"^(.*)\:(\d+)\: error:.*\[(.*)\]", l
).groups()
if (path, line_no) in to_ignore:
to_ignore[(path, line_no)].append(error_type)
else:
to_ignore[(path, line_no)] = [error_type]
print(len(to_ignore))
for (error_path, line_no), error_types in to_ignore.items():
all_errors = ", ".join(error_types)
full_path = f"{cwd}/{error_path}"
try:
with open(full_path, "r") as f:
file_lines = f.readlines()
except FileNotFoundError:
continue
file_lines[int(line_no) - 1] = (
file_lines[int(line_no) - 1][:-1] + f" # type: ignore[{all_errors}]\n"
)
with open(full_path, "w") as f:
f.write("".join(file_lines))
subprocess.run(
"poetry run ruff format .; poetry run ruff --select I --fix .",
cwd=cwd,
shell=True,
capture_output=True,
text=True,
)
if __name__ == "__main__":
main()
```
2024-07-03 17:33:27 +00:00
|
|
|
ruff = "^0.5.0"
|
2023-07-12 20:20:08 +00:00
|
|
|
|
2023-10-29 23:15:18 +00:00
|
|
|
[tool.poetry.group.dev.dependencies]
|
2023-11-29 01:27:37 +00:00
|
|
|
langchain-core = { path = "libs/core/", develop = true }
|
2024-03-01 02:33:21 +00:00
|
|
|
langchain-text-splitters = { path = "libs/text-splitters", develop = true }
|
2023-12-11 21:53:30 +00:00
|
|
|
langchain-community = { path = "libs/community/", develop = true }
|
2023-11-29 01:27:37 +00:00
|
|
|
langchain = { path = "libs/langchain/", develop = true }
|
2024-01-16 18:41:14 +00:00
|
|
|
langchain-openai = { path = "libs/partners/openai", develop = true }
|
2024-02-23 20:45:47 +00:00
|
|
|
ipykernel = "^6.29.2"
|
2023-10-29 23:15:18 +00:00
|
|
|
|
2024-10-25 19:56:58 +00:00
|
|
|
[tool.poetry.group.codespell.dependencies]
|
|
|
|
codespell = "^2.2.0"
|
|
|
|
|
|
|
|
[tool.poetry.group.typing.dependencies]
|
2024-06-12 20:31:36 +00:00
|
|
|
|
2023-10-29 23:15:18 +00:00
|
|
|
[tool.poetry.group.test.dependencies]
|
2024-10-16 17:46:49 +00:00
|
|
|
langchain-experimental = { git = "https://github.com/langchain-ai/langchain-experimental.git", subdirectory = "libs/experimental" }
|
|
|
|
langchain-anthropic = { path = "libs/partners/anthropic", develop = true }
|
2024-10-30 16:35:38 +00:00
|
|
|
langchain-aws = { git = "https://github.com/langchain-ai/langchain-aws.git", subdirectory = "libs/aws" }
|
2024-10-16 17:46:49 +00:00
|
|
|
langchain-chroma = { path = "libs/partners/chroma", develop = true }
|
2024-10-30 16:35:38 +00:00
|
|
|
langchain-fireworks = { path = "libs/partners/fireworks", develop = true }
|
|
|
|
langchain-google-vertexai = { git = "https://github.com/langchain-ai/langchain-google.git", subdirectory = "libs/vertexai" }
|
|
|
|
langchain-groq = { path = "libs/partners/groq", develop = true }
|
2024-10-16 17:46:49 +00:00
|
|
|
langchain-mistralai = { path = "libs/partners/mistralai", develop = true }
|
2024-10-30 16:35:38 +00:00
|
|
|
langchain-together = { git = "https://github.com/langchain-ai/langchain-together.git", subdirectory = "libs/together" }
|
|
|
|
langchain-unstructured = { git = "https://github.com/langchain-ai/langchain-unstructured.git", subdirectory = "libs/unstructured" }
|
2024-10-16 17:46:49 +00:00
|
|
|
langgraph = { git = "https://github.com/langchain-ai/langgraph.git", subdirectory = "libs/langgraph" }
|
|
|
|
jupyter = "^1.1.1"
|
|
|
|
click = "^8.1.7"
|
2024-10-30 16:35:38 +00:00
|
|
|
aiofiles = "^24.1.0"
|
2024-10-16 17:46:49 +00:00
|
|
|
faiss-cpu = "^1.7.4"
|
2024-10-30 16:35:38 +00:00
|
|
|
grandalf = "^0.8"
|
|
|
|
lark = "^1.1.9"
|
|
|
|
pandas = "^2"
|
|
|
|
rank-bm25 = "^0.2.2"
|
|
|
|
unstructured = { version = "^0.15.12", extras = ["md"], python = "<3.13" }
|
|
|
|
wikipedia = "^1.4.0"
|
2024-10-16 17:46:49 +00:00
|
|
|
pypdf = "^5.0.0"
|
|
|
|
vcrpy = "^6.0.1"
|
2023-10-29 23:15:18 +00:00
|
|
|
|
2023-07-12 20:20:08 +00:00
|
|
|
[tool.codespell]
|
2024-01-29 20:25:53 +00:00
|
|
|
skip = '.git,*.pdf,*.svg,*.pdf,*.yaml,*.ipynb,poetry.lock,*.min.js,*.css,package-lock.json,example_data,_dist,examples,templates,*.trig'
|
2023-07-12 20:20:08 +00:00
|
|
|
# Ignore latin etc
|
|
|
|
ignore-regex = '.*(Stati Uniti|Tense=Pres).*'
|
|
|
|
# whats is a typo but used frequently in queries so kept as is
|
|
|
|
# aapply - async apply
|
|
|
|
# unsecure - typo but part of API, decided to not bother for now
|
2024-06-24 20:15:11 +00:00
|
|
|
ignore-words-list = 'momento,collison,ned,foor,reworkd,parth,whats,aapply,mysogyny,unsecure,damon,crate,aadd,symbl,precesses,accademia,nin,cann'
|
2023-11-14 20:58:22 +00:00
|
|
|
|
|
|
|
[tool.ruff]
|
|
|
|
extend-include = ["*.ipynb"]
|
2023-12-02 00:13:31 +00:00
|
|
|
extend-exclude = [
|
2024-07-11 17:59:51 +00:00
|
|
|
"docs/docs/expression_language/why.ipynb", # TODO: look into why linter errors
|
2023-12-02 00:13:31 +00:00
|
|
|
]
|
2023-11-14 20:58:22 +00:00
|
|
|
|
|
|
|
[tool.ruff.lint.per-file-ignores]
|
|
|
|
"**/{cookbook,docs}/*" = [
|
2024-07-11 17:59:51 +00:00
|
|
|
"E402", # allow imports to appear anywhere in docs
|
|
|
|
"F401", # allow "imported but unused" example code
|
|
|
|
"F811", # allow re-importing the same module, so that cells can stay independent
|
|
|
|
"F841", # allow assignments to variables that are never read -- it's example code
|
2023-11-14 20:58:22 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
# These files were failing the listed rules at the time ruff was adopted for notebooks.
|
|
|
|
# Don't require them to change at once, though we should look into them eventually.
|
|
|
|
"cookbook/gymnasium_agent_simulation.ipynb" = ["F821"]
|
|
|
|
"docs/docs/integrations/document_loaders/tensorflow_datasets.ipynb" = ["F821"]
|