Skip to content

Commit 73739af

Browse files
⬆️🪝 Update pre-commit hook astral-sh/ruff-pre-commit to v0.8.4 (#345)
This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [astral-sh/ruff-pre-commit](https://redirect.github.com/astral-sh/ruff-pre-commit) | repository | patch | `v0.8.2` -> `v0.8.4` | Note: The `pre-commit` manager in Renovate is not supported by the `pre-commit` maintainers or community. Please do not report any problems there, instead [create a Discussion in the Renovate repository](https://redirect.github.com/renovatebot/renovate/discussions/new) if you have any questions. --- ### Release Notes <details> <summary>astral-sh/ruff-pre-commit (astral-sh/ruff-pre-commit)</summary> ### [`v0.8.4`](https://redirect.github.com/astral-sh/ruff-pre-commit/releases/tag/v0.8.4) [Compare Source](https://redirect.github.com/astral-sh/ruff-pre-commit/compare/v0.8.3...v0.8.4) See: https://github.com/astral-sh/ruff/releases/tag/0.8.4 ### [`v0.8.3`](https://redirect.github.com/astral-sh/ruff-pre-commit/releases/tag/v0.8.3) [Compare Source](https://redirect.github.com/astral-sh/ruff-pre-commit/compare/v0.8.2...v0.8.3) See: https://github.com/astral-sh/ruff/releases/tag/0.8.3 </details> --- ### Configuration 📅 **Schedule**: Branch creation - "on the first day of the month" (UTC), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR was generated by [Mend Renovate](https://mend.io/renovate/). View the [repository job log](https://developer.mend.io/github/cda-tum/mqt-predictor). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS44NS4wIiwidXBkYXRlZEluVmVyIjoiMzkuODUuMCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiZGVwZW5kZW5jaWVzIiwicHJlLWNvbW1pdCJdfQ==--> --------- Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Nils Quetschlich <nils.quetschlich@tum.de>
1 parent 46454c9 commit 73739af

File tree

4 files changed

+15
-8
lines changed

4 files changed

+15
-8
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ repos:
5757

5858
# Python linting and formatting using ruff
5959
- repo: https://github.com/astral-sh/ruff-pre-commit
60-
rev: v0.8.2
60+
rev: v0.8.4
6161
hooks:
6262
- id: ruff
6363
args: ["--fix", "--show-fixes"]

tests/compilation/test_predictor_rl.py

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

33
from __future__ import annotations
44

5+
import re
56
from pathlib import Path
67

78
import pytest
@@ -23,7 +24,7 @@ def test_predictor_env_reset_from_string() -> None:
2324

2425
def test_predictor_env_esp_error() -> None:
2526
"""Test the predictor environment with ESP as figure of merit and missing calibration data."""
26-
with pytest.raises(ValueError, match="Missing calibration data for ESP calculation on ibm_montreal."):
27+
with pytest.raises(ValueError, match=re.escape("Missing calibration data for ESP calculation on ibm_montreal.")):
2728
rl.Predictor(figure_of_merit="estimated_success_probability", device_name="ibm_montreal")
2829

2930

@@ -42,7 +43,8 @@ def test_qcompile_with_newly_trained_models() -> None:
4243
model_path = Path(rl.helper.get_path_trained_model() / (model_name + ".zip"))
4344
if not model_path.exists():
4445
with pytest.raises(
45-
FileNotFoundError, match="The RL model is not trained yet. Please train the model before using it."
46+
FileNotFoundError,
47+
match=re.escape("The RL model is not trained yet. Please train the model before using it."),
4648
):
4749
rl.qcompile(qc, figure_of_merit=figure_of_merit, device_name=device)
4850

@@ -61,7 +63,7 @@ def test_qcompile_with_newly_trained_models() -> None:
6163
def test_qcompile_with_false_input() -> None:
6264
"""Test the qcompile function with false input."""
6365
qc = get_benchmark("dj", 1, 5)
64-
with pytest.raises(ValueError, match="figure_of_merit must not be None if predictor_singleton is None."):
66+
with pytest.raises(ValueError, match=re.escape("figure_of_merit must not be None if predictor_singleton is None.")):
6567
rl.helper.qcompile(qc, None, "quantinuum_h2")
66-
with pytest.raises(ValueError, match="device_name must not be None if predictor_singleton is None."):
68+
with pytest.raises(ValueError, match=re.escape("device_name must not be None if predictor_singleton is None.")):
6769
rl.helper.qcompile(qc, "expected_fidelity", None)

tests/device_selection/test_helper_ml.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
from __future__ import annotations
44

5+
import re
6+
57
import pytest
68

79
from mqt.bench import benchmark_generator
@@ -10,7 +12,9 @@
1012

1113
def test_load_and_save_training_data() -> None:
1214
"""Test the loading and saving of the training data."""
13-
with pytest.raises(FileNotFoundError, match="Training data not found. Please run the training script first."):
15+
with pytest.raises(
16+
FileNotFoundError, match=re.escape("Training data not found. Please run the training script first.")
17+
):
1418
ml.helper.load_training_data("false_input") # type: ignore[arg-type]
1519

1620
training_data, names_list, scores_list = ml.helper.load_training_data()

tests/device_selection/test_predictor_ml.py

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

33
from __future__ import annotations
44

5+
import re
56
import sys
67
from pathlib import Path
78
from typing import Literal
@@ -39,7 +40,7 @@ def test_train_and_predictor_random_forest_classifier() -> None:
3940
assert 0 <= elem <= 1
4041

4142
with pytest.raises(
42-
FileNotFoundError, match="The ML model is not trained yet. Please train the model before using it."
43+
FileNotFoundError, match=re.escape("The ML model is not trained yet. Please train the model before using it.")
4344
):
4445
ml.helper.predict_device_for_figure_of_merit(qc, "false_input") # type: ignore[arg-type]
4546

@@ -99,7 +100,7 @@ def test_compile_all_circuits_for_dev_and_fom() -> None:
99100
dump(qc, f)
100101

101102
if sys.platform == "win32":
102-
with pytest.warns(RuntimeWarning, match="Timeout is not supported on Windows."):
103+
with pytest.warns(RuntimeWarning, match=re.escape("Timeout is not supported on Windows.")):
103104
predictor.compile_all_circuits_devicewise(
104105
device_name="ionq_harmony",
105106
timeout=100,

0 commit comments

Comments
 (0)