-
Notifications
You must be signed in to change notification settings - Fork 2k
Open
Labels
previewRelated to preview mode featuresRelated to preview mode featuresruleImplementing or modifying a lint ruleImplementing or modifying a lint rule
Description
We considered stabilizing the behavior change that enables PYI066 for nono stub files (see #14059) as part of the 0.9 release (#15340) but ultimately decided against it because we found the following two reports in the ecosystem results:
def _stringify_exception(self, exc: BaseException) -> str:
try:
notes = getattr(exc, "__notes__", [])
except KeyError:
# Workaround for https://github.com/python/cpython/issues/98778 on
# Python <= 3.9, and some 3.10 and 3.11 patch versions.
HTTPError = getattr(sys.modules.get("urllib.error", None), "HTTPError", ())
if sys.version_info < (3, 12) and isinstance(exc, HTTPError):
notes = []
else:
raise tags = WheelTag.compute_best(["x86_64"], py_api="cp39")
if sys.version_info < (3, 9) or sys.implementation.name != "cpython":
assert "macosx_10_10_x86_64" in str(tags)
assert "abi3" not in str(tags)
assert "cp39" not in str(tags)
else:
assert str(tags) == "cp39-abi3-macosx_10_10_x86_64"While both cases rightfully fall into the scope of the rule, it is fairly opinionated to enforce PYI066. We have to decide if the rule should apply in those cases and, if so, if it should apply both for stub files and regular files.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
previewRelated to preview mode featuresRelated to preview mode featuresruleImplementing or modifying a lint ruleImplementing or modifying a lint rule