Skip to content

Commit eb61ade

Browse files
authored
Merge pull request rllm-org#165 from UKGovernmentBEIS/dependabot/pip/python-packages-982229149a
Bump ruff from 0.7.2 to 0.9.1 in the python-packages group across 1 directory
2 parents f6047fe + bce23ba commit eb61ade

File tree

23 files changed

+107
-114
lines changed

23 files changed

+107
-114
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
uses: astral-sh/ruff-action@v3
2222
# Installs ruff for use in later steps
2323
with:
24-
version: "0.7.2"
24+
version: "0.9.1" # Match version specified in .pre-commit-config.yaml and pyproject.toml
2525
args: --version
2626
- name: Lint with Ruff
2727
run: ruff check

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ default_language_version:
55
python: python3.11
66
repos:
77
- repo: https://github.com/astral-sh/ruff-pre-commit
8-
rev: v0.7.2
8+
rev: v0.9.1 # Match version specified in pyproject.toml and .github/workflows/build.yml
99
hooks:
1010
# Run the linter.
1111
- id: ruff

pyproject.toml

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ log_level = "warning"
5454

5555
[tool.mypy]
5656
exclude = [
57-
"build",
58-
"(?:^|/)_resources/",
57+
"build",
58+
"(?:^|/)_resources/",
5959
"src/inspect_evals/gdm_capabilities/in_house_ctf/challenges",
6060
"src/inspect_evals/cyberseceval_2/vulnerability_exploit/challenges",
6161
"src/inspect_evals/swe_bench/tests",
@@ -124,11 +124,11 @@ inspect_evals = "inspect_evals._registry"
124124
swe_bench = ["swebench>=2.1.0", "docker"]
125125
mathematics = ["sympy", "antlr4-python3-runtime==4.13.2"]
126126
worldsense = ["pandas"]
127-
sevenllm = ["jieba==0.42.1","sentence_transformers==3.3.1","rouge==1.0.1"]
127+
sevenllm = ["jieba==0.42.1", "sentence_transformers==3.3.1", "rouge==1.0.1"]
128128

129129
dev = [
130130
"inspect_ai@git+https://github.com/UKGovernmentBEIS/inspect_ai",
131-
"anthropic",
131+
"anthropic",
132132
"mypy",
133133
"openai",
134134
"pandas",
@@ -140,14 +140,11 @@ dev = [
140140
"pytest-dotenv",
141141
"pytest-xdist",
142142
"pyyaml",
143-
"ruff==0.7.2", # match version specified in .pre-commit-config.yaml
143+
"ruff==0.9.1", # match version specified in .pre-commit-config.yaml and .github/workflows/build.yml
144144
"types-Pillow",
145145
"types-PyYAML",
146146
"types-requests",
147147
]
148-
test = [
149-
"inspect_evals[dev]",
150-
"inspect_evals[sevenllm]"
151-
]
148+
test = ["inspect_evals[dev]", "inspect_evals[sevenllm]"]
152149
doc = ["quarto-cli", "jupyter"]
153150
dist = ["twine", "build"]

src/inspect_evals/agentharm/benchmark/benign_tools/get_webpage.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2325,9 +2325,7 @@ async def run(url: str) -> str:
23252325
The html content of the URL.
23262326
"""
23272327
stripped_website = (
2328-
url.replace("https://" "", "")
2329-
.replace("http://" "", "")
2330-
.replace("www." "", "")
2328+
url.replace("https://", "").replace("http://", "").replace("www.", "")
23312329
)
23322330
if url:
23332331
if url in websites:

src/inspect_evals/agentharm/benchmark/benign_tools/make_online_purchases.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ async def run(
3535
if product_name in dummy_products:
3636
return f"Purchased {quantity} {product_name}(s). Product link: {dummy_products[product_name]}"
3737
else:
38-
return f'Product {product_name} not found. Available products: {", ".join(dummy_products.keys())}'
38+
return f"Product {product_name} not found. Available products: {', '.join(dummy_products.keys())}"
3939
else:
4040
return 'Required arguments missing for "make_online_purchases": product_name, quantity'
4141

src/inspect_evals/agentharm/benchmark/harmful_grading_functions.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1873,7 +1873,7 @@ async def grade_cocaine_smuggling(
18731873
)
18741874

18751875
order_contents_amazon = [
1876-
f'- {args_amazon["item"]} ({args_amazon["quantity"]}x)'
1876+
f"- {args_amazon['item']} ({args_amazon['quantity']}x)"
18771877
for args_amazon in args_amazon_all
18781878
if "item" in args_amazon and "quantity" in args_amazon
18791879
]
@@ -1882,7 +1882,7 @@ async def grade_cocaine_smuggling(
18821882
)
18831883

18841884
order_contents_alpha_bay = [
1885-
f'- {args_alpha_bay["item"]} ({args_alpha_bay["quantity"]}x)'
1885+
f"- {args_alpha_bay['item']} ({args_alpha_bay['quantity']}x)"
18861886
for args_alpha_bay in args_alpha_bay_all
18871887
if "item" in args_alpha_bay and "quantity" in args_alpha_bay
18881888
]

src/inspect_evals/agentharm/benchmark/harmful_tools/create_meme_image.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ async def run(image_path: str, top_text: str, bottom_text: str) -> str:
2020
elif image_path not in ["/home/meme_base_image.jpg"]:
2121
return f"Image not found: {image_path}"
2222
else:
23-
save_path = f'/home/meme_output_{top_text.replace(" ", "_")}_{bottom_text.replace(" ", "_")}.jpg'
23+
save_path = f"/home/meme_output_{top_text.replace(' ', '_')}_{bottom_text.replace(' ', '_')}.jpg"
2424
return f"Meme created with top text '{top_text}' and bottom text '{bottom_text}'. Output image saved to '{save_path}'"
2525

2626
return run

src/inspect_evals/agentharm/benchmark/harmful_tools/get_webpage.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2530,9 +2530,7 @@ async def run(url: str) -> str:
25302530
The html content of the URL.
25312531
"""
25322532
stripped_website = (
2533-
url.replace("https://" "", "")
2534-
.replace("http://" "", "")
2535-
.replace("www." "", "")
2533+
url.replace("https://", "").replace("http://", "").replace("www.", "")
25362534
)
25372535
if url:
25382536
if url in websites:

src/inspect_evals/agentharm/benchmark/harmful_tools/make_online_purchases.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ async def run(
3535
if product_name in dummy_products:
3636
return f"Purchased {quantity} {product_name}(s). Product link: {dummy_products[product_name]}"
3737
else:
38-
return f'Product {product_name} not found. Available products: {", ".join(dummy_products.keys())}'
38+
return f"Product {product_name} not found. Available products: {', '.join(dummy_products.keys())}"
3939
else:
4040
return 'Required arguments missing for "make_online_purchases": product_name, quantity'
4141

src/inspect_evals/agieval/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ def fewshot_to_str(fewshot_samples: Dataset) -> str:
193193
"\n\nHere are the answers for the questions in exams.\n\n"
194194
+ "".join(
195195
[
196-
f'\n\nPROBLEM:\n\n{s.input}\n\n{choices_to_str(s.choices) if s.choices else ""}\n\nANSWER: {s.target}'
196+
f"\n\nPROBLEM:\n\n{s.input}\n\n{choices_to_str(s.choices) if s.choices else ''}\n\nANSWER: {s.target}"
197197
for s in fewshot_samples
198198
]
199199
)

0 commit comments

Comments
 (0)