mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-07-09 18:09:17 +08:00
[stubsabot] Use Literal and update reason field (#14904)
This commit is contained in:
@@ -161,7 +161,7 @@ class Obsolete:
|
||||
@dataclass
|
||||
class Remove:
|
||||
distribution: str
|
||||
reason: str
|
||||
reason: Literal["ships py.typed file", "unmaintained"]
|
||||
links: dict[str, str]
|
||||
|
||||
def __str__(self) -> str:
|
||||
@@ -171,7 +171,7 @@ class Remove:
|
||||
@dataclass
|
||||
class NoUpdate:
|
||||
distribution: str
|
||||
reason: str
|
||||
reason: Literal["obsolete", "no longer updated", "up to date"]
|
||||
|
||||
def __str__(self) -> str:
|
||||
return f"{colored('skipping', 'green')} ({self.reason})"
|
||||
@@ -642,7 +642,7 @@ async def determine_action_no_error_handling(
|
||||
"Typeshed release": f"{pypi_info.pypi_root}",
|
||||
"Typeshed stubs": f"https://github.com/{TYPESHED_OWNER}/typeshed/tree/main/stubs/{stub_info.distribution}",
|
||||
}
|
||||
return Remove(stub_info.distribution, reason="older than 6 months", links=links)
|
||||
return Remove(stub_info.distribution, reason="ships py.typed file", links=links)
|
||||
else:
|
||||
return NoUpdate(stub_info.distribution, "obsolete")
|
||||
if stub_info.no_longer_updated:
|
||||
@@ -654,7 +654,7 @@ async def determine_action_no_error_handling(
|
||||
"Typeshed release": f"{pypi_info.pypi_root}",
|
||||
"Typeshed stubs": f"https://github.com/{TYPESHED_OWNER}/typeshed/tree/main/stubs/{stub_info.distribution}",
|
||||
}
|
||||
return Remove(stub_info.distribution, reason="no longer updated", links=links)
|
||||
return Remove(stub_info.distribution, reason="unmaintained", links=links)
|
||||
else:
|
||||
return NoUpdate(stub_info.distribution, "no longer updated")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user