Skip to content

Commit 1c4b61b

Browse files
committed
Bump ruff version to 0.12
1 parent 667cdfb commit 1c4b61b

File tree

4 files changed

+36
-33
lines changed

4 files changed

+36
-33
lines changed

langchain/langchain_vectorize/retrievers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,9 @@ def format_docs(docs):
111111
"""The Vectorize API token."""
112112
environment: Literal["prod", "dev", "local", "staging"] = "prod"
113113
"""The Vectorize API environment."""
114-
organization: Optional[str] = None # noqa: UP007
114+
organization: Optional[str] = None
115115
"""The Vectorize organization ID."""
116-
pipeline_id: Optional[str] = None # noqa: UP007
116+
pipeline_id: Optional[str] = None
117117
"""The Vectorize pipeline ID."""
118118
num_results: int = 5
119119
"""The number of documents to return."""

langchain/pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Issues = "https://github.com/vectorize-io/integrations-python/issues"
3333
dev = [
3434
"mypy>=1.13.0",
3535
"pytest>=8.3.3",
36-
"ruff>=0.9.0,<0.10",
36+
"ruff>=0.12.7,<0.13",
3737
]
3838

3939
[tool.ruff.lint]
@@ -49,6 +49,7 @@ ignore = [
4949
pydocstyle.convention = "google"
5050
flake8-annotations.allow-star-arg-any = true
5151
flake8-annotations.mypy-init-return = true
52+
pyupgrade.keep-runtime-typing = true
5253

5354
[tool.ruff.lint.per-file-ignores]
5455
"tests/*" = [

langchain/tests/test_retrievers.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313

1414
from langchain_vectorize.retrievers import VectorizeRetriever
1515

16+
logger = logging.getLogger(__name__)
17+
1618

1719
@pytest.fixture(scope="session")
1820
def api_token() -> str:
@@ -35,7 +37,7 @@ def org_id() -> str:
3537
@pytest.fixture(scope="session")
3638
def environment() -> Literal["prod", "dev", "local", "staging"]:
3739
env = os.getenv("VECTORIZE_ENV", "prod")
38-
if env not in ["prod", "dev", "local", "staging"]:
40+
if env not in {"prod", "dev", "local", "staging"}:
3941
msg = "Invalid VECTORIZE_ENV environment variable."
4042
raise ValueError(msg)
4143
return env
@@ -78,7 +80,7 @@ def pipeline_id(api_client: v.ApiClient, org_id: str) -> Iterator[str]:
7880
],
7981
)
8082
source_connector_id = response.connectors[0].id
81-
logging.info("Created source connector %s", source_connector_id)
83+
logger.info("Created source connector %s", source_connector_id)
8284

8385
uploads_api = v.UploadsApi(api_client)
8486
upload_response = uploads_api.start_file_upload_to_connector(
@@ -109,19 +111,19 @@ def pipeline_id(api_client: v.ApiClient, org_id: str) -> Iterator[str]:
109111
msg = "Upload failed:"
110112
raise ValueError(msg)
111113
else:
112-
logging.info("Upload successful")
114+
logger.info("Upload successful")
113115

114116
ai_platforms = connectors_api.get_ai_platform_connectors(org_id)
115117
builtin_ai_platform = next(
116118
c.id for c in ai_platforms.ai_platform_connectors if c.type == "VECTORIZE"
117119
)
118-
logging.info("Using AI platform %s", builtin_ai_platform)
120+
logger.info("Using AI platform %s", builtin_ai_platform)
119121

120122
vector_databases = connectors_api.get_destination_connectors(org_id)
121123
builtin_vector_db = next(
122124
c.id for c in vector_databases.destination_connectors if c.type == "VECTORIZE"
123125
)
124-
logging.info("Using destination connector %s", builtin_vector_db)
126+
logger.info("Using destination connector %s", builtin_vector_db)
125127

126128
pipeline_response = pipelines.create_pipeline(
127129
org_id,
@@ -148,14 +150,14 @@ def pipeline_id(api_client: v.ApiClient, org_id: str) -> Iterator[str]:
148150
),
149151
)
150152
pipeline_id = pipeline_response.data.id
151-
logging.info("Created pipeline %s", pipeline_id)
153+
logger.info("Created pipeline %s", pipeline_id)
152154

153155
yield pipeline_id
154156

155157
try:
156158
pipelines.delete_pipeline(org_id, pipeline_id)
157159
except Exception:
158-
logging.exception("Failed to delete pipeline %s", pipeline_id)
160+
logger.exception("Failed to delete pipeline %s", pipeline_id)
159161

160162

161163
def test_retrieve_init_args(

langchain/uv.lock

Lines changed: 23 additions & 23 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)