Skip to content

Commit a11d76b

Browse files
authored
Add ruff rules for pygrep-hooks (#560)
1 parent 93346bc commit a11d76b

File tree

9 files changed

+36
-32
lines changed

9 files changed

+36
-32
lines changed

libs/knowledge-graph/ragstack_knowledge_graph/knowledge_graph.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ def _apply_schema(self):
134134
edge_type TEXT,
135135
PRIMARY KEY ((source_name, source_type), target_name, target_type, edge_type)
136136
);
137-
""" # noqa
137+
""" # noqa: E501
138138
)
139139

140140
self._session.execute(

libs/langchain/ragstack_langchain/colbert/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
try:
2-
from ragstack_colbert.base_retriever import BaseRetriever # noqa
2+
from ragstack_colbert.base_retriever import BaseRetriever # noqa: F401
33
except (ImportError, ModuleNotFoundError) as e:
44
raise ImportError(
55
"Could not import ragstack-ai-colbert. "

libs/langchain/tests/unit_tests/test_import.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
def test_import():
2-
import astrapy # noqa
3-
import cassio # noqa
4-
import langchain_core # noqa
5-
import langsmith # noqa
6-
import openai # noqa
7-
import tiktoken # noqa
8-
import unstructured # noqa
9-
from langchain.vectorstores import AstraDB # noqa
10-
from langchain_astradb import AstraDBVectorStore # noqa
2+
import astrapy # noqa: F401
3+
import cassio # noqa: F401
4+
import langchain_core # noqa: F401
5+
import langsmith # noqa: F401
6+
import openai # noqa: F401
7+
import tiktoken # noqa: F401
8+
import unstructured # noqa: F401
9+
from langchain.vectorstores import AstraDB # noqa: F401
10+
from langchain_astradb import AstraDBVectorStore # noqa: F401
1111

1212

1313
def test_meta():

libs/llamaindex/ragstack_llamaindex/colbert/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
try:
2-
from ragstack_colbert.base_retriever import BaseRetriever # noqa
2+
from ragstack_colbert.base_retriever import BaseRetriever # noqa: F401
33
except (ImportError, ModuleNotFoundError) as e:
44
raise ImportError(
55
"Could not import ragstack-ai-colbert. "

libs/llamaindex/tests/unit_tests/test_import.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22

33

44
def test_import():
5-
import astrapy # noqa
6-
import cassio # noqa
7-
import openai # noqa
8-
import tiktoken # noqa
9-
import unstructured # noqa
10-
from llama_index.vector_stores.astra_db import AstraDBVectorStore # noqa
11-
from llama_index.vector_stores.cassandra import CassandraVectorStore # noqa
5+
import astrapy # noqa: F401
6+
import cassio # noqa: F401
7+
import openai # noqa: F401
8+
import tiktoken # noqa: F401
9+
import unstructured # noqa: F401
10+
from llama_index.vector_stores.astra_db import AstraDBVectorStore # noqa: F401
11+
from llama_index.vector_stores.cassandra import CassandraVectorStore # noqa: F401
1212

1313

1414
def check_no_import(fn: callable):

libs/ragulate/ragstack_ragulate/cli.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# this must be imported first for dynamic module loading to function properly
2-
import setuptools # noqa
2+
import setuptools # noqa: F401, I001
33
import argparse
44

55
from dotenv import load_dotenv

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ select = [
7575
"N",
7676
"NPY",
7777
"PERF",
78+
"PGH",
7879
"RUF",
7980
"SIM",
8081
"TRY",

scripts/generate-changelog.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,11 @@ def main():
5858
break
5959
if package_name in IMPORTANT_DEPENDENCIES:
6060
if package_name == "langchain":
61-
version_range = f"https://datastax.github.io/ragstack-ai/api_reference/{package_version}/langchain[{version_range}]{{external-link-icon}}"
61+
version_range = (
62+
"https://datastax.github.io/ragstack-ai/api_reference/"
63+
f"{package_version}/langchain[{version_range}]"
64+
"{external-link-icon}"
65+
)
6266
extra_str = f" (via extra `{extra}`)" if extra else ""
6367
deps_str += f"\n| {package_name}{extra_str}\n| {version_range}\n"
6468

tests/unit_tests/test_ragstack.py

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
def test_import():
2-
from llama_index.vector_stores.astra_db import AstraDBVectorStore # noqa
3-
from llama_index.vector_stores.cassandra import CassandraVectorStore # noqa
4-
from langchain.vectorstores import AstraDB # noqa
5-
from langchain_astradb import AstraDBVectorStore # noqa
6-
import langchain_core # noqa
7-
import langsmith # noqa
8-
import astrapy # noqa
9-
import cassio # noqa
10-
import unstructured # noqa
11-
import openai # noqa
12-
import tiktoken # noqa
2+
import astrapy # noqa: F401
3+
import cassio # noqa: F401
4+
import langchain_core # noqa: F401
5+
import langsmith # noqa: F401
6+
import openai # noqa: F401
7+
import tiktoken # noqa: F401
8+
import unstructured # noqa: F401
9+
from langchain.vectorstores import AstraDB # noqa: F401
10+
from langchain_astradb import AstraDBVectorStore # noqa: F401
11+
from llama_index.vector_stores.cassandra import CassandraVectorStore # noqa: F401
1312

1413

1514
def test_meta():

0 commit comments

Comments
 (0)