Skip to content

Commit 519a7df

Browse files
authored
Improve a few dataclass reprs in stubsabot (#11050)
1 parent 5fd2e9b commit 519a7df

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

scripts/stubsabot.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
import urllib.parse
1818
import zipfile
1919
from collections.abc import Iterator, Mapping, Sequence
20-
from dataclasses import dataclass
20+
from dataclasses import dataclass, field
2121
from http import HTTPStatus
2222
from pathlib import Path
2323
from typing import Annotated, Any, ClassVar, NamedTuple
@@ -105,8 +105,8 @@ def _best_effort_version(version: VersionString) -> packaging.version.Version:
105105
class PypiInfo:
106106
distribution: str
107107
pypi_root: str
108-
releases: dict[VersionString, list[ReleaseDownload]]
109-
info: dict[str, Any]
108+
releases: dict[VersionString, list[ReleaseDownload]] = field(repr=False)
109+
info: dict[str, Any] = field(repr=False)
110110

111111
def get_release(self, *, version: VersionString) -> PypiReleaseDownload:
112112
# prefer wheels, since it's what most users will get / it's pretty easy to mess up MANIFEST
@@ -244,7 +244,7 @@ def get_github_api_headers() -> Mapping[str, str]:
244244
@dataclass
245245
class GithubInfo:
246246
repo_path: str
247-
tags: list[dict[str, Any]]
247+
tags: list[dict[str, Any]] = field(repr=False)
248248

249249

250250
async def get_github_repo_info(session: aiohttp.ClientSession, stub_info: StubInfo) -> GithubInfo | None:
@@ -323,7 +323,7 @@ def _plural_s(num: int, /) -> str:
323323
return "s" if num != 1 else ""
324324

325325

326-
@dataclass
326+
@dataclass(repr=False)
327327
class DiffAnalysis:
328328
MAXIMUM_NUMBER_OF_FILES_TO_LIST: ClassVar[int] = 7
329329
py_files: list[FileInfo]

0 commit comments

Comments
 (0)