|
22 | 22 | from dataclasses import dataclass, field |
23 | 23 | from http import HTTPStatus |
24 | 24 | from pathlib import Path |
25 | | -from typing import Annotated, Any, ClassVar, Literal, NamedTuple, TypeAlias, TypedDict, TypeVar |
| 25 | +from typing import Annotated, Any, ClassVar, Literal, NamedTuple, TypeAlias, TypedDict, TypeVar, cast |
26 | 26 | from typing_extensions import Self |
27 | 27 |
|
28 | 28 | if sys.version_info >= (3, 11): |
@@ -906,9 +906,9 @@ async def suggest_typeshed_obsolete(obsolete: Obsolete, session: aiohttp.ClientS |
906 | 906 | async with _repo_lock: |
907 | 907 | branch_name = f"{BRANCH_PREFIX}/{normalize(obsolete.distribution)}" |
908 | 908 | subprocess.check_call(["git", "checkout", "-B", branch_name, "origin/main"]) |
909 | | - obs_string = tomlkit.string(obsolete.obsolete_since_version) |
910 | | - obs_string.comment(f"Released on {obsolete.obsolete_since_date.date().isoformat()}") |
911 | | - update_metadata(obsolete.distribution, obsolete_since=obs_string) |
| 909 | + obsolete_t = cast(dict[str, object], tomlkit.inline_table()) |
| 910 | + obsolete_t.update({"version": obsolete.obsolete_since_version, "date": obsolete.obsolete_since_date.date().isoformat()}) |
| 911 | + update_metadata(obsolete.distribution, obsolete_since=obsolete_t) |
912 | 912 | body = "\n".join(f"{k}: {v}" for k, v in obsolete.links.items()) |
913 | 913 | subprocess.check_call(["git", "commit", "--all", "-m", f"{title}\n\n{body}"]) |
914 | 914 | if action_level <= ActionLevel.local: |
|
0 commit comments