Skip to content

Commit

Permalink
Remove Unused "type: ignore" comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Avasam committed Dec 30, 2024
1 parent d8e087f commit 5b9d787
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion setuptools/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ def reinitialize_command(
) -> _Command:
cmd = _Command.reinitialize_command(self, command, reinit_subcommands)
vars(cmd).update(kw)
return cmd # pyright: ignore[reportReturnType] # pypa/distutils#307
return cmd

@abstractmethod
def initialize_options(self) -> None:
Expand Down
3 changes: 1 addition & 2 deletions setuptools/command/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,5 +180,4 @@ def do_egg_install(self) -> None:
# XXX Python 3.1 doesn't see _nc if this is inside the class
install.sub_commands = [
cmd for cmd in orig.install.sub_commands if cmd[0] not in install._nc
] + install.new_commands # type: ignore[operator]
# TODO: Type sub_commands/new_commands to avoid variance issues in pypa/distutils (like python/typeshed#11951)
] + install.new_commands
6 changes: 2 additions & 4 deletions setuptools/command/sdist.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,10 @@ class sdist(orig.sdist):
]

distribution: Distribution # override distutils.dist.Distribution with setuptools.dist.Distribution
# TODO: Mark class-level mutables as ClassVars in pypa/distutils (like python/typeshed#12403)
negative_opt: ClassVar[dict[str, str]] = {} # type: ignore[misc]
negative_opt: ClassVar[dict[str, str]] = {}

README_EXTENSIONS = ['', '.rst', '.txt', '.md']
# TODO: Mark some class-level tuples as as not fixed-length pypa/distutils (like python/typeshed#12403)
READMES = tuple('README{0}'.format(ext) for ext in README_EXTENSIONS) # type: ignore[assignment]
READMES = tuple('README{0}'.format(ext) for ext in README_EXTENSIONS)

def run(self) -> None:
self.run_command('egg_info')
Expand Down
2 changes: 2 additions & 0 deletions setuptools/tests/test_build_ext.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

import os
import sys
from importlib.util import cache_from_source as _compiled_file_name
Expand Down

0 comments on commit 5b9d787

Please sign in to comment.