Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexWaygood committed Feb 1, 2024
1 parent 5a29762 commit fb7f697
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,9 @@ ignore = [
# Makes code slower and more verbose
# https://github.com/astral-sh/ruff/issues/7871
"UP038",
# wants us to use typing.Self,
# but we support Python 3.10 and don't depend on typing_extensions
"PYI019"
]
unfixable = [
"F841", # unused variable. ruff keeps the call, but mostly we want to get rid of it all
Expand Down
5 changes: 3 additions & 2 deletions src/typeshed_stats/gather.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
Literal,
NamedTuple,
NewType,
Self,
TypeAlias,
TypeGuard,
TypeVar,
final,
)

Expand Down Expand Up @@ -79,12 +79,13 @@
PackageName: TypeAlias = str
_AbsolutePath = NewType("_AbsolutePath", Path)
_PathRelativeToTypeshed: TypeAlias = Path
_NiceReprEnumSelf = TypeVar("_NiceReprEnumSelf", bound="_NiceReprEnum")


class _NiceReprEnum(Enum):
"""Base class for several public-API enums in this package."""

def __new__(cls, doc: str) -> Self:
def __new__(cls: type[_NiceReprEnumSelf], doc: str) -> _NiceReprEnumSelf:
assert isinstance(doc, str)
member = object.__new__(cls)
member._value_ = member.__doc__ = doc
Expand Down
4 changes: 0 additions & 4 deletions tests/test___all__.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,6 @@ def test_submodule__all___is_valid(submodule: types.ModuleType) -> None:
assert all(isinstance(item, str) for item in submodule.__all__)


def test___all___alphabetisation(submodule: types.ModuleType) -> None:
assert submodule.__all__ == sorted(submodule.__all__)


def test_all_public_names_in___all__(submodule: types.ModuleType) -> None:
"""Test that all names not in `__all__` are marked as private."""
submodule_name = submodule.__name__
Expand Down

0 comments on commit fb7f697

Please sign in to comment.