Skip to content

Commit 20a4391

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent ba1eb22 commit 20a4391

File tree

7 files changed

+25
-20
lines changed

7 files changed

+25
-20
lines changed

modify_changelog.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ def find_unreleased_section(lines):
7777

7878
def update_changelog_version(file_path: Path, new_version: str) -> None:
7979
"""Update changelog for version bump - replaces UNRELEASED with versioned section."""
80-
today = datetime.datetime.now(tz=datetime.timezone.utc).strftime("%Y-%m-%d")
80+
today = datetime.datetime.now(tz=datetime.UTC).strftime("%Y-%m-%d")
8181
content = file_path.read_text()
8282
new_section = f"## UNRELEASED\n\n## {new_version} ({today})"
8383
content = content.replace("## UNRELEASED", new_section, 1)

python/egglog/bindings.pyi

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@ from collections.abc import Callable
22
from datetime import timedelta
33
from fractions import Fraction
44
from pathlib import Path
5-
from typing import Any, Generic, Protocol, TypeAlias, TypeVar
6-
7-
from typing_extensions import final
5+
from typing import Any, Generic, Protocol, TypeAlias, TypeVar, final
86

97
__all__ = [
108
"ActionCommand",

python/egglog/declarations.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,22 @@
88

99
from dataclasses import dataclass, field
1010
from functools import cached_property
11-
from typing import TYPE_CHECKING, ClassVar, Literal, Protocol, TypeAlias, TypeVar, Union, cast, runtime_checkable
11+
from typing import (
12+
TYPE_CHECKING,
13+
ClassVar,
14+
Literal,
15+
Protocol,
16+
Self,
17+
TypeAlias,
18+
TypeVar,
19+
Union,
20+
assert_never,
21+
cast,
22+
runtime_checkable,
23+
)
1224
from uuid import UUID
1325
from weakref import WeakValueDictionary
1426

15-
from typing_extensions import Self, assert_never
16-
1727
from .bindings import Value
1828

1929
if TYPE_CHECKING:

python/egglog/deconstruct.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def get_literal_value(x: PyObject) -> object: ...
4747

4848

4949
@overload
50-
def get_literal_value(x: UnstableFn[T, Unpack[TS]]) -> Callable[[Unpack[TS]], T] | None: ...
50+
def get_literal_value(x: UnstableFn[T, *TS]) -> Callable[[Unpack[TS]], T] | None: ...
5151

5252

5353
@overload
@@ -118,10 +118,10 @@ def get_callable_args(x: T, fn: None = ...) -> tuple[BaseExpr, ...]: ...
118118

119119

120120
@overload
121-
def get_callable_args(x: T, fn: Callable[[Unpack[TS]], T]) -> tuple[Unpack[TS]] | None: ...
121+
def get_callable_args(x: T, fn: Callable[[Unpack[TS]], T]) -> tuple[*TS] | None: ...
122122

123123

124-
def get_callable_args(x: T, fn: Callable[[Unpack[TS]], T] | None = None) -> tuple[Unpack[TS]] | None:
124+
def get_callable_args(x: T, fn: Callable[[Unpack[TS]], T] | None = None) -> tuple[*TS] | None:
125125
"""
126126
Gets all the arguments of an expression.
127127
If a function is provided, it will only return the arguments if the expression is a call

python/egglog/egraph_state.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,10 @@
88
from base64 import standard_b64decode, standard_b64encode
99
from collections import defaultdict
1010
from dataclasses import dataclass, field, replace
11-
from typing import TYPE_CHECKING, Literal, overload
11+
from typing import TYPE_CHECKING, Literal, assert_never, overload
1212
from uuid import UUID
1313

1414
import cloudpickle
15-
from typing_extensions import assert_never
1615

1716
from . import bindings
1817
from .declarations import *

python/egglog/thunk.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,15 @@ def right(self) -> V:
3333

3434

3535
@dataclass
36-
class Thunk(Generic[T, Unpack[TS]]):
36+
class Thunk(Generic[T, *TS]):
3737
"""
3838
Cached delayed function call.
3939
"""
4040

41-
state: Resolved[T] | Unresolved[T, Unpack[TS]] | Resolving | Error
41+
state: Resolved[T] | Unresolved[T, *TS] | Resolving | Error
4242

4343
@classmethod
44-
def fn(cls, fn: Callable[[Unpack[TS]], T], *args: Unpack[TS], context: str | None = None) -> Thunk[T, Unpack[TS]]:
44+
def fn(cls, fn: Callable[[Unpack[TS]], T], *args: *TS, context: str | None = None) -> Thunk[T, *TS]:
4545
"""
4646
Create a thunk based on some functions and some partial args.
4747
@@ -80,9 +80,9 @@ class Resolved(Generic[T]):
8080

8181

8282
@dataclass
83-
class Unresolved(Generic[T, Unpack[TS]]):
83+
class Unresolved(Generic[T, *TS]):
8484
fn: Callable[[Unpack[TS]], T]
85-
args: tuple[Unpack[TS]]
85+
args: tuple[*TS]
8686
context: str | None
8787

8888

python/egglog/type_constraint_solver.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@
55
from collections import defaultdict
66
from dataclasses import dataclass, field
77
from itertools import chain, repeat
8-
from typing import TYPE_CHECKING
9-
10-
from typing_extensions import assert_never
8+
from typing import TYPE_CHECKING, assert_never
119

1210
from .declarations import *
1311

0 commit comments

Comments
 (0)