Skip to content

Commit a58aec4

Browse files
committed
chore: fix linting & typing errors
1 parent edea187 commit a58aec4

File tree

4 files changed

+26
-26
lines changed

4 files changed

+26
-26
lines changed

src/askui/tools/testing/execution_tools.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def __init__(self, base_dir: Path) -> None:
2525
super().__init__(
2626
name="list_executions",
2727
description="List executions with optional filtering",
28-
input_schema=jsonref.replace_refs( # type: ignore
28+
input_schema=jsonref.replace_refs(
2929
ListExecutionToolInput.model_json_schema(),
3030
lazy_load=False,
3131
proxies=False,
@@ -60,7 +60,7 @@ def __init__(self, base_dir: Path) -> None:
6060
super().__init__(
6161
name="retrieve_execution",
6262
description="Retrieve an execution by id",
63-
input_schema=jsonref.replace_refs( # type: ignore
63+
input_schema=jsonref.replace_refs(
6464
RetrieveExecutionToolInput.model_json_schema(),
6565
lazy_load=False,
6666
proxies=False,
@@ -92,7 +92,7 @@ def __init__(self, base_dir: Path) -> None:
9292
super().__init__(
9393
name="create_execution",
9494
description="Create a new execution",
95-
input_schema=jsonref.replace_refs( # type: ignore
95+
input_schema=jsonref.replace_refs(
9696
CreateExecutionToolInput.model_json_schema(),
9797
lazy_load=False,
9898
proxies=False,
@@ -125,7 +125,7 @@ def __init__(self, base_dir: Path) -> None:
125125
super().__init__(
126126
name="modify_execution",
127127
description="Modify an existing execution",
128-
input_schema=jsonref.replace_refs( # type: ignore
128+
input_schema=jsonref.replace_refs(
129129
ModifyExecutionToolInput.model_json_schema(),
130130
lazy_load=False,
131131
proxies=False,
@@ -160,7 +160,7 @@ def __init__(self, base_dir: Path) -> None:
160160
super().__init__(
161161
name="delete_execution",
162162
description="Delete an execution",
163-
input_schema=jsonref.replace_refs( # type: ignore
163+
input_schema=jsonref.replace_refs(
164164
DeleteExecutionToolInput.model_json_schema(),
165165
lazy_load=False,
166166
proxies=False,

src/askui/tools/testing/feature_tools.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def __init__(self, base_dir: Path) -> None:
2626
super().__init__(
2727
name="create_feature",
2828
description="Create a new feature",
29-
input_schema=jsonref.replace_refs( # type: ignore
29+
input_schema=jsonref.replace_refs(
3030
CreateFeatureToolInput.model_json_schema(),
3131
lazy_load=False,
3232
proxies=False,
@@ -49,7 +49,7 @@ def __init__(self, base_dir: Path) -> None:
4949
super().__init__(
5050
name="retrieve_feature",
5151
description="Retrieve a feature",
52-
input_schema=jsonref.replace_refs( # type: ignore
52+
input_schema=jsonref.replace_refs(
5353
RetrieveFeatureToolInput.model_json_schema(),
5454
lazy_load=False,
5555
proxies=False,
@@ -72,7 +72,7 @@ def __init__(self, base_dir: Path) -> None:
7272
super().__init__(
7373
name="list_features",
7474
description="List features with optional filtering",
75-
input_schema=jsonref.replace_refs( # type: ignore
75+
input_schema=jsonref.replace_refs(
7676
ListFeatureToolInput.model_json_schema(),
7777
lazy_load=False,
7878
proxies=False,
@@ -96,7 +96,7 @@ def __init__(self, base_dir: Path) -> None:
9696
super().__init__(
9797
name="modify_feature",
9898
description="Modify an existing feature",
99-
input_schema=jsonref.replace_refs( # type: ignore
99+
input_schema=jsonref.replace_refs(
100100
ModifyFeatureToolInput.model_json_schema(),
101101
lazy_load=False,
102102
proxies=False,
@@ -119,7 +119,7 @@ def __init__(self, base_dir: Path) -> None:
119119
super().__init__(
120120
name="delete_feature",
121121
description="Delete a feature",
122-
input_schema=jsonref.replace_refs( # type: ignore
122+
input_schema=jsonref.replace_refs(
123123
DeleteFeatureToolInput.model_json_schema(),
124124
lazy_load=False,
125125
proxies=False,

src/askui/tools/testing/scenario_tools.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def __init__(self, base_dir: Path) -> None:
2626
super().__init__(
2727
name="create_scenario",
2828
description="Create a new scenario",
29-
input_schema=jsonref.replace_refs( # type: ignore
29+
input_schema=jsonref.replace_refs(
3030
CreateScenarioToolInput.model_json_schema(),
3131
lazy_load=False,
3232
proxies=False,
@@ -49,7 +49,7 @@ def __init__(self, base_dir: Path) -> None:
4949
super().__init__(
5050
name="retrieve_scenario",
5151
description="Retrieve a scenario",
52-
input_schema=jsonref.replace_refs( # type: ignore
52+
input_schema=jsonref.replace_refs(
5353
RetrieveScenarioToolInput.model_json_schema(),
5454
lazy_load=False,
5555
proxies=False,
@@ -72,7 +72,7 @@ def __init__(self, base_dir: Path) -> None:
7272
super().__init__(
7373
name="list_scenarios",
7474
description="List scenarios with optional filtering",
75-
input_schema=jsonref.replace_refs( # type: ignore
75+
input_schema=jsonref.replace_refs(
7676
ListScenariosToolInput.model_json_schema(),
7777
lazy_load=False,
7878
proxies=False,
@@ -96,7 +96,7 @@ def __init__(self, base_dir: Path) -> None:
9696
super().__init__(
9797
name="modify_scenario",
9898
description="Modify an existing scenario",
99-
input_schema=jsonref.replace_refs( # type: ignore
99+
input_schema=jsonref.replace_refs(
100100
ModifyScenarioToolInput.model_json_schema(),
101101
lazy_load=False,
102102
proxies=False,
@@ -121,7 +121,7 @@ def __init__(self, base_dir: Path) -> None:
121121
super().__init__(
122122
name="delete_scenario",
123123
description="Delete a scenario",
124-
input_schema=jsonref.replace_refs( # type: ignore
124+
input_schema=jsonref.replace_refs(
125125
DeleteScenarioToolInput.model_json_schema(),
126126
lazy_load=False,
127127
proxies=False,

tests/unit/utils/test_not_given.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,30 @@
11
import pytest
22
from pydantic import ValidationError
33

4-
from src.askui.utils.not_given import NOT_GIVEN, BaseModelWithNotGiven, NotGiven
4+
from askui.utils.not_given import NOT_GIVEN, BaseModelWithNotGiven, NotGiven
55

66

77
class DummyModel(BaseModelWithNotGiven):
88
value: int | NotGiven = NOT_GIVEN
99

1010

11-
def test_notgiven_singleton():
11+
def test_notgiven_singleton() -> None:
1212
assert NotGiven() is NOT_GIVEN
1313
assert NotGiven() is NotGiven()
1414
assert repr(NOT_GIVEN) == "NOT_GIVEN"
1515
assert str(NOT_GIVEN) == "NOT_GIVEN"
1616
assert not bool(NOT_GIVEN)
1717

1818

19-
def test_notgiven_as_method_param():
19+
def test_notgiven_as_method_param() -> None:
2020
def func(x: int | NotGiven = NOT_GIVEN) -> int:
2121
return 42 if isinstance(x, NotGiven) else x
2222

2323
assert func() == 42
2424
assert func(5) == 5
2525

2626

27-
def test_notgiven_in_condition():
27+
def test_notgiven_in_condition() -> None:
2828
fallback = 123
2929
val = NOT_GIVEN
3030
result = val if val is not NOT_GIVEN else fallback
@@ -34,14 +34,14 @@ def test_notgiven_in_condition():
3434
assert result2 == 99
3535

3636

37-
def test_notgivenfield_in_pydantic_model():
37+
def test_notgivenfield_in_pydantic_model() -> None:
3838
m1 = DummyModel()
3939
assert m1.value is NOT_GIVEN
4040
m2 = DummyModel(value=7)
4141
assert m2.value == 7
4242

4343

44-
def test_notgivenfield_serialization():
44+
def test_notgivenfield_serialization() -> None:
4545
m = DummyModel()
4646
dumped = m.model_dump()
4747
# Should not include 'value' if NOT_GIVEN
@@ -51,7 +51,7 @@ def test_notgivenfield_serialization():
5151
assert "value" in dumped2 and dumped2["value"] == 10
5252

5353

54-
def test_notgivenfield_json_dump():
54+
def test_notgivenfield_json_dump() -> None:
5555
m = DummyModel()
5656
json_str = m.model_dump_json()
5757
# Should not include 'value' in JSON if NOT_GIVEN
@@ -61,24 +61,24 @@ def test_notgivenfield_json_dump():
6161
assert json_str2 == '{"value":11}'
6262

6363

64-
def test_notgiven_equality():
64+
def test_notgiven_equality() -> None:
6565
assert NOT_GIVEN == NotGiven()
6666
assert NOT_GIVEN is NotGiven()
6767
assert NOT_GIVEN != 0
6868
assert NOT_GIVEN is not None
6969
assert NOT_GIVEN != "NOT_GIVEN"
7070

7171

72-
def test_notgivenfield_validation():
72+
def test_notgivenfield_validation() -> None:
7373
# Should accept int or NOT_GIVEN
7474
DummyModel(value=NOT_GIVEN)
7575
DummyModel(value=5)
7676
# Should raise for wrong type
7777
with pytest.raises(ValidationError):
78-
DummyModel(value="bad") # type: ignore
78+
DummyModel(value="bad")
7979

8080

81-
def test_notgivenfield_deserialization():
81+
def test_notgivenfield_deserialization() -> None:
8282
# Should default to NOT_GIVEN if missing
8383
m = DummyModel.model_validate({})
8484
assert m.value is NOT_GIVEN

0 commit comments

Comments
 (0)