Skip to content

Commit

Permalink
infra, multiple: Upgrade configuration for Ruff v0.2.0 (langchain-ai#…
Browse files Browse the repository at this point in the history
…16905)

## Summary

This PR upgrades LangChain's Ruff configuration in preparation for
Ruff's v0.2.0 release. (The changes are compatible with Ruff v0.1.5,
which LangChain uses today.) Specifically, we're now warning when
linter-only options are specified under `[tool.ruff]` instead of
`[tool.ruff.lint]`.

---------

Co-authored-by: Erick Friis <erick@langchain.dev>
Co-authored-by: Bagatur <baskaryan@gmail.com>
  • Loading branch information
3 people authored and Hayden Wolff committed Feb 27, 2024
1 parent 153f427 commit 29dd346
Show file tree
Hide file tree
Showing 19 changed files with 28 additions and 24 deletions.
2 changes: 1 addition & 1 deletion docs/docs/use_cases/sql/large_db.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@
}
],
"source": [
"system = f\"\"\"Return the names of the SQL tables that are relevant to the user question. \\\n",
"system = \"\"\"Return the names of the SQL tables that are relevant to the user question. \\\n",
"The tables are:\n",
"\n",
"Music\n",
Expand Down
2 changes: 1 addition & 1 deletion libs/cli/langchain_cli/integration_template/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ optional = true
[tool.poetry.group.dev.dependencies]
langchain-core = {path = "../../core", develop = true}

[tool.ruff]
[tool.ruff.lint]
select = [
"E", # pycodestyle
"F", # pyflakes
Expand Down
2 changes: 1 addition & 1 deletion libs/cli/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ ruff = "^0.1.5"
# For langserve
serve = []

[tool.ruff]
[tool.ruff.lint]
select = [
"E", # pycodestyle
"F", # pyflakes
Expand Down
10 changes: 6 additions & 4 deletions libs/community/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -260,15 +260,17 @@ extended_testing = [
]

[tool.ruff]
exclude = [
"tests/examples/non-utf8-encoding.py",
"tests/integration_tests/examples/non-utf8-encoding.py",
]

[tool.ruff.lint]
select = [
"E", # pycodestyle
"F", # pyflakes
"I", # isort
]
exclude = [
"tests/examples/non-utf8-encoding.py",
"tests/integration_tests/examples/non-utf8-encoding.py",
]

[tool.mypy]
ignore_missing_imports = "True"
Expand Down
2 changes: 1 addition & 1 deletion libs/core/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ dependencies = {}
[tool.poetry.extras]
extended_testing = ["jinja2"]

[tool.ruff]
[tool.ruff.lint]
select = [
"E", # pycodestyle
"F", # pyflakes
Expand Down
2 changes: 1 addition & 1 deletion libs/experimental/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ extended_testing = [
"jinja2",
]

[tool.ruff]
[tool.ruff.lint]
select = [
"E", # pycodestyle
"F", # pyflakes
Expand Down
8 changes: 5 additions & 3 deletions libs/langchain/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -301,14 +301,16 @@ extended_testing = [
]

[tool.ruff]
exclude = [
"tests/integration_tests/examples/non-utf8-encoding.py",
]

[tool.ruff.lint]
select = [
"E", # pycodestyle
"F", # pyflakes
"I", # isort
]
exclude = [
"tests/integration_tests/examples/non-utf8-encoding.py",
]

[tool.mypy]
ignore_missing_imports = "True"
Expand Down
2 changes: 1 addition & 1 deletion libs/partners/anthropic/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ optional = true
[tool.poetry.group.test_integration.dependencies]
langchain-core = {path = "../../core", develop = true}

[tool.ruff]
[tool.ruff.lint]
select = [
"E", # pycodestyle
"F", # pyflakes
Expand Down
2 changes: 1 addition & 1 deletion libs/partners/exa/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ optional = true
[tool.poetry.group.test_integration.dependencies]


[tool.ruff]
[tool.ruff.lint]
select = [
"E", # pycodestyle
"F", # pyflakes
Expand Down
2 changes: 1 addition & 1 deletion libs/partners/google-genai/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ types-requests = "^2.31.0.10"
types-pillow = "^10.1.0.2"
types-google-cloud-ndb = "^2.2.0.1"

[tool.ruff]
[tool.ruff.lint]
select = [
"E", # pycodestyle
"F", # pyflakes
Expand Down
2 changes: 1 addition & 1 deletion libs/partners/google-vertexai/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ optional = true
[tool.poetry.group.dev.dependencies]
langchain-core = { path = "../../core", develop = true }

[tool.ruff]
[tool.ruff.lint]
select = [
"E", # pycodestyle
"F", # pyflakes
Expand Down
2 changes: 1 addition & 1 deletion libs/partners/mistralai/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ optional = true
[tool.poetry.group.dev.dependencies]
langchain-core = {path = "../../core", develop = true}

[tool.ruff]
[tool.ruff.lint]
select = [
"E", # pycodestyle
"F", # pyflakes
Expand Down
2 changes: 1 addition & 1 deletion libs/partners/nomic/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ optional = true
[tool.poetry.group.dev.dependencies]
langchain-core = {path = "../../core", develop = true}

[tool.ruff]
[tool.ruff.lint]
select = [
"E", # pycodestyle
"F", # pyflakes
Expand Down
2 changes: 1 addition & 1 deletion libs/partners/nvidia-ai-endpoints/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ optional = true
[tool.poetry.group.dev.dependencies]
langchain-core = { path = "../../core", develop = true }

[tool.ruff]
[tool.ruff.lint]
select = [
"E", # pycodestyle
"F", # pyflakes
Expand Down
2 changes: 1 addition & 1 deletion libs/partners/nvidia-trt/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ optional = true
[tool.poetry.group.dev.dependencies]
langchain-core = { path = "../../core", develop = true }

[tool.ruff]
[tool.ruff.lint]
select = [
"E", # pycodestyle
"F", # pyflakes
Expand Down
2 changes: 1 addition & 1 deletion libs/partners/openai/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ optional = true
[tool.poetry.group.dev.dependencies]
langchain-core = {path = "../../core", develop = true}

[tool.ruff]
[tool.ruff.lint]
select = [
"E", # pycodestyle
"F", # pyflakes
Expand Down
2 changes: 1 addition & 1 deletion libs/partners/robocorp/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ optional = true
[tool.poetry.group.dev.dependencies]
langchain-core = {path = "../../core", develop = true}

[tool.ruff]
[tool.ruff.lint]
select = [
"E", # pycodestyle
"F", # pyflakes
Expand Down
2 changes: 1 addition & 1 deletion libs/partners/together/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ optional = true
[tool.poetry.group.dev.dependencies]
langchain-core = {path = "../../core", develop = true}

[tool.ruff]
[tool.ruff.lint]
select = [
"E", # pycodestyle
"F", # pyflakes
Expand Down
2 changes: 1 addition & 1 deletion templates/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ optional = true

[tool.poetry.group.typing.dependencies]

[tool.ruff]
[tool.ruff.lint]
select = [
"E", # pycodestyle
"F", # pyflakes
Expand Down

0 comments on commit 29dd346

Please sign in to comment.