Resolve GitHub Actions failures

This commit is contained in:
Adam Turner 2024-01-14 02:57:58 +00:00
parent f8e8b4745e
commit 1de54e62bd
3 changed files with 11 additions and 5 deletions

View File

@ -126,7 +126,9 @@ if TYPE_CHECKING:
@overload
def __getitem__(self, key: str) -> Domain: ... # NoQA: E704
def __getitem__(self, key): raise NotImplementedError # NoQA: E704
def __setitem__(self, key: str, value: Domain) -> NoReturn: raise NotImplementedError # NoQA: E704
def __setitem__(
self, key: str, value: Domain,
) -> NoReturn: raise NotImplementedError # NoQA: E704
def __delitem__(self, key: str) -> NoReturn: raise NotImplementedError # NoQA: E704
def __iter__(self) -> NoReturn: raise NotImplementedError # NoQA: E704
def __len__(self) -> NoReturn: raise NotImplementedError # NoQA: E704

View File

@ -155,7 +155,7 @@ def init_console(
locale_dir = _LOCALE_DIR
try:
# encoding is ignored
language, _ = locale.getlocale(locale.LC_MESSAGES) # type: ignore[attr-defined]
language, _ = locale.getlocale(locale.LC_MESSAGES)
except AttributeError:
# LC_MESSAGES is not always defined. Fallback to the default language
# in case it is not.

View File

@ -22,7 +22,9 @@ _MSG = (
if sys.platform == 'win32':
class _StrPath(WindowsPath):
def replace(self, old: str, new: str, count: int = -1, /) -> str: # type: ignore[override]
def replace( # type: ignore[override]
self, old: str, new: str, count: int = -1, /,
) -> str:
# replace exists in both Path and str;
# in Path it makes filesystem changes, so we use the safer str version
warnings.warn(_MSG, RemovedInSphinx80Warning, stacklevel=2)
@ -69,7 +71,9 @@ if sys.platform == 'win32':
return len(self.__str__())
else:
class _StrPath(PosixPath):
def replace(self, old: str, new: str, count: int = -1, /) -> str: # type: ignore[override]
def replace( # type: ignore[override]
self, old: str, new: str, count: int = -1, /,
) -> str:
# replace exists in both Path and str;
# in Path it makes filesystem changes, so we use the safer str version
warnings.warn(_MSG, RemovedInSphinx80Warning, stacklevel=2)
@ -96,7 +100,7 @@ else:
warnings.warn(_MSG, RemovedInSphinx80Warning, stacklevel=2)
return item in self.__str__()
def __eq__(self, other: PurePath | str) -> bool:
def __eq__(self, other: object) -> bool:
if isinstance(other, PurePath):
return super().__eq__(other)
if isinstance(other, str):