community: Bump ruff version to 0.9 (#29206)

Co-authored-by: Erick Friis <erick@langchain.dev>
This commit is contained in:
Christophe Bornet
2025-02-08 02:21:10 +01:00
committed by GitHub
parent 30f6c9f5c8
commit 723031d548
166 changed files with 5415 additions and 530 deletions

View File

@@ -131,7 +131,10 @@ async def test_fireworks_async_agenerate(llm: Fireworks) -> None:
@pytest.mark.scheduled
async def test_fireworks_multiple_prompts_async_agenerate(llm: Fireworks) -> None:
output = await llm.agenerate(
["How is the weather in New York today?", "I'm pickle rick"]
[
"How is the weather in New York today?",
"I'm pickle rick",
]
)
assert isinstance(output, LLMResult)
assert isinstance(output.generations, list)

View File

@@ -72,9 +72,9 @@ def test_outlines_regex(llm: Outlines) -> None:
assert isinstance(output, str)
assert re.match(
ip_regex, output
), f"Generated output '{output}' is not a valid IP address"
assert re.match(ip_regex, output), (
f"Generated output '{output}' is not a valid IP address"
)
def test_outlines_type_constraints(llm: Outlines) -> None:
@@ -113,11 +113,11 @@ def test_outlines_grammar(llm: Outlines) -> None:
output = llm.invoke("Here is a complex arithmetic expression: ")
# Validate the output is a non-empty string
assert (
isinstance(output, str) and output.strip()
), "Output should be a non-empty string"
assert isinstance(output, str) and output.strip(), (
"Output should be a non-empty string"
)
# Use a simple regex to check if the output contains basic arithmetic operations and numbers
assert re.search(
r"[\d\+\-\*/\(\)]+", output
), f"Generated output '{output}' does not appear to be a valid arithmetic expression"
assert re.search(r"[\d\+\-\*/\(\)]+", output), (
f"Generated output '{output}' does not appear to be a valid arithmetic expression"
)