Skip to content

Commit b0e84b2

Browse files
pre-commit updates
1 parent 55625e6 commit b0e84b2

File tree

5 files changed

+11
-11
lines changed

5 files changed

+11
-11
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
exclude: ^python/tests/__snapshots__/
22
repos:
33
- repo: https://github.com/astral-sh/ruff-pre-commit
4-
rev: v0.7.3
4+
rev: v0.11.0
55
hooks:
66
- id: ruff
77
args: [--fix, --exit-non-zero-on-fix]
88
- id: ruff-format
99
- repo: https://github.com/astral-sh/uv-pre-commit
1010
# uv version.
11-
rev: 0.5.31
11+
rev: 0.6.8
1212
hooks:
1313
- id: uv-lock

pyproject.toml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,8 @@ ignore = [
8989
# allow star imports
9090
"F405",
9191
"F403",
92-
# Dont care if cls isnt typed explicitly in classmethod
93-
"ANN102",
94-
# Same for self
95-
"ANN101",
92+
# allow shadow builtin import
93+
"A004",
9694
# Allow single line docstrings on multiple lines
9795
"D200",
9896
"D212",

python/egglog/functionalize.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,4 +88,4 @@ def wrapper(*args):
8888
wrapper.__name__ = f.__name__
8989

9090
# Partially apply the wrapper function with the current values of the free vars
91-
return cast(T, partial(wrapper, *(v for _, _, v, _ in additional_arg_filtered)))
91+
return cast("T", partial(wrapper, *(v for _, _, v, _ in additional_arg_filtered)))

python/egglog/runtime.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ def __hash__(self) -> int:
286286
return hash((id(self.__egg_decls_thunk__), self.__egg_tp__))
287287

288288
# Support unioning like types
289-
def __or__(self, __value: type) -> object:
289+
def __or__(self, *, __value: type) -> object:
290290
return Union[self, __value] # noqa: UP007
291291

292292
@property

python/tests/test_program_gen.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,14 @@
22
from __future__ import annotations
33

44
import inspect
5-
from types import FunctionType
6-
from typing import cast
5+
from typing import TYPE_CHECKING, cast
76

87
from egglog import *
98
from egglog.exp.program_gen import *
109

10+
if TYPE_CHECKING:
11+
from types import FunctionType
12+
1113

1214
class Math(Expr):
1315
def __init__(self, value: i64Like) -> None: ...
@@ -85,6 +87,6 @@ def test_py_object():
8587
egraph.register(evalled)
8688
egraph.run((to_program_ruleset | eval_program_rulseset | program_gen_ruleset).saturate())
8789
with egraph.set_current():
88-
res = cast(FunctionType, evalled.as_py_object.eval())
90+
res = cast("FunctionType", evalled.as_py_object.eval())
8991
assert res(1, 2) == 13
9092
assert inspect.getsource(res)

0 commit comments

Comments
 (0)