Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions packages/smithy-core/src/smithy_core/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from decimal import Decimal
from math import isinf, isnan
from types import UnionType
from typing import Any, TypeVar, overload
from typing import Any, overload

from .exceptions import ExpectationNotMetError

Expand Down Expand Up @@ -67,11 +67,8 @@ def epoch_seconds_to_datetime(value: int | float) -> datetime:
return epoch_zero + timedelta(seconds=value)


_T = TypeVar("_T")


@overload
def expect_type(typ: type[_T], value: Any) -> _T: ...
def expect_type[T](typ: type[T], value: Any) -> T: ...


# For some reason, mypy and other type checkers don't treat Union like a full type
Expand Down
4 changes: 3 additions & 1 deletion packages/smithy-core/tests/unit/test_type_registry.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
import re

import pytest
from smithy_core.deserializers import DeserializeableShape, ShapeDeserializer
from smithy_core.documents import Document, TypeRegistry
Expand Down Expand Up @@ -42,7 +44,7 @@ def test_contains_sub_registry():
def test_get_no_match():
registry = TypeRegistry({ShapeID("com.example#Test"): TestShape})

with pytest.raises(KeyError, match="Unknown shape: com.example#Test2"):
with pytest.raises(KeyError, match=re.escape("Unknown shape: com.example#Test2")):
registry[ShapeID("com.example#Test2")]


Expand Down
2 changes: 1 addition & 1 deletion packages/smithy-core/tests/unit/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ def test_strict_parse_float_raises(given: str) -> None:
(float("NaN"), "NaN"),
(float("Infinity"), "Infinity"),
(float("-Infinity"), "-Infinity"),
(Decimal("1"), "1.0"),
(Decimal(1), "1.0"),
(Decimal("1.0"), "1.0"),
(Decimal("1.1"), "1.1"),
(Decimal("1.1e3"), "1.1E+3"),
Expand Down
1 change: 0 additions & 1 deletion packages/smithy-http/src/smithy_http/aio/crt.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
# pyright: reportMissingTypeStubs=false,reportUnknownMemberType=false
# flake8: noqa: F811
from collections.abc import AsyncGenerator, AsyncIterable
from copy import deepcopy
from dataclasses import dataclass
Expand Down
2 changes: 1 addition & 1 deletion scripts/changelog/new-release.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def collect_next_release_changes(next_release_dir: Path) -> list[dict[str, Any]]
sys.exit(1)

# Sort changes by type for consistent ordering
changes.sort(key=lambda c: (CHANGE_TYPES_ORDER[c["type"]]))
changes.sort(key=lambda c: CHANGE_TYPES_ORDER[c["type"]])

return changes

Expand Down
38 changes: 19 additions & 19 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading