Skip to content

Commit

Permalink
Revert "Remove unnecessary pyright supressions (#13287)"
Browse files Browse the repository at this point in the history
This reverts commit 445858c.
  • Loading branch information
AlexWaygood authored Dec 24, 2024
1 parent e5c5318 commit f6a816b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions lib/ts_utils/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ def read_metadata(distribution: str) -> StubMetadata:
assert isinstance(tools_settings, dict)
assert tools_settings.keys() <= _KNOWN_METADATA_TOOL_FIELDS.keys(), f"Unrecognised tool for {distribution!r}"
for tool, tk in _KNOWN_METADATA_TOOL_FIELDS.items():
settings_for_tool: object = tools_settings.get(tool, {})
settings_for_tool: object = tools_settings.get(tool, {}) # pyright: ignore[reportUnknownMemberType]
assert isinstance(settings_for_tool, dict)
for key in settings_for_tool:
assert key in tk, f"Unrecognised {tool} key {key!r} for {distribution!r}"
Expand Down Expand Up @@ -311,9 +311,9 @@ def update_metadata(distribution: str, **new_values: object) -> tomlkit.TOMLDocu
data = tomlkit.load(file)
except FileNotFoundError:
raise NoSuchStubError(f"Typeshed has no stubs for {distribution!r}!") from None
data.update(new_values)
data.update(new_values) # pyright: ignore[reportUnknownMemberType] # tomlkit.TOMLDocument.update is partially typed
with path.open("w", encoding="UTF-8") as file:
tomlkit.dump(data, file)
tomlkit.dump(data, file) # pyright: ignore[reportUnknownMemberType] # tomlkit.dump has partially unknown Mapping type
return data


Expand Down
2 changes: 1 addition & 1 deletion lib/ts_utils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from packaging.requirements import Requirement

try:
from termcolor import colored as colored
from termcolor import colored as colored # pyright: ignore[reportAssignmentType]
except ImportError:

def colored(text: str, color: str | None = None, **kwargs: Any) -> str: # type: ignore[misc]
Expand Down

0 comments on commit f6a816b

Please sign in to comment.