From c977697dd973cde70664f4bcd2b613f21c1327b3 Mon Sep 17 00:00:00 2001 From: Riley Shaw <30989490+ShineyDev@users.noreply.github.com> Date: Sat, 25 Jan 2025 18:22:13 +0000 Subject: [PATCH] modernize typing across the board mostly stops typing self and __all__ also patch the linter and remove some unused imports a little while i'm touching everything --- github/__init__.py | 2 +- github/api/__init__.py | 2 +- github/api/metadata.py | 23 ++- github/api/ratelimit.py | 16 +- github/automation/__init__.py | 2 +- github/automation/bot.py | 17 +- github/automation/mannequin.py | 17 +- github/connection/__init__.py | 2 +- github/connection/advisoryorder.py | 2 +- github/connection/connection.py | 26 +-- github/connection/discussionorder.py | 2 +- github/connection/issueorder.py | 2 +- github/connection/labelorder.py | 2 +- github/connection/mannequinorder.py | 2 +- github/connection/milestoneorder.py | 2 +- github/connection/organizationorder.py | 2 +- github/connection/pullorder.py | 2 +- github/connection/repositoryorder.py | 2 +- github/connection/stargazerorder.py | 2 +- github/connection/teamorder.py | 2 +- github/connection/vulnerabilityorder.py | 2 +- github/content/__init__.py | 2 +- github/content/announcement.py | 16 +- github/content/codeofconduct.py | 32 ++-- github/content/license.py | 68 ++++---- github/content/licenserule.py | 15 +- github/core/__init__.py | 2 +- github/core/client.py | 40 +++-- github/core/dummy.py | 2 - github/core/errors.py | 7 +- github/core/http.py | 199 +++++++++++----------- github/git/__init__.py | 2 +- github/git/blob.py | 13 +- github/git/commit.py | 29 ++-- github/git/tag.py | 14 +- github/git/tree.py | 7 +- github/git/treeentry.py | 24 ++- github/git/treeentrymode.py | 2 +- github/git/treeentrytype.py | 2 +- github/interfaces/__init__.py | 2 +- github/interfaces/actor.py | 13 +- github/interfaces/announcementowner.py | 6 +- github/interfaces/assignable.py | 12 +- github/interfaces/closable.py | 17 +- github/interfaces/comment.py | 45 +++-- github/interfaces/deletable.py | 7 +- github/interfaces/discussionauthor.py | 9 +- github/interfaces/gitnode.py | 7 +- github/interfaces/labelable.py | 16 +- github/interfaces/lockable.py | 7 +- github/interfaces/node.py | 13 +- github/interfaces/packageowner.py | 8 +- github/interfaces/profileowner.py | 29 ++-- github/interfaces/projectowner.py | 2 +- github/interfaces/reactable.py | 16 +- github/interfaces/repositorynode.py | 6 +- github/interfaces/repositoryowner.py | 12 +- github/interfaces/resource.py | 13 +- github/interfaces/sponsorable.py | 20 +-- github/interfaces/starrable.py | 18 +- github/interfaces/subscribable.py | 21 +-- github/interfaces/type.py | 13 +- github/interfaces/updatable.py | 7 +- github/interfaces/votable.py | 15 +- github/organization/__init__.py | 2 +- github/organization/organization.py | 67 ++++---- github/organization/team.py | 39 +++-- github/repository/__init__.py | 2 +- github/repository/discussion.py | 26 ++- github/repository/discussionstate.py | 2 +- github/repository/issue.py | 38 ++--- github/repository/issuestate.py | 2 +- github/repository/label.py | 33 ++-- github/repository/milestone.py | 41 +++-- github/repository/milestonestate.py | 2 +- github/repository/pull.py | 61 ++++--- github/repository/pullstate.py | 2 +- github/repository/repository.py | 163 +++++++++--------- github/repository/subscriptionstate.py | 2 +- github/repository/topic.py | 19 +-- github/security/__init__.py | 2 +- github/security/advisory.py | 39 +++-- github/security/advisoryclassification.py | 2 +- github/security/advisoryseverity.py | 2 +- github/security/vulnerability.py | 8 +- github/user/__init__.py | 2 +- github/user/user.py | 119 +++++++------ github/user/userstatus.py | 43 +++-- github/utility/__init__.py | 2 +- github/utility/convert.py | 2 +- github/utility/helpers.py | 2 +- github/utility/types.py | 2 +- github/utility/wrapper.py | 7 +- 93 files changed, 787 insertions(+), 887 deletions(-) diff --git a/github/__init__.py b/github/__init__.py index 939c3736..a2459743 100644 --- a/github/__init__.py +++ b/github/__init__.py @@ -39,7 +39,7 @@ class _VersionInfo(NamedTuple): version_info: _VersionInfo = _VersionInfo(1, 0, 0, 0, "alpha", 0) -__all__: list[str] = [ # type: ignore[reportUnsupportedDunderAll] +__all__ = [ # type: ignore[reportUnsupportedDunderAll] *_core__all__, *_interfaces__all__, *_api__all__, diff --git a/github/api/__init__.py b/github/api/__init__.py index d7239d4b..a3543c2c 100644 --- a/github/api/__init__.py +++ b/github/api/__init__.py @@ -4,7 +4,7 @@ from github.api.ratelimit import __all__ as _ratelimit__all__ -__all__: list[str] = [ # type: ignore[reportUnsupportedDunderAll] +__all__ = [ # type: ignore[reportUnsupportedDunderAll] *_metadata__all__, *_ratelimit__all__, ] diff --git a/github/api/metadata.py b/github/api/metadata.py index 2b978b1e..c213cd42 100644 --- a/github/api/metadata.py +++ b/github/api/metadata.py @@ -1,9 +1,6 @@ from __future__ import annotations from typing import TYPE_CHECKING -if TYPE_CHECKING: - from typing_extensions import Self - from github.interfaces import Type @@ -43,10 +40,10 @@ def _patch_data( @classmethod def _from_data( - cls: type[Self], + cls, data: MetadataData, /, - ) -> Self: + ): return cls(cls._patch_data(data)) _graphql_fields = { @@ -63,7 +60,7 @@ def _from_data( @property def enterprise_importer_ip_addresses( - self: Self, + self, /, ) -> list[str]: """ @@ -77,7 +74,7 @@ def enterprise_importer_ip_addresses( @property def git_ip_addresses( - self: Self, + self, /, ) -> list[str]: """ @@ -90,7 +87,7 @@ def git_ip_addresses( @property def github_services_sha( - self: Self, + self, /, ) -> str: """ @@ -103,7 +100,7 @@ def github_services_sha( @property def webhook_ip_addresses( - self: Self, + self, /, ) -> list[str]: """ @@ -116,7 +113,7 @@ def webhook_ip_addresses( @property def importer_ip_addresses( - self: Self, + self, /, ) -> list[str]: """ @@ -129,7 +126,7 @@ def importer_ip_addresses( @property def is_password_authentication_verifiable( - self: Self, + self, /, ) -> bool: """ @@ -147,7 +144,7 @@ def is_password_authentication_verifiable( @property def pages_ip_addresses( - self: Self, + self, /, ) -> list[str]: """ @@ -159,6 +156,6 @@ def pages_ip_addresses( return self._data["pagesIpAddresses"] -__all__: list[str] = [ +__all__ = [ "Metadata", ] diff --git a/github/api/ratelimit.py b/github/api/ratelimit.py index 84024408..44d85c47 100644 --- a/github/api/ratelimit.py +++ b/github/api/ratelimit.py @@ -2,8 +2,6 @@ from typing import TYPE_CHECKING if TYPE_CHECKING: - from typing_extensions import Self - from github.utility.types import DateTime import github @@ -46,10 +44,10 @@ def _patch_data( @classmethod def _from_data( - cls: type[Self], + cls, data: RateLimitData, /, - ) -> Self: + ): return cls(cls._patch_data(data)) _graphql_fields = { @@ -61,7 +59,7 @@ def _from_data( @property def limit( - self: Self, + self, /, ) -> int: """ @@ -86,7 +84,7 @@ def limit( @property def remaining( - self: Self, + self, /, ) -> int: """ @@ -111,7 +109,7 @@ def remaining( @property def resets_at( - self: Self, + self, /, ) -> DateTime: """ @@ -124,7 +122,7 @@ def resets_at( @property def used( - self: Self, + self, /, ) -> int: """ @@ -147,6 +145,6 @@ def used( return used -__all__: list[str] = [ +__all__ = [ "RateLimit", ] diff --git a/github/automation/__init__.py b/github/automation/__init__.py index 5ce2216b..b6196a1c 100644 --- a/github/automation/__init__.py +++ b/github/automation/__init__.py @@ -4,7 +4,7 @@ from github.automation.mannequin import __all__ as _mannequin__all__ -__all__: list[str] = [ # type: ignore[reportUnsupportedDunderAll] +__all__ = [ # type: ignore[reportUnsupportedDunderAll] *_bot__all__, *_mannequin__all__, ] diff --git a/github/automation/bot.py b/github/automation/bot.py index ddcaa18e..e230192a 100644 --- a/github/automation/bot.py +++ b/github/automation/bot.py @@ -3,7 +3,6 @@ if TYPE_CHECKING: from typing import cast - from typing_extensions import Self from github.core.http import HTTPClient from github.utility.types import DateTime @@ -59,12 +58,12 @@ def _patch_data( @classmethod def _from_data( - cls: type[Self], + cls, data: BotData, /, *, http: HTTPClient, - ) -> Self: + ): return cls(cls._patch_data(data), http) _graphql_fields = { @@ -77,7 +76,7 @@ def _from_data( @property def created_at( - self: Self, + self, /, ) -> DateTime: """ @@ -90,7 +89,7 @@ def created_at( @property def database_id( - self: Self, + self, /, ) -> int: """ @@ -103,7 +102,7 @@ def database_id( @property def updated_at( - self: Self, + self, /, ) -> DateTime: """ @@ -115,7 +114,7 @@ def updated_at( return github.utility.iso_to_datetime(self._data["updatedAt"]) async def fetch_created_at( - self: Self, + self, /, ) -> DateTime: """ @@ -142,7 +141,7 @@ async def fetch_created_at( return github.utility.iso_to_datetime(created_at) async def fetch_database_id( - self: Self, + self, /, ) -> int: """ @@ -164,7 +163,7 @@ async def fetch_database_id( return await self._fetch_field("databaseId") # type: ignore async def fetch_updated_at( - self: Self, + self, /, ) -> DateTime: """ diff --git a/github/automation/mannequin.py b/github/automation/mannequin.py index 2cbe6a01..94638bea 100644 --- a/github/automation/mannequin.py +++ b/github/automation/mannequin.py @@ -3,7 +3,6 @@ if TYPE_CHECKING: from typing import cast - from typing_extensions import Self from github.core.http import HTTPClient from github.utility.types import DateTime @@ -62,12 +61,12 @@ def _patch_data( @classmethod def _from_data( - cls: type[Self], + cls, data: MannequinData, /, *, http: HTTPClient, - ) -> Self: + ): return cls(cls._patch_data(data), http) _graphql_fields = { @@ -81,7 +80,7 @@ def _from_data( @property def created_at( - self: Self, + self, /, ) -> DateTime: """ @@ -94,7 +93,7 @@ def created_at( @property def database_id( - self: Self, + self, /, ) -> int: """ @@ -107,7 +106,7 @@ def database_id( @property def updated_at( - self: Self, + self, /, ) -> DateTime: """ @@ -119,7 +118,7 @@ def updated_at( return github.utility.iso_to_datetime(self._data["updatedAt"]) async def fetch_created_at( - self: Self, + self, /, ) -> DateTime: """ @@ -146,7 +145,7 @@ async def fetch_created_at( return github.utility.iso_to_datetime(created_at) async def fetch_database_id( - self: Self, + self, /, ) -> int: """ @@ -168,7 +167,7 @@ async def fetch_database_id( return await self._fetch_field("databaseId") # type: ignore async def fetch_updated_at( - self: Self, + self, /, ) -> DateTime: """ diff --git a/github/connection/__init__.py b/github/connection/__init__.py index 423f1db2..7e715b00 100644 --- a/github/connection/__init__.py +++ b/github/connection/__init__.py @@ -28,7 +28,7 @@ from github.connection.vulnerabilityorder import __all__ as _vulnerabilityorder__all__ -__all__: list[str] = [ # type: ignore[reportUnsupportedDunderAll] +__all__ = [ # type: ignore[reportUnsupportedDunderAll] *_advisoryorder__all__, *_connection__all__, *_discussionorder__all__, diff --git a/github/connection/advisoryorder.py b/github/connection/advisoryorder.py index 5c735150..b351b14d 100644 --- a/github/connection/advisoryorder.py +++ b/github/connection/advisoryorder.py @@ -29,5 +29,5 @@ class AdvisoryOrder(enum.Enum): __all__ = [ - "AdvisoryOrder" + "AdvisoryOrder", ] diff --git a/github/connection/connection.py b/github/connection/connection.py index 3882d223..3f85e128 100644 --- a/github/connection/connection.py +++ b/github/connection/connection.py @@ -2,7 +2,7 @@ from typing import Generic, TypeVar, TYPE_CHECKING if TYPE_CHECKING: - from typing import Any, AsyncIterator, Awaitable, Callable, Final, cast, type_check_only + from typing import Any, AsyncIterator, Awaitable, Callable, cast, type_check_only from typing_extensions import Self _T = TypeVar("_T") @@ -69,7 +69,7 @@ class Connection(AsyncIterator[_Tci]): ) def __init__( - self: Self, + self, collector: Callable[..., Awaitable[ConnectionData[Any]]], /, *args: Any, @@ -107,13 +107,13 @@ def __init__( self._paginating: bool = False def __aiter__( - self: Self, + self, /, ) -> Self: return self async def __anext__( - self: Self, + self, /, ) -> _Tci: self._locked = True @@ -209,7 +209,7 @@ async def __anext__( return self._buffer.pop(0) def filter( - self: Self, + self, function: Callable[[_Tci], bool | Awaitable[bool]], /, ) -> Self: @@ -235,7 +235,7 @@ def filter( return self async def flatten( - self: Self, + self, /, ) -> list[_Tci]: """ @@ -250,7 +250,7 @@ async def flatten( return [e async for e in self] def map( - self: Self, + self, function: Callable[[_Tci], _T | Awaitable[_T]], /, ) -> Connection[_T]: @@ -275,12 +275,12 @@ def map( return self # type: ignore # NOTE: this is magic, see note on ConnectionIterator._stages above def paginate( - self: Self, + self, /, length: int = MISSING, ) -> PaginatedConnection[list[_Tci]]: """ - + TODO """ if self._locked: @@ -302,11 +302,11 @@ def paginate( @type_check_only class PaginatedConnection(AsyncIterator[_Tci]): - def filter(self: Self, function: Callable[[_Tci], bool | Awaitable[bool]], /) -> Self: ... - async def flatten(self: Self, /) -> list[_Tci]: ... - def map(self: Self, function: Callable[[_Tci], _T | Awaitable[_T]], /) -> PaginatedConnection[_T]: ... + def filter(self, function: Callable[[_Tci], bool | Awaitable[bool]], /) -> Self: ... + async def flatten(self, /) -> list[_Tci]: ... + def map(self, function: Callable[[_Tci], _T | Awaitable[_T]], /) -> PaginatedConnection[_T]: ... -__all__: Final[list[str]] = [ +__all__ = [ "Connection", ] diff --git a/github/connection/discussionorder.py b/github/connection/discussionorder.py index 3256c9a1..9a155ea0 100644 --- a/github/connection/discussionorder.py +++ b/github/connection/discussionorder.py @@ -25,5 +25,5 @@ class DiscussionOrder(enum.Enum): __all__ = [ - "DiscussionOrder" + "DiscussionOrder", ] diff --git a/github/connection/issueorder.py b/github/connection/issueorder.py index ba7b9659..90a8e272 100644 --- a/github/connection/issueorder.py +++ b/github/connection/issueorder.py @@ -28,5 +28,5 @@ class IssueOrder(enum.Enum): __all__ = [ - "IssueOrder" + "IssueOrder", ] diff --git a/github/connection/labelorder.py b/github/connection/labelorder.py index 05b59ada..65ee8d8d 100644 --- a/github/connection/labelorder.py +++ b/github/connection/labelorder.py @@ -25,5 +25,5 @@ class LabelOrder(enum.Enum): __all__ = [ - "LabelOrder" + "LabelOrder", ] diff --git a/github/connection/mannequinorder.py b/github/connection/mannequinorder.py index a7a58ce8..76e6ac94 100644 --- a/github/connection/mannequinorder.py +++ b/github/connection/mannequinorder.py @@ -25,5 +25,5 @@ class MannequinOrder(enum.Enum): __all__ = [ - "MannequinOrder" + "MannequinOrder", ] diff --git a/github/connection/milestoneorder.py b/github/connection/milestoneorder.py index 7dc5f7c8..5eb9191c 100644 --- a/github/connection/milestoneorder.py +++ b/github/connection/milestoneorder.py @@ -31,5 +31,5 @@ class MilestoneOrder(enum.Enum): __all__ = [ - "MilestoneOrder" + "MilestoneOrder", ] diff --git a/github/connection/organizationorder.py b/github/connection/organizationorder.py index 21518b19..35df1fad 100644 --- a/github/connection/organizationorder.py +++ b/github/connection/organizationorder.py @@ -25,5 +25,5 @@ class OrganizationOrder(enum.Enum): __all__ = [ - "OrganizationOrder" + "OrganizationOrder", ] diff --git a/github/connection/pullorder.py b/github/connection/pullorder.py index a7f74610..151a9416 100644 --- a/github/connection/pullorder.py +++ b/github/connection/pullorder.py @@ -28,5 +28,5 @@ class PullOrder(enum.Enum): __all__ = [ - "PullOrder" + "PullOrder", ] diff --git a/github/connection/repositoryorder.py b/github/connection/repositoryorder.py index d8b9d120..4afda9b0 100644 --- a/github/connection/repositoryorder.py +++ b/github/connection/repositoryorder.py @@ -34,5 +34,5 @@ class RepositoryOrder(enum.Enum): __all__ = [ - "RepositoryOrder" + "RepositoryOrder", ] diff --git a/github/connection/stargazerorder.py b/github/connection/stargazerorder.py index e0db8207..c9d79fbb 100644 --- a/github/connection/stargazerorder.py +++ b/github/connection/stargazerorder.py @@ -22,5 +22,5 @@ class StargazerOrder(enum.Enum): __all__ = [ - "StargazerOrder" + "StargazerOrder", ] diff --git a/github/connection/teamorder.py b/github/connection/teamorder.py index cba95b2f..b2be3e46 100644 --- a/github/connection/teamorder.py +++ b/github/connection/teamorder.py @@ -22,5 +22,5 @@ class TeamOrder(enum.Enum): __all__ = [ - "TeamOrder" + "TeamOrder", ] diff --git a/github/connection/vulnerabilityorder.py b/github/connection/vulnerabilityorder.py index 04e2cf76..91c57256 100644 --- a/github/connection/vulnerabilityorder.py +++ b/github/connection/vulnerabilityorder.py @@ -23,5 +23,5 @@ class VulnerabilityOrder(enum.Enum): __all__ = [ - "VulnerabilityOrder" + "VulnerabilityOrder", ] diff --git a/github/content/__init__.py b/github/content/__init__.py index 0b6c55fd..d5481d68 100644 --- a/github/content/__init__.py +++ b/github/content/__init__.py @@ -12,7 +12,7 @@ from github.content.reactioncontent import __all__ as _reactioncontent__all__ -__all__: list[str] = [ # type: ignore[reportUnsupportedDunderAll] +__all__ = [ # type: ignore[reportUnsupportedDunderAll] *_announcement__all__, *_codeofconduct__all__, *_license__all__, diff --git a/github/content/announcement.py b/github/content/announcement.py index 30cb5758..11c3f497 100644 --- a/github/content/announcement.py +++ b/github/content/announcement.py @@ -2,8 +2,6 @@ from typing import TYPE_CHECKING if TYPE_CHECKING: - from typing_extensions import Self - from github.utility.types import DateTime import github @@ -43,10 +41,10 @@ def _patch_data( @classmethod def _from_data( - cls: type[Self], + cls, data: AnnouncementData, /, - ) -> Self: + ): return cls(cls._patch_data(data)) _graphql_fields = { @@ -60,7 +58,7 @@ def _from_data( @property def can_viewer_dismiss( - self: Self, + self, /, ) -> bool: """ @@ -73,7 +71,7 @@ def can_viewer_dismiss( @property def created_at( - self: Self, + self, /, ) -> DateTime: """ @@ -86,7 +84,7 @@ def created_at( @property def expires_at( - self: Self, + self, /, ) -> DateTime | None: """ @@ -104,7 +102,7 @@ def expires_at( @property def message( - self: Self, + self, /, ) -> str: """ @@ -116,6 +114,6 @@ def message( return self._data["message"] -__all__: list[str] = [ +__all__ = [ "Announcement", ] diff --git a/github/content/codeofconduct.py b/github/content/codeofconduct.py index 42f0427e..700ead37 100644 --- a/github/content/codeofconduct.py +++ b/github/content/codeofconduct.py @@ -2,8 +2,6 @@ from typing import TYPE_CHECKING if TYPE_CHECKING: - from typing_extensions import Self - from github.core.http import HTTPClient from github.utility.types import T_json_key, T_json_value @@ -58,12 +56,12 @@ def _patch_data( @classmethod def _from_data( - cls: type[Self], + cls, data: CodeOfConductData, /, *, http: HTTPClient, - ) -> Self: + ): return cls(cls._patch_data(data), http) _repr_fields = [ @@ -80,7 +78,7 @@ def _from_data( @property def body( - self: Self, + self, /, ) -> str: """ @@ -93,7 +91,7 @@ def body( @property def key( - self: Self, + self, /, ) -> str: """ @@ -106,7 +104,7 @@ def key( @property def name( - self: Self, + self, /, ) -> str: """ @@ -119,7 +117,7 @@ def name( @property def resource_path( - self: Self, + self, /, ) -> str | None: """ @@ -132,7 +130,7 @@ def resource_path( @property def url( - self: Self, + self, /, ) -> str | None: """ @@ -144,7 +142,7 @@ def url( return super().url async def _fetch_field( - self: Self, + self, field: T_json_key, /, *, @@ -189,7 +187,7 @@ async def _fetch_field( return value async def fetch_body( - self: Self, + self, /, ) -> str: """ @@ -215,7 +213,7 @@ async def fetch_body( return await self._fetch_field("body") # type: ignore async def fetch_id( - self: Self, + self, /, ) -> str: """ @@ -241,7 +239,7 @@ async def fetch_id( return await super().fetch_id() # type: ignore async def fetch_key( - self: Self, + self, /, ) -> str: """ @@ -267,7 +265,7 @@ async def fetch_key( return await self._fetch_field("key") # type: ignore async def fetch_name( - self: Self, + self, /, ) -> str: """ @@ -293,7 +291,7 @@ async def fetch_name( return await self._fetch_field("name") # type: ignore async def fetch_resource_path( - self: Self, + self, /, ) -> str | None: """ @@ -319,7 +317,7 @@ async def fetch_resource_path( return await super().fetch_resource_path() # type: ignore async def fetch_url( - self: Self, + self, /, ) -> str | None: """ @@ -345,6 +343,6 @@ async def fetch_url( return await super().fetch_url() # type: ignore -__all__: list[str] = [ +__all__ = [ "CodeOfConduct", ] diff --git a/github/content/license.py b/github/content/license.py index c44ca172..53a2ea8f 100644 --- a/github/content/license.py +++ b/github/content/license.py @@ -2,8 +2,6 @@ from typing import TYPE_CHECKING if TYPE_CHECKING: - from typing_extensions import Self - from github.core.http import HTTPClient from github.utility.types import T_json_key, T_json_value @@ -70,12 +68,12 @@ def _patch_data( @classmethod def _from_data( - cls: type[Self], + cls, data: LicenseData, /, *, http: HTTPClient, - ) -> Self: + ): return cls(cls._patch_data(data), http) _repr_fields = [ @@ -103,7 +101,7 @@ def _from_data( @property def body( - self: Self, + self, /, ) -> str: """ @@ -116,7 +114,7 @@ def body( @property def choosealicense_url( - self: Self, + self, /, ) -> str | None: """ @@ -129,7 +127,7 @@ def choosealicense_url( @property def conditions( - self: Self, + self, /, ) -> list[LicenseRule]: """ @@ -142,7 +140,7 @@ def conditions( @property def description( - self: Self, + self, /, ) -> str | None: """ @@ -155,7 +153,7 @@ def description( @property def implementation( - self: Self, + self, /, ) -> str | None: """ @@ -168,7 +166,7 @@ def implementation( @property def is_featured( - self: Self, + self, /, ) -> bool: """ @@ -181,7 +179,7 @@ def is_featured( @property def is_hidden( - self: Self, + self, /, ) -> bool: """ @@ -194,7 +192,7 @@ def is_hidden( @property def is_pseudo( - self: Self, + self, /, ) -> bool: """ @@ -207,7 +205,7 @@ def is_pseudo( @property def key( - self: Self, + self, /, ) -> str: """ @@ -220,7 +218,7 @@ def key( @property def limitations( - self: Self, + self, /, ) -> list[LicenseRule]: """ @@ -233,7 +231,7 @@ def limitations( @property def name( - self: Self, + self, /, ) -> str: """ @@ -246,7 +244,7 @@ def name( @property def nickname( - self: Self, + self, /, ) -> str | None: """ @@ -259,7 +257,7 @@ def nickname( @property def permissions( - self: Self, + self, /, ) -> list[LicenseRule]: """ @@ -272,7 +270,7 @@ def permissions( @property def spdx_id( - self: Self, + self, /, ) -> str | None: """ @@ -284,7 +282,7 @@ def spdx_id( return self._data["spdxId"] async def _fetch_field( - self: Self, + self, field: T_json_key, /, *, @@ -322,7 +320,7 @@ async def _fetch_field( return value async def fetch_body( - self: Self, + self, /, ) -> str: """ @@ -347,7 +345,7 @@ async def fetch_body( return await self._fetch_field("body") # type: ignore async def fetch_choosealicense_url( - self: Self, + self, /, ) -> str | None: """ @@ -372,7 +370,7 @@ async def fetch_choosealicense_url( return await self._fetch_field("url") # type: ignore async def fetch_conditions( - self: Self, + self, /, ) -> list[LicenseRule]: """ @@ -397,7 +395,7 @@ async def fetch_conditions( return github.LicenseRule._from_data(await self._fetch_field("conditions")) # type: ignore async def fetch_description( - self: Self, + self, /, ) -> str | None: """ @@ -422,7 +420,7 @@ async def fetch_description( return await self._fetch_field("description") # type: ignore async def fetch_id( - self: Self, + self, /, ) -> str: """ @@ -447,7 +445,7 @@ async def fetch_id( return await super().fetch_id() # type: ignore async def fetch_implementation( - self: Self, + self, /, ) -> str | None: """ @@ -472,7 +470,7 @@ async def fetch_implementation( return await self._fetch_field("implementation") # type: ignore async def fetch_is_featured( - self: Self, + self, /, ) -> bool: """ @@ -497,7 +495,7 @@ async def fetch_is_featured( return await self._fetch_field("featured") # type: ignore async def fetch_is_hidden( - self: Self, + self, /, ) -> bool: """ @@ -522,7 +520,7 @@ async def fetch_is_hidden( return await self._fetch_field("hidden") # type: ignore async def fetch_is_pseudo( - self: Self, + self, /, ) -> bool: """ @@ -547,7 +545,7 @@ async def fetch_is_pseudo( return await self._fetch_field("pseudoLicense") # type: ignore async def fetch_key( - self: Self, + self, /, ) -> str: """ @@ -572,7 +570,7 @@ async def fetch_key( return await self._fetch_field("key") # type: ignore async def fetch_limitations( - self: Self, + self, /, ) -> list[LicenseRule]: """ @@ -597,7 +595,7 @@ async def fetch_limitations( return github.LicenseRule._from_data(await self._fetch_field("limitations")) # type: ignore async def fetch_name( - self: Self, + self, /, ) -> str: """ @@ -622,7 +620,7 @@ async def fetch_name( return await self._fetch_field("name") # type: ignore async def fetch_nickname( - self: Self, + self, /, ) -> str | None: """ @@ -647,7 +645,7 @@ async def fetch_nickname( return await self._fetch_field("nickname") # type: ignore async def fetch_permissions( - self: Self, + self, /, ) -> list[LicenseRule]: """ @@ -672,7 +670,7 @@ async def fetch_permissions( return github.LicenseRule._from_data(await self._fetch_field("permissions")) # type: ignore async def fetch_spdx_id( - self: Self, + self, /, ) -> str | None: """ @@ -697,6 +695,6 @@ async def fetch_spdx_id( return await self._fetch_field("spdxId") # type: ignore -__all__: list[str] = [ +__all__ = [ "License", ] diff --git a/github/content/licenserule.py b/github/content/licenserule.py index af7f7f62..06f3c540 100644 --- a/github/content/licenserule.py +++ b/github/content/licenserule.py @@ -1,9 +1,6 @@ from __future__ import annotations from typing import TYPE_CHECKING -if TYPE_CHECKING: - from typing_extensions import Self - from github.interfaces import Type @@ -39,10 +36,10 @@ def _patch_data( @classmethod def _from_data( - cls: type[Self], + cls, data: LicenseRuleData, /, - ) -> Self: + ): return cls(cls._patch_data(data)) _repr_fields = [ @@ -57,7 +54,7 @@ def _from_data( @property def description( - self: Self, + self, /, ) -> str: """ @@ -70,7 +67,7 @@ def description( @property def key( - self: Self, + self, /, ) -> str: """ @@ -83,7 +80,7 @@ def key( @property def label( - self: Self, + self, /, ) -> str: """ @@ -95,6 +92,6 @@ def label( return self._data["label"] -__all__: list[str] = [ +__all__ = [ "LicenseRule", ] diff --git a/github/core/__init__.py b/github/core/__init__.py index 2285b8bb..35a3cf4f 100644 --- a/github/core/__init__.py +++ b/github/core/__init__.py @@ -6,7 +6,7 @@ from github.core.errors import __all__ as _errors__all__ -__all__: list[str] = [ # type: ignore[reportUnsupportedDunderAll] +__all__ = [ # type: ignore[reportUnsupportedDunderAll] *_client__all__, *_dummy__all__, *_errors__all__, diff --git a/github/core/client.py b/github/core/client.py index 8f2b49b4..7cd3f251 100644 --- a/github/core/client.py +++ b/github/core/client.py @@ -2,8 +2,6 @@ from typing import TYPE_CHECKING if TYPE_CHECKING: - from typing_extensions import Self - from aiohttp import ClientSession from github.api import Metadata, RateLimit @@ -56,7 +54,7 @@ class Client(graphql.client.Client): __slots__ = () def __init__( - self: Self, + self, /, token: str, *, @@ -66,7 +64,7 @@ def __init__( self._http: HTTPClient = HTTPClient(token, session, user_agent) async def request( - self: Self, + self, document: str, operation: str = MISSING, /, @@ -133,7 +131,7 @@ async def request( return await super().request(document, operation, **variables) async def fetch_all_codes_of_conduct( - self: Self, + self, /, **kwargs, # TODO ) -> list[CodeOfConduct]: @@ -157,7 +155,7 @@ async def fetch_all_codes_of_conduct( return [github.CodeOfConduct._from_data(d, http=self._http) for d in data] async def fetch_all_licenses( - self: Self, + self, /, **kwargs, # TODO ) -> list[License]: @@ -181,7 +179,7 @@ async def fetch_all_licenses( return [github.License._from_data(d, http=self._http) for d in data] async def fetch_code_of_conduct( - self: Self, + self, key: str, /, **kwargs, # TODO @@ -216,7 +214,7 @@ async def fetch_code_of_conduct( return github.CodeOfConduct._from_data(data, http=self._http) async def fetch_license( - self: Self, + self, key: str, /, **kwargs, # TODO @@ -251,7 +249,7 @@ async def fetch_license( return github.License._from_data(data, http=self._http) async def fetch_metadata( - self: Self, + self, /, **kwargs, # TODO ) -> Metadata: @@ -267,7 +265,7 @@ async def fetch_metadata( return github.Metadata._from_data(data) async def fetch_organization( - self: Self, + self, login: str, /, **kwargs, # TODO @@ -305,7 +303,7 @@ async def fetch_organization( return github.Organization._from_data(data, http=self._http) async def fetch_rate_limit( - self: Self, + self, /, **kwargs, # TODO ) -> RateLimit: @@ -321,7 +319,7 @@ async def fetch_rate_limit( return github.RateLimit._from_data(data) async def fetch_repository( - self: Self, + self, owner: str, name: str, /, @@ -367,7 +365,7 @@ async def fetch_repository( return github.Repository._from_data(data, http=self._http) async def fetch_repository_owner( - self: Self, + self, login: str, /, **kwargs, # TODO @@ -407,7 +405,7 @@ async def fetch_repository_owner( raise RuntimeError(f"invalid type {data['__typename']} for Query.repositoryOwner") async def fetch_topic( - self: Self, + self, name: str, /, **kwargs, # TODO @@ -451,7 +449,7 @@ async def fetch_topic( return github.Topic._from_data(data, http=self._http) async def fetch_user( - self: Self, + self, login: str, /, **kwargs, # TODO @@ -483,7 +481,7 @@ async def fetch_user( return github.User._from_data(data, http=self._http) async def fetch_viewer( - self: Self, + self, /, **kwargs, # TODO ) -> AuthenticatedUser: @@ -500,7 +498,7 @@ async def fetch_viewer( return github.AuthenticatedUser._from_data(data, http=self._http) def fetch_advisories( - self: Self, + self, /, *, cursor: str | None = MISSING, @@ -548,7 +546,7 @@ def fetch_advisories( ) def fetch_vulnerabilities( - self: Self, + self, /, *, cursor: str | None = MISSING, @@ -596,7 +594,7 @@ def fetch_vulnerabilities( ) async def clear_status( - self: Self, + self, /, ) -> None: """ @@ -614,7 +612,7 @@ async def clear_status( await self._http.mutate_user_update_status(None, None, None, None, None) async def update_status( - self: Self, + self, /, message: str | None = MISSING, *, @@ -668,6 +666,6 @@ async def update_status( return github.UserStatus._from_data(data, http=self._http) -__all__: list[str] = [ +__all__ = [ "Client", ] diff --git a/github/core/dummy.py b/github/core/dummy.py index 58737c27..f0dfa9c1 100644 --- a/github/core/dummy.py +++ b/github/core/dummy.py @@ -2,8 +2,6 @@ from typing import TYPE_CHECKING if TYPE_CHECKING: - from typing import cast - from github.core import Client from github.core.http import HTTPClient from github.interfaces import Type diff --git a/github/core/errors.py b/github/core/errors.py index 12bec91c..f9cd72cb 100644 --- a/github/core/errors.py +++ b/github/core/errors.py @@ -3,7 +3,6 @@ if TYPE_CHECKING: from typing import Iterable - from typing_extensions import Self from aiohttp import ClientResponse @@ -36,7 +35,7 @@ class ClientObjectMissingFieldError(ClientError): __slots__ = () def __init__( - self: Self, + self, /, *fields: str, ) -> None: @@ -123,7 +122,7 @@ class ClientResponseGraphQLInsufficientScopesError(ClientResponseGraphQLError): __slots__ = () def __init__( - self: Self, + self, /, message: str, response: ClientResponse, @@ -280,7 +279,7 @@ class ServerDeprecationWarning(graphql.client.ServerDeprecationWarning): __slots__ = () -__all__: list[str] = [ +__all__ = [ "ClientError", "ClientObjectMissingFieldError", "ClientResponseError", diff --git a/github/core/http.py b/github/core/http.py index 9b040f45..dcddfb32 100644 --- a/github/core/http.py +++ b/github/core/http.py @@ -3,7 +3,6 @@ if TYPE_CHECKING: from typing import Any, Iterable, Tuple, cast, overload - from typing_extensions import Self from aiohttp import ClientResponse, ClientSession from github.api.metadata import MetadataData @@ -55,7 +54,7 @@ class HTTPClient(graphql.client.http.HTTPClient): __slots__ = ("token", "user_agent", "uuid") def __init__( - self: Self, + self, /, token: str, session: ClientSession, @@ -69,7 +68,7 @@ def __init__( self.user_agent = (user_agent or "ShineyDev/github@{version}:{uuid}").format(uuid=self.uuid, version=github.version) async def request( - self: Self, + self, document_: str, operation_: str | None, variables_: T_json_object, @@ -108,7 +107,7 @@ async def request( return data async def _fetch( - self: Self, + self, document_: str, /, *path: T_json_key, @@ -119,7 +118,7 @@ async def _fetch( return github.utility.follow(data, path) async def fetch_announcementowner_announcement( - self: Self, + self, /, announcementowner_id: str, *, @@ -134,7 +133,7 @@ async def fetch_announcementowner_announcement( return data # type: ignore async def fetch_comment_author( - self: Self, + self, /, comment_id: str, *, @@ -154,7 +153,7 @@ async def fetch_comment_author( return data async def fetch_comment_editor( - self: Self, + self, /, comment_id: str, *, @@ -176,7 +175,7 @@ async def fetch_comment_editor( return data async def fetch_issue_milestone( - self: Self, + self, /, issue_id: str, *, @@ -189,7 +188,7 @@ async def fetch_issue_milestone( return await self._fetch(query, *path, issue_id=issue_id) # type: ignore async def fetch_organization_team( - self: Self, + self, /, organization_id: str, team_slug: str, @@ -221,7 +220,7 @@ def validate( return data async def fetch_pull_milestone( - self: Self, + self, /, pull_id: str, *, @@ -234,7 +233,7 @@ async def fetch_pull_milestone( return await self._fetch(query, *path, pull_id=pull_id) # type: ignore async def fetch_query_all_codes_of_conduct( - self: Self, + self, /, *, fields: Iterable[str] = MISSING, @@ -262,7 +261,7 @@ def validate( return value # type: ignore async def fetch_query_all_licenses( - self: Self, + self, /, *, fields: Iterable[str] = MISSING, @@ -290,7 +289,7 @@ def validate( return value # type: ignore async def fetch_query_code_of_conduct( - self: Self, + self, /, key: str, *, @@ -330,7 +329,7 @@ def validate( return value async def fetch_query_license( - self: Self, + self, /, key: str, *, @@ -370,7 +369,7 @@ def validate( return value async def fetch_query_metadata( - self: Self, + self, /, *, fields: Iterable[str] = MISSING, @@ -387,7 +386,7 @@ async def fetch_query_metadata( @overload async def fetch_query_node( - self: Self, + self, /, type: type[CodeOfConduct], id: str, @@ -397,7 +396,7 @@ async def fetch_query_node( @overload async def fetch_query_node( - self: Self, + self, /, type: type[License], id: str, @@ -407,7 +406,7 @@ async def fetch_query_node( @overload async def fetch_query_node( - self: Self, + self, /, type: type[Topic], id: str, @@ -417,7 +416,7 @@ async def fetch_query_node( @overload async def fetch_query_node( - self: Self, + self, /, type: type[User], id: str, @@ -427,7 +426,7 @@ async def fetch_query_node( @overload async def fetch_query_node( - self: Self, + self, /, type: type[UserStatus], id: str, @@ -436,7 +435,7 @@ async def fetch_query_node( ) -> UserStatusData: ... async def fetch_query_node( - self: Self, + self, /, type: type[Node], id: str, @@ -458,7 +457,7 @@ async def fetch_query_node( return value async def fetch_query_organization( - self: Self, + self, login: str, *, fields: Iterable[str] = MISSING, @@ -478,7 +477,7 @@ async def fetch_query_organization( return data async def fetch_query_rate_limit( - self: Self, + self, /, *, fields: Iterable[str] = MISSING, @@ -492,7 +491,7 @@ async def fetch_query_rate_limit( return value # type: ignore async def fetch_query_repository( - self: Self, + self, /, owner: str, name: str, @@ -519,7 +518,7 @@ async def fetch_query_repository( return data async def fetch_query_repository_owner( - self: Self, + self, /, login: str, *, @@ -541,7 +540,7 @@ async def fetch_query_repository_owner( @overload async def fetch_query_resource( - self: Self, + self, /, type: type[CodeOfConduct], url: str, @@ -551,7 +550,7 @@ async def fetch_query_resource( @overload async def fetch_query_resource( - self: Self, + self, /, type: type[User], url: str, @@ -560,7 +559,7 @@ async def fetch_query_resource( ) -> UserData: ... async def fetch_query_resource( - self: Self, + self, /, type: type[Resource], url: str, @@ -582,7 +581,7 @@ async def fetch_query_resource( return value async def fetch_query_topic( - self: Self, + self, name: str, *, fields: Iterable[str] = MISSING, @@ -616,7 +615,7 @@ def validate( return value async def fetch_query_user( - self: Self, + self, login: str, *, fields: Iterable[str] = MISSING, @@ -641,7 +640,7 @@ async def fetch_query_user( return value async def fetch_query_viewer( - self: Self, + self, *, fields: Iterable[str] = MISSING, ) -> ViewerData: @@ -660,7 +659,7 @@ async def fetch_query_viewer( return value async def fetch_reaction_author( - self: Self, + self, /, reaction_id: str, *, @@ -673,7 +672,7 @@ async def fetch_reaction_author( return await self._fetch(query, *path, reaction_id=reaction_id) # type: ignore async def fetch_repository_code_of_conduct( - self: Self, + self, /, repository_id: str, *, @@ -686,7 +685,7 @@ async def fetch_repository_code_of_conduct( return await self._fetch(query, *path, repository_id=repository_id) # type: ignore async def fetch_repository_discussion( - self: Self, + self, /, repository_id: str, number: int, @@ -708,7 +707,7 @@ async def fetch_repository_discussion( return data async def fetch_repository_issue( - self: Self, + self, /, repository_id: str, number: int, @@ -730,7 +729,7 @@ async def fetch_repository_issue( return data async def fetch_repository_issue_or_pull( - self: Self, + self, /, repository_id: str, number: int, @@ -753,7 +752,7 @@ async def fetch_repository_issue_or_pull( return data async def fetch_repository_label( - self: Self, + self, /, repository_id: str, name: str, @@ -788,7 +787,7 @@ def validate( return data async def fetch_repository_license( - self: Self, + self, /, repository_id: str, *, @@ -801,7 +800,7 @@ async def fetch_repository_license( return await self._fetch(query, *path, repository_id=repository_id) # type: ignore async def fetch_repository_milestone( - self: Self, + self, /, repository_id: str, number: int, @@ -823,7 +822,7 @@ async def fetch_repository_milestone( return data async def fetch_repository_owner( - self: Self, + self, /, repository_id: str, *, @@ -837,7 +836,7 @@ async def fetch_repository_owner( return await self._fetch(query, *path, repository_id=repository_id) # type: ignore async def fetch_repository_parent( - self: Self, + self, /, repository_id: str, *, @@ -850,7 +849,7 @@ async def fetch_repository_parent( return await self._fetch(query, *path, repository_id=repository_id) # type: ignore async def fetch_repository_pull( - self: Self, + self, /, repository_id: str, number: int, @@ -872,7 +871,7 @@ async def fetch_repository_pull( return data async def fetch_repository_template( - self: Self, + self, /, repository_id: str, *, @@ -885,7 +884,7 @@ async def fetch_repository_template( return await self._fetch(query, *path, repository_id=repository_id) # type: ignore async def fetch_repositorynode_repository( - self: Self, + self, /, repositorynode_id: str, *, @@ -903,7 +902,7 @@ async def fetch_repositorynode_repository( return data async def fetch_repositoryowner_repository( - self: Self, + self, /, repositoryowner_id: str, name: str, @@ -927,7 +926,7 @@ async def fetch_repositoryowner_repository( return data async def fetch_topic_related_topics( - self: Self, + self, /, topic_id: str, limit: int | None, @@ -943,7 +942,7 @@ async def fetch_topic_related_topics( return value # type: ignore async def fetch_user_organization( - self: Self, + self, /, user_id: str, organization_login: str, @@ -975,7 +974,7 @@ def validate( return data async def fetch_user_status( - self: Self, + self, /, user_id: str, *, @@ -990,7 +989,7 @@ async def fetch_user_status( return value # type: ignore async def fetch_userstatus_organization( - self: Self, + self, /, userstatus_id: str, *, @@ -1011,7 +1010,7 @@ async def fetch_userstatus_organization( return data async def fetch_userstatus_user( - self: Self, + self, /, userstatus_id: str, *, @@ -1034,7 +1033,7 @@ async def fetch_userstatus_user( return data async def _collect( - self: Self, + self, document_: str, /, *path: T_json_key, @@ -1069,7 +1068,7 @@ async def _collect( return data async def collect_advisory_vulnerabilities( - self: Self, + self, /, advisory_id: str, order_by: str | None, @@ -1089,7 +1088,7 @@ async def collect_advisory_vulnerabilities( return await self._collect(query, *path, advisory_id=advisory_id, order_by=order_by_data, **kwargs) async def collect_assignable_assignees( - self: Self, + self, /, assignable_id: str, *, @@ -1103,7 +1102,7 @@ async def collect_assignable_assignees( return await self._collect(query, *path, assignable_id=assignable_id, **kwargs) async def collect_issue_participants( - self: Self, + self, /, issue_id: str, *, @@ -1117,7 +1116,7 @@ async def collect_issue_participants( return await self._collect(query, *path, issue_id=issue_id, **kwargs) async def collect_label_issues( - self: Self, + self, /, label_id: str, order_by: str | None, @@ -1137,7 +1136,7 @@ async def collect_label_issues( return await self._collect(query, *path, label_id=label_id, order_by=order_by_data, **kwargs) async def collect_label_pulls( - self: Self, + self, /, label_id: str, order_by: str | None, @@ -1157,7 +1156,7 @@ async def collect_label_pulls( return await self._collect(query, *path, label_id=label_id, order_by=order_by_data, **kwargs) async def collect_labelable_labels( - self: Self, + self, /, labelable_id: str, order_by: str | None, @@ -1177,7 +1176,7 @@ async def collect_labelable_labels( return await self._collect(query, *path, labelable_id=labelable_id, order_by=order_by_data, **kwargs) async def collect_milestone_issues( - self: Self, + self, /, milestone_id: str, order_by: str | None, @@ -1197,7 +1196,7 @@ async def collect_milestone_issues( return await self._collect(query, *path, milestone_id=milestone_id, order_by=order_by_data, **kwargs) async def collect_milestone_pulls( - self: Self, + self, /, milestone_id: str, order_by: str | None, @@ -1217,7 +1216,7 @@ async def collect_milestone_pulls( return await self._collect(query, *path, milestone_id=milestone_id, order_by=order_by_data, **kwargs) async def collect_organization_mannequins( - self: Self, + self, /, organization_id: str, order_by: str | None, @@ -1237,7 +1236,7 @@ async def collect_organization_mannequins( return await self._collect(query, *path, organization_id=organization_id, order_by=order_by_data, **kwargs) async def collect_organization_teams( - self: Self, + self, /, organization_id: str, order_by: str | None, @@ -1257,7 +1256,7 @@ async def collect_organization_teams( return await self._collect(query, *path, organization_id=organization_id, order_by=order_by_data, **kwargs) async def collect_pull_participants( - self: Self, + self, /, pull_id: str, *, @@ -1271,7 +1270,7 @@ async def collect_pull_participants( return await self._collect(query, *path, pull_id=pull_id, **kwargs) async def collect_query_advisories( - self: Self, + self, /, order_by: str | None, *, @@ -1290,7 +1289,7 @@ async def collect_query_advisories( return await self._collect(query, *path, order_by=order_by_data, **kwargs) async def collect_query_vulnerabilities( - self: Self, + self, /, order_by: str | None, *, @@ -1309,7 +1308,7 @@ async def collect_query_vulnerabilities( return await self._collect(query, *path, order_by=order_by_data, **kwargs) async def collect_reactable_reactions( - self: Self, + self, /, reactable_id: str, order_by: str | None, @@ -1329,7 +1328,7 @@ async def collect_reactable_reactions( return await self._collect(query, *path, reactable_id=reactable_id, order_by=order_by_data, **kwargs) async def collect_repository_assignable_users( - self: Self, + self, /, repository_id: str, *, @@ -1343,7 +1342,7 @@ async def collect_repository_assignable_users( return await self._collect(query, *path, repository_id=repository_id, **kwargs) async def collect_repository_collaborators( - self: Self, + self, /, repository_id: str, *, @@ -1357,7 +1356,7 @@ async def collect_repository_collaborators( return await self._collect(query, *path, repository_id=repository_id, **kwargs) async def collect_repository_discussions( - self: Self, + self, /, repository_id: str, order_by: str | None, @@ -1377,7 +1376,7 @@ async def collect_repository_discussions( return await self._collect(query, *path, repository_id=repository_id, order_by=order_by_data, **kwargs) async def collect_repository_forks( - self: Self, + self, /, repository_id: str, order_by: str | None, @@ -1397,7 +1396,7 @@ async def collect_repository_forks( return await self._collect(query, *path, repository_id=repository_id, order_by=order_by_data, **kwargs) async def collect_repository_issues( - self: Self, + self, /, repository_id: str, order_by: str | None, @@ -1417,7 +1416,7 @@ async def collect_repository_issues( return await self._collect(query, *path, repository_id=repository_id, order_by=order_by_data, **kwargs) async def collect_repository_labels( - self: Self, + self, /, repository_id: str, order_by: str | None, @@ -1437,7 +1436,7 @@ async def collect_repository_labels( return await self._collect(query, *path, repository_id=repository_id, order_by=order_by_data, **kwargs) async def collect_repository_milestones( - self: Self, + self, /, repository_id: str, order_by: str | None, @@ -1457,7 +1456,7 @@ async def collect_repository_milestones( return await self._collect(query, *path, repository_id=repository_id, order_by=order_by_data, **kwargs) async def collect_repository_pulls( - self: Self, + self, /, repository_id: str, order_by: str | None, @@ -1477,7 +1476,7 @@ async def collect_repository_pulls( return await self._collect(query, *path, repository_id=repository_id, order_by=order_by_data, **kwargs) async def collect_repository_topics( - self: Self, + self, /, repository_id: str, *, @@ -1500,7 +1499,7 @@ async def collect_repository_topics( return data async def collect_repository_mentionable_users( - self: Self, + self, /, repository_id: str, *, @@ -1514,7 +1513,7 @@ async def collect_repository_mentionable_users( return await self._collect(query, *path, repository_id=repository_id, **kwargs) async def collect_repository_watchers( - self: Self, + self, /, repository_id: str, *, @@ -1528,7 +1527,7 @@ async def collect_repository_watchers( return await self._collect(query, *path, repository_id=repository_id, **kwargs) async def collect_repositoryowner_repositories( - self: Self, + self, /, repositoryowner_id: str, order_by: str | None, @@ -1548,7 +1547,7 @@ async def collect_repositoryowner_repositories( return await self._collect(query, *path, repositoryowner_id=repositoryowner_id, order_by=order_by_data, **kwargs) async def collect_starrable_stargazers( - self: Self, + self, /, starrable_id: str, order_by: str | None, @@ -1568,7 +1567,7 @@ async def collect_starrable_stargazers( return await self._collect(query, *path, starrable_id=starrable_id, order_by=order_by_data, **kwargs) async def collect_team_ancestors( - self: Self, + self, /, team_id: str, *, @@ -1582,7 +1581,7 @@ async def collect_team_ancestors( return await self._collect(query, *path, team_id=team_id, **kwargs) async def collect_topic_repositories( - self: Self, + self, /, topic_id: str, order_by: str | None, @@ -1602,7 +1601,7 @@ async def collect_topic_repositories( return await self._collect(query, *path, topic_id=topic_id, order_by=order_by_data, **kwargs) async def collect_user_followers( - self: Self, + self, /, user_id: str, *, @@ -1616,7 +1615,7 @@ async def collect_user_followers( return await self._collect(query, *path, user_id=user_id, **kwargs) async def collect_user_following( - self: Self, + self, /, user_id: str, *, @@ -1630,7 +1629,7 @@ async def collect_user_following( return await self._collect(query, *path, user_id=user_id, **kwargs) async def collect_user_issues( - self: Self, + self, /, user_id: str, order_by: str | None, @@ -1650,7 +1649,7 @@ async def collect_user_issues( return await self._collect(query, *path, user_id=user_id, order_by=order_by_data, **kwargs) async def collect_user_organizations( - self: Self, + self, /, user_id: str, order_by: str | None, @@ -1670,7 +1669,7 @@ async def collect_user_organizations( return await self._collect(query, *path, user_id=user_id, order_by=order_by_data, **kwargs) async def collect_user_pulls( - self: Self, + self, /, user_id: str, order_by: str | None, @@ -1690,7 +1689,7 @@ async def collect_user_pulls( return await self._collect(query, *path, user_id=user_id, order_by=order_by_data, **kwargs) async def collect_user_watching( - self: Self, + self, /, user_id: str, order_by: str | None, @@ -1710,7 +1709,7 @@ async def collect_user_watching( return await self._collect(query, *path, user_id=user_id, order_by=order_by_data, **kwargs) async def _mutate( - self: Self, + self, document_: str, /, *path: T_json_key, @@ -1723,7 +1722,7 @@ async def _mutate( return await self._fetch(document_, *path, _data_validate=_data_validate, **kwargs) async def mutate_assignable_add_assignees( - self: Self, + self, /, assignable_id: str, assignee_ids: list[str], @@ -1739,7 +1738,7 @@ async def mutate_assignable_add_assignees( return data # type: ignore async def mutate_assignable_remove_assignees( - self: Self, + self, /, assignable_id: str, assignee_ids: list[str], @@ -1755,7 +1754,7 @@ async def mutate_assignable_remove_assignees( return data # type: ignore async def mutate_labelable_add_labels( - self: Self, + self, /, labelable_id: str, label_ids: list[str], @@ -1771,7 +1770,7 @@ async def mutate_labelable_add_labels( return data # type: ignore async def mutate_labelable_remove_labels( - self: Self, + self, /, labelable_id: str, label_ids: list[str], @@ -1787,7 +1786,7 @@ async def mutate_labelable_remove_labels( return data # type: ignore async def mutate_reactable_add_reaction( - self: Self, + self, /, reactable_id: str, content: str, @@ -1805,7 +1804,7 @@ async def mutate_reactable_add_reaction( return (data["subject"], data["reaction"]) # type: ignore async def mutate_reactable_remove_reaction( - self: Self, + self, /, reactable_id: str, content: str, @@ -1821,7 +1820,7 @@ async def mutate_reactable_remove_reaction( return data # type: ignore async def mutate_repository_archive( - self: Self, + self, /, repository_id: str, *, @@ -1836,7 +1835,7 @@ async def mutate_repository_archive( return data # type: ignore async def mutate_repository_unarchive( - self: Self, + self, /, repository_id: str, *, @@ -1851,7 +1850,7 @@ async def mutate_repository_unarchive( return data # type: ignore async def mutate_starrable_star( - self: Self, + self, /, starrable_id: str, *, @@ -1866,7 +1865,7 @@ async def mutate_starrable_star( return value # type: ignore async def mutate_starrable_unstar( - self: Self, + self, /, starrable_id: str, *, @@ -1881,7 +1880,7 @@ async def mutate_starrable_unstar( return value # type: ignore async def mutate_subscribable_update_subscription( - self: Self, + self, /, subscribable_id: str, state: str, @@ -1897,7 +1896,7 @@ async def mutate_subscribable_update_subscription( return value # type: ignore async def mutate_user_update_status( - self: Self, + self, /, busy: bool | None, emoji: str | None, @@ -1916,6 +1915,6 @@ async def mutate_user_update_status( return value # type: ignore -__all__: list[str] = [ +__all__ = [ "HTTPClient", ] diff --git a/github/git/__init__.py b/github/git/__init__.py index 5e5463bf..738d7533 100644 --- a/github/git/__init__.py +++ b/github/git/__init__.py @@ -14,7 +14,7 @@ from github.git.treeentrytype import __all__ as _treeentrytype__all__ -__all__: list[str] = [ # type: ignore[reportUnsupportedDunderAll] +__all__ = [ # type: ignore[reportUnsupportedDunderAll] *_blob__all__, *_commit__all__, *_tag__all__, diff --git a/github/git/blob.py b/github/git/blob.py index 03bd3431..0df62dd4 100644 --- a/github/git/blob.py +++ b/github/git/blob.py @@ -3,7 +3,6 @@ if TYPE_CHECKING: from typing import cast - from typing_extensions import Self from github.core.http import HTTPClient @@ -58,12 +57,12 @@ def _patch_data( @classmethod def _from_data( - cls: type[Self], + cls, data: BlobData, /, *, http: HTTPClient, - ) -> Self: + ): return cls(cls._patch_data(data), http) _graphql_fields = { @@ -77,7 +76,7 @@ def _from_data( @property def is_text( - self: Self, + self, /, ) -> bool: """ @@ -95,7 +94,7 @@ def is_text( @property def size( - self: Self, + self, /, ) -> int: """ @@ -107,7 +106,7 @@ def size( return self._data["byteSize"] async def fetch_is_text( - self: Self, + self, /, ) -> bool: """ @@ -137,7 +136,7 @@ async def fetch_is_text( return not is_binary async def fetch_size( - self: Self, + self, /, ) -> int: """ diff --git a/github/git/commit.py b/github/git/commit.py index 2a74c010..11cd2c82 100644 --- a/github/git/commit.py +++ b/github/git/commit.py @@ -3,7 +3,6 @@ if TYPE_CHECKING: from typing import cast - from typing_extensions import Self from github.core.http import HTTPClient from github.utility.types import DateTime @@ -97,12 +96,12 @@ def _patch_data( @classmethod def _from_data( - cls: type[Self], + cls, data: CommitData, /, *, http: HTTPClient, - ) -> Self: + ): return cls(cls._patch_data(data), http) _graphql_fields = { @@ -130,7 +129,7 @@ def _from_data( @property def addition_count( - self: Self, + self, /, ) -> int: """ @@ -143,7 +142,7 @@ def addition_count( @property def authored_at( - self: Self, + self, /, ) -> DateTime: """ @@ -156,7 +155,7 @@ def authored_at( @property def committed_at( - self: Self, + self, /, ) -> DateTime: """ @@ -169,7 +168,7 @@ def committed_at( @property def deletion_count( - self: Self, + self, /, ) -> int: """ @@ -182,7 +181,7 @@ def deletion_count( @property def file_count( - self: Self, + self, /, ) -> int | None: """ @@ -197,7 +196,7 @@ def file_count( @property def message( - self: Self, + self, /, ) -> str: """ @@ -209,7 +208,7 @@ def message( return self._data["message"] async def fetch_addition_count( - self: Self, + self, /, ) -> int: """ @@ -231,7 +230,7 @@ async def fetch_addition_count( return await self._fetch_field("additions") # type: ignore async def fetch_authored_at( - self: Self, + self, /, ) -> DateTime: """ @@ -258,7 +257,7 @@ async def fetch_authored_at( return github.utility.iso_to_datetime(authored_at) async def fetch_committed_at( - self: Self, + self, /, ) -> DateTime: """ @@ -285,7 +284,7 @@ async def fetch_committed_at( return github.utility.iso_to_datetime(committed_at) async def fetch_deletion_count( - self: Self, + self, /, ) -> int: """ @@ -307,7 +306,7 @@ async def fetch_deletion_count( return await self._fetch_field("deletions") # type: ignore async def fetch_file_count( - self: Self, + self, /, ) -> int | None: """ @@ -330,7 +329,7 @@ async def fetch_file_count( return await self._fetch_field("changedFilesIfAvailable") # type: ignore async def fetch_message( - self: Self, + self, /, ) -> str: """ diff --git a/github/git/tag.py b/github/git/tag.py index ccc7c4ca..5b16c677 100644 --- a/github/git/tag.py +++ b/github/git/tag.py @@ -2,8 +2,6 @@ from typing import TYPE_CHECKING if TYPE_CHECKING: - from typing_extensions import Self - from github.core.http import HTTPClient from github.interfaces import GitNode, Node, RepositoryNode, Type @@ -70,12 +68,12 @@ def _patch_data( @classmethod def _from_data( - cls: type[Self], + cls, data: TagData, /, *, http: HTTPClient, - ) -> Self: + ): return cls(cls._patch_data(data), http) _graphql_fields = [ @@ -87,7 +85,7 @@ def _from_data( @property def message( - self: Self, + self, /, ) -> str | None: """ @@ -100,7 +98,7 @@ def message( @property def name( - self: Self, + self, /, ) -> str: """ @@ -112,7 +110,7 @@ def name( return self._data["name"] async def fetch_message( - self: Self, + self, /, ) -> str | None: """ @@ -134,7 +132,7 @@ async def fetch_message( return await self._fetch_field("message") # type: ignore async def fetch_name( - self: Self, + self, /, ) -> str: """ diff --git a/github/git/tree.py b/github/git/tree.py index 12bb773c..61c8f047 100644 --- a/github/git/tree.py +++ b/github/git/tree.py @@ -2,9 +2,6 @@ from typing import TYPE_CHECKING if TYPE_CHECKING: - from typing import cast - from typing_extensions import Self - from github.core.http import HTTPClient from github.interfaces import GitNode, Node, RepositoryNode, Type @@ -55,12 +52,12 @@ def _patch_data( @classmethod def _from_data( - cls: type[Self], + cls, data: TreeData, /, *, http: HTTPClient, - ) -> Self: + ): return cls(cls._patch_data(data), http) _node_prefix = "TREE" diff --git a/github/git/treeentry.py b/github/git/treeentry.py index 52b6d83b..47637281 100644 --- a/github/git/treeentry.py +++ b/github/git/treeentry.py @@ -2,8 +2,6 @@ from typing import TYPE_CHECKING if TYPE_CHECKING: - from typing_extensions import Self - from github.core.http import HTTPClient from github.git import TreeEntryMode, TreeEntryType @@ -63,12 +61,12 @@ def _patch_data( @classmethod def _from_data( - cls: type[Self], + cls, data: TreeEntryData, /, *, http: HTTPClient, - ) -> Self: + ): return cls(cls._patch_data(data), http) _graphql_fields = { @@ -91,7 +89,7 @@ def _from_data( @property def extension( - self: Self, + self, /, ) -> str | None: """ @@ -105,7 +103,7 @@ def extension( @property def is_generated( - self: Self, + self, /, ) -> bool: """ @@ -118,7 +116,7 @@ def is_generated( @property def line_count( - self: Self, + self, /, ) -> int | None: """ @@ -132,7 +130,7 @@ def line_count( @property def mode( - self: Self, + self, /, ) -> TreeEntryMode: """ @@ -145,7 +143,7 @@ def mode( @property def name( - self: Self, + self, /, ) -> str: """ @@ -158,7 +156,7 @@ def name( @property def object_id( - self: Self, + self, /, ) -> str: """ @@ -171,7 +169,7 @@ def object_id( @property def path( - self: Self, + self, /, ) -> str: """ @@ -184,7 +182,7 @@ def path( @property def size( - self: Self, + self, /, ) -> int: """ @@ -198,7 +196,7 @@ def size( @property def type( - self: Self, + self, /, ) -> TreeEntryType: """ diff --git a/github/git/treeentrymode.py b/github/git/treeentrymode.py index 41ef4b1c..93376a1d 100644 --- a/github/git/treeentrymode.py +++ b/github/git/treeentrymode.py @@ -34,5 +34,5 @@ class TreeEntryMode(enum.Enum): __all__ = [ - "TreeEntryMode" + "TreeEntryMode", ] diff --git a/github/git/treeentrytype.py b/github/git/treeentrytype.py index 7bee4933..2ba66daa 100644 --- a/github/git/treeentrytype.py +++ b/github/git/treeentrytype.py @@ -25,5 +25,5 @@ class TreeEntryType(enum.Enum): __all__ = [ - "TreeEntryType" + "TreeEntryType", ] diff --git a/github/interfaces/__init__.py b/github/interfaces/__init__.py index 1fc72000..a8defd96 100644 --- a/github/interfaces/__init__.py +++ b/github/interfaces/__init__.py @@ -48,7 +48,7 @@ from github.interfaces.votable import __all__ as _votable__all__ -__all__: list[str] = [ # type: ignore[reportUnsupportedDunderAll] +__all__ = [ # type: ignore[reportUnsupportedDunderAll] *_actor__all__, *_announcementowner__all__, *_assignable__all__, diff --git a/github/interfaces/actor.py b/github/interfaces/actor.py index 0b779ee9..a3d5fca3 100644 --- a/github/interfaces/actor.py +++ b/github/interfaces/actor.py @@ -1,9 +1,6 @@ from __future__ import annotations from typing import TYPE_CHECKING -if TYPE_CHECKING: - from typing_extensions import Self - from github.utility import MISSING @@ -37,7 +34,7 @@ class Actor: @property def avatar_url( - self: Self, + self, /, ) -> str: """ @@ -50,7 +47,7 @@ def avatar_url( @property def login( - self: Self, + self, /, ) -> str: """ @@ -62,7 +59,7 @@ def login( return self._data["login"] async def fetch_avatar_url( - self: Self, + self, /, *, size: int = MISSING, @@ -93,7 +90,7 @@ async def fetch_avatar_url( return await self._fetch_field(field, save=save) # type: ignore async def fetch_login( - self: Self, + self, /, ) -> str: """ @@ -107,6 +104,6 @@ async def fetch_login( return await self._fetch_field("login") # type: ignore -__all__: list[str] = [ +__all__ = [ "Actor", ] diff --git a/github/interfaces/announcementowner.py b/github/interfaces/announcementowner.py index 37d92ed0..418e1e41 100644 --- a/github/interfaces/announcementowner.py +++ b/github/interfaces/announcementowner.py @@ -2,8 +2,6 @@ from typing import TYPE_CHECKING if TYPE_CHECKING: - from typing_extensions import Self - from github.content import Announcement from github.interfaces import Node @@ -30,7 +28,7 @@ class AnnouncementOwner: _data: AnnouncementOwnerData async def fetch_announcement( - self: Self, + self, /, **kwargs, # TODO ) -> Announcement | None: @@ -61,6 +59,6 @@ async def fetch_announcement( return github.Announcement._from_data(data) -__all__: list[str] = [ +__all__ = [ "AnnouncementOwner", ] diff --git a/github/interfaces/assignable.py b/github/interfaces/assignable.py index 193e98a2..b486a737 100644 --- a/github/interfaces/assignable.py +++ b/github/interfaces/assignable.py @@ -2,8 +2,6 @@ from typing import TYPE_CHECKING if TYPE_CHECKING: - from typing_extensions import Self - from github.connection import Connection from github.interfaces import Node from github.user import User @@ -39,7 +37,7 @@ class Assignable: @property def assignee_count( - self: Self, + self, /, ) -> int: """ @@ -51,7 +49,7 @@ def assignee_count( return self._data["assignees"]["totalCount"] async def fetch_assignee_count( - self: Self, + self, /, ) -> int: """ @@ -76,7 +74,7 @@ async def fetch_assignee_count( return await self._fetch_field("assignees{totalCount}") # type: ignore def fetch_assignees( - self: Self, + self, /, *, cursor: str | None = MISSING, @@ -128,7 +126,7 @@ def userdata_to_user(userdata: UserData, /) -> User: ) async def add_assignees( - self: Self, + self, /, *assignees: User, ) -> None: @@ -163,7 +161,7 @@ async def add_assignees( self._data["assignees"]["totalCount"] = data["assignees"]["totalCount"] async def remove_assignees( - self: Self, + self, /, *assignees: User, ) -> None: diff --git a/github/interfaces/closable.py b/github/interfaces/closable.py index c5464c74..379ca770 100644 --- a/github/interfaces/closable.py +++ b/github/interfaces/closable.py @@ -3,7 +3,6 @@ if TYPE_CHECKING: from typing import cast - from typing_extensions import Self from github.interfaces import Node from github.utility.types import DateTime @@ -40,7 +39,7 @@ class Closable: @property def closed_at( - self: Self, + self, /, ) -> DateTime | None: """ @@ -58,7 +57,7 @@ def closed_at( @property def is_closed( - self: Self, + self, /, ) -> bool: """ @@ -71,7 +70,7 @@ def is_closed( @property def viewer_can_close( - self: Self, + self, /, ) -> bool: """ @@ -84,7 +83,7 @@ def viewer_can_close( @property def viewer_can_reopen( - self: Self, + self, /, ) -> bool: """ @@ -96,7 +95,7 @@ def viewer_can_reopen( return self._data["viewerCanReopen"] async def fetch_closed_at( - self: Self, + self, /, ) -> DateTime | None: """ @@ -130,7 +129,7 @@ async def fetch_closed_at( return github.utility.iso_to_datetime(closed_at) async def fetch_is_closed( - self: Self, + self, /, ) -> bool: """ @@ -144,7 +143,7 @@ async def fetch_is_closed( return await self._fetch_field("closed") # type: ignore async def fetch_viewer_can_close( - self: Self, + self, /, ) -> bool: """ @@ -158,7 +157,7 @@ async def fetch_viewer_can_close( return await self._fetch_field("viewerCanClose") # type: ignore async def fetch_viewer_can_reopen( - self: Self, + self, /, ) -> bool: """ diff --git a/github/interfaces/comment.py b/github/interfaces/comment.py index a1e68b32..2f4a40dc 100644 --- a/github/interfaces/comment.py +++ b/github/interfaces/comment.py @@ -3,7 +3,6 @@ if TYPE_CHECKING: from typing import cast - from typing_extensions import Self from github.automation import Bot, Mannequin from github.interfaces import Node @@ -84,7 +83,7 @@ def _patch_data( @property def body( - self: Self, + self, /, ) -> str | None: """ @@ -97,7 +96,7 @@ def body( @property def body_html( - self: Self, + self, /, ) -> str | None: """ @@ -110,7 +109,7 @@ def body_html( @property def body_text( - self: Self, + self, /, ) -> str | None: """ @@ -123,7 +122,7 @@ def body_text( @property def created_at( - self: Self, + self, /, ) -> DateTime: """ @@ -136,7 +135,7 @@ def created_at( @property def edit_count( - self: Self, + self, /, ) -> int: """ @@ -164,7 +163,7 @@ def edit_count( @property def edited_at( - self: Self, + self, /, ) -> DateTime | None: """ @@ -182,7 +181,7 @@ def edited_at( @property def is_email( - self: Self, + self, /, ) -> bool: """ @@ -195,7 +194,7 @@ def is_email( @property def published_at( - self: Self, + self, /, ) -> DateTime | None: """ @@ -213,7 +212,7 @@ def published_at( @property def updated_at( - self: Self, + self, /, ) -> DateTime: """ @@ -226,7 +225,7 @@ def updated_at( @property def viewer_is_author( - self: Self, + self, /, ) -> bool: """ @@ -238,7 +237,7 @@ def viewer_is_author( return self._data["viewerDidAuthor"] async def fetch_body( - self: Self, + self, /, ) -> str | None: """ @@ -252,7 +251,7 @@ async def fetch_body( return await self._fetch_field("body") # type: ignore async def fetch_body_html( - self: Self, + self, /, ) -> str | None: """ @@ -266,7 +265,7 @@ async def fetch_body_html( return await self._fetch_field("bodyHTML") # type: ignore async def fetch_body_text( - self: Self, + self, /, ) -> str | None: """ @@ -280,7 +279,7 @@ async def fetch_body_text( return await self._fetch_field("bodyText") # type: ignore async def fetch_created_at( - self: Self, + self, /, ) -> DateTime: """ @@ -310,7 +309,7 @@ async def fetch_created_at( return github.utility.iso_to_datetime(created_at) async def fetch_edit_count( - self: Self, + self, /, ) -> int: """ @@ -344,7 +343,7 @@ async def fetch_edit_count( return edits - 1 async def fetch_edited_at( - self: Self, + self, /, ) -> DateTime | None: """ @@ -377,7 +376,7 @@ async def fetch_edited_at( return github.utility.iso_to_datetime(edited_at) async def fetch_is_email( - self: Self, + self, /, ) -> bool: """ @@ -399,7 +398,7 @@ async def fetch_is_email( return await self._fetch_field("createdViaEmail") # type: ignore async def fetch_published_at( - self: Self, + self, /, ) -> DateTime | None: """ @@ -432,7 +431,7 @@ async def fetch_published_at( return github.utility.iso_to_datetime(published_at) async def fetch_updated_at( - self: Self, + self, /, ) -> DateTime: """ @@ -463,7 +462,7 @@ async def fetch_updated_at( return github.utility.iso_to_datetime(updated_at) async def fetch_viewer_is_author( - self: Self, + self, /, ) -> bool: """ @@ -477,7 +476,7 @@ async def fetch_viewer_is_author( return await self._fetch_field("viewerDidAuthor") # type: ignore async def fetch_author( - self: Self, + self, /, **kwargs, # TODO ) -> Bot | Mannequin | User: @@ -516,7 +515,7 @@ async def fetch_author( raise RuntimeError(f"unsupported type {graphql_type} for Comment.author") async def fetch_editor( - self: Self, + self, /, **kwargs, # TODO ) -> Bot | User | None: diff --git a/github/interfaces/deletable.py b/github/interfaces/deletable.py index 516869bf..d9bb06e4 100644 --- a/github/interfaces/deletable.py +++ b/github/interfaces/deletable.py @@ -1,9 +1,6 @@ from __future__ import annotations from typing import TYPE_CHECKING -if TYPE_CHECKING: - from typing_extensions import Self - if TYPE_CHECKING: from typing import TypedDict @@ -28,7 +25,7 @@ class Deletable: @property def viewer_can_delete( - self: Self, + self, /, ) -> bool: """ @@ -40,7 +37,7 @@ def viewer_can_delete( return self._data["viewerCanDelete"] async def fetch_viewer_can_delete( - self: Self, + self, /, ) -> bool: """ diff --git a/github/interfaces/discussionauthor.py b/github/interfaces/discussionauthor.py index f2b7e2b8..1a7565cf 100644 --- a/github/interfaces/discussionauthor.py +++ b/github/interfaces/discussionauthor.py @@ -1,9 +1,6 @@ from __future__ import annotations from typing import TYPE_CHECKING -if TYPE_CHECKING: - from typing_extensions import Self - if TYPE_CHECKING: from typing import TypedDict @@ -27,7 +24,7 @@ class DiscussionAuthor: _data: DiscussionAuthorData async def fetch_discussion_comments( - self: Self, + self, /, ) -> None: """ @@ -51,7 +48,7 @@ async def fetch_discussion_comments( raise NotImplementedError # TODO: RepositoryDiscussionCommentAuthor.repositoryDiscussionComments async def fetch_discussions( - self: Self, + self, /, ) -> None: """ @@ -75,6 +72,6 @@ async def fetch_discussions( raise NotImplementedError # TODO: RepositoryDiscussionAuthor.repositoryDiscussions -__all__: list[str] = [ +__all__ = [ "DiscussionAuthor", ] diff --git a/github/interfaces/gitnode.py b/github/interfaces/gitnode.py index f643137e..f1c2766f 100644 --- a/github/interfaces/gitnode.py +++ b/github/interfaces/gitnode.py @@ -1,9 +1,6 @@ from __future__ import annotations from typing import TYPE_CHECKING -if TYPE_CHECKING: - from typing_extensions import Self - if TYPE_CHECKING: from typing import TypedDict @@ -38,7 +35,7 @@ class GitNode: @property def object_id( - self: Self, + self, /, ) -> str: """ @@ -50,7 +47,7 @@ def object_id( return self._data["oid"] async def fetch_object_id( - self: Self, + self, /, ) -> str: """ diff --git a/github/interfaces/labelable.py b/github/interfaces/labelable.py index 3c9a65b6..e33d2bdb 100644 --- a/github/interfaces/labelable.py +++ b/github/interfaces/labelable.py @@ -2,8 +2,6 @@ from typing import TYPE_CHECKING if TYPE_CHECKING: - from typing_extensions import Self - from github.connection import Connection, LabelOrder from github.interfaces import Node from github.repository import Label @@ -41,7 +39,7 @@ class Labelable: @property def label_count( - self: Self, + self, /, ) -> int: """ @@ -54,7 +52,7 @@ def label_count( @property def viewer_can_label( - self: Self, + self, /, ) -> bool: """ @@ -67,7 +65,7 @@ def viewer_can_label( return self._data["viewerCanLabel"] async def fetch_label_count( - self: Self, + self, /, ) -> int: """ @@ -92,7 +90,7 @@ async def fetch_label_count( return await self._fetch_field("labels{totalCount}") # type: ignore async def fetch_viewer_can_label( - self: Self, + self, /, ) -> bool: """ @@ -107,7 +105,7 @@ async def fetch_viewer_can_label( return await self._fetch_field("viewerCanLabel") # type: ignore def fetch_labels( - self: Self, + self, /, *, cursor: str | None = MISSING, @@ -163,7 +161,7 @@ def labeldata_to_label(labeldata: LabelData, /) -> Label: ) async def add_labels( - self: Self, + self, /, *labels: Label, ) -> None: @@ -198,7 +196,7 @@ async def add_labels( self._data["labels"]["totalCount"] = data["labels"]["totalCount"] async def remove_labels( - self: Self, + self, /, *labels: Label, ) -> None: diff --git a/github/interfaces/lockable.py b/github/interfaces/lockable.py index 44267b4a..91f73dab 100644 --- a/github/interfaces/lockable.py +++ b/github/interfaces/lockable.py @@ -1,9 +1,6 @@ from __future__ import annotations from typing import TYPE_CHECKING -if TYPE_CHECKING: - from typing_extensions import Self - if TYPE_CHECKING: from typing import Literal, TypedDict @@ -30,7 +27,7 @@ class Lockable: @property def is_locked( - self: Self, + self, /, ) -> bool: """ @@ -42,7 +39,7 @@ def is_locked( return self._data["locked"] async def fetch_is_locked( - self: Self, + self, /, ) -> bool: """ diff --git a/github/interfaces/node.py b/github/interfaces/node.py index dd5c2785..98a072ad 100644 --- a/github/interfaces/node.py +++ b/github/interfaces/node.py @@ -3,7 +3,6 @@ if TYPE_CHECKING: from typing import Any, ClassVar, cast - from typing_extensions import Self from github.core.http import HTTPClient from github.interfaces.type import Type @@ -54,13 +53,13 @@ class Node: _node_prefix: ClassVar[str] = MISSING def __hash__( - self: Self, + self, /, ) -> int: return hash(self.id) def __eq__( - self: Self, + self, other: Any, /, ) -> bool: @@ -71,7 +70,7 @@ def __eq__( @property def id( - self: Self, + self, /, ) -> str: """ @@ -83,7 +82,7 @@ def id( return self._data["id"] async def _fetch_field( - self: Self, + self, field: T_json_key, /, *, @@ -114,7 +113,7 @@ async def _fetch_field( return value async def fetch_id( - self: Self, + self, /, ) -> str: """ @@ -136,6 +135,6 @@ async def fetch_id( return await self._fetch_field("id") # type: ignore -__all__: list[str] = [ +__all__ = [ "Node", ] diff --git a/github/interfaces/packageowner.py b/github/interfaces/packageowner.py index 75c02e20..787a7002 100644 --- a/github/interfaces/packageowner.py +++ b/github/interfaces/packageowner.py @@ -2,8 +2,6 @@ from typing import TYPE_CHECKING if TYPE_CHECKING: - from typing_extensions import Self - from github.interfaces import Node @@ -33,7 +31,7 @@ class PackageOwner: @property def package_count( - self: Self, + self, /, ) -> int: """ @@ -45,7 +43,7 @@ def package_count( return self._data["packages"]["totalCount"] async def fetch_package_count( - self: Self, + self, /, ) -> int: """ @@ -70,6 +68,6 @@ async def fetch_package_count( return await self._fetch_field("packages{totalCount}") # type: ignore -__all__: list[str] = [ +__all__ = [ "PackageOwner", ] diff --git a/github/interfaces/profileowner.py b/github/interfaces/profileowner.py index 81a7be80..db2b6365 100644 --- a/github/interfaces/profileowner.py +++ b/github/interfaces/profileowner.py @@ -1,9 +1,6 @@ from __future__ import annotations from typing import TYPE_CHECKING -if TYPE_CHECKING: - from typing_extensions import Self - if TYPE_CHECKING: from typing import TypeVar, TypedDict @@ -64,7 +61,7 @@ def _patch_data( @property def can_viewer_update_showcase( - self: Self, + self, /, ) -> bool: """ @@ -78,7 +75,7 @@ def can_viewer_update_showcase( @property def email( - self: Self, + self, /, ) -> str | None: """ @@ -99,7 +96,7 @@ def email( @property def has_pinnable_items( - self: Self, + self, /, ) -> bool: """ @@ -112,7 +109,7 @@ def has_pinnable_items( @property def has_pinned_items( - self: Self, + self, /, ) -> bool: """ @@ -125,7 +122,7 @@ def has_pinned_items( @property def location( - self: Self, + self, /, ) -> str | None: """ @@ -138,7 +135,7 @@ def location( @property def name( - self: Self, + self, /, ) -> str | None: """ @@ -151,7 +148,7 @@ def name( @property def showcase_slots_remaining( - self: Self, + self, /, ) -> int: """ @@ -164,7 +161,7 @@ def showcase_slots_remaining( @property def website( - self: Self, + self, /, ) -> str | None: """ @@ -176,7 +173,7 @@ def website( return self._data["websiteUrl"] async def fetch_email( - self: Self, + self, /, ) -> str | None: """ @@ -207,7 +204,7 @@ async def fetch_email( return await self._fetch_field("email") # type: ignore async def fetch_pinnable_items( - self: Self, + self, /, ) -> None: """ @@ -231,7 +228,7 @@ async def fetch_pinnable_items( raise NotImplementedError # TODO: ProfileOwner.pinnableItems async def fetch_pinned_items( - self: Self, + self, /, ) -> None: """ @@ -255,7 +252,7 @@ async def fetch_pinned_items( raise NotImplementedError # TODO: ProfileOwner.pinnedItems async def fetch_showcase_items( - self: Self, + self, /, ) -> None: """ @@ -279,6 +276,6 @@ async def fetch_showcase_items( raise NotImplementedError # TODO: ProfileOwner.itemShowcase.items -__all__: list[str] = [ +__all__ = [ "ProfileOwner", ] diff --git a/github/interfaces/projectowner.py b/github/interfaces/projectowner.py index 62b43bc4..1ffe3c7a 100644 --- a/github/interfaces/projectowner.py +++ b/github/interfaces/projectowner.py @@ -69,6 +69,6 @@ async def fetch_project_count( return await self._fetch_field("projectsV2{totalCount}") # type: ignore -__all__: list[str] = [ +__all__ = [ "ProjectOwner", ] diff --git a/github/interfaces/reactable.py b/github/interfaces/reactable.py index 41c10e73..d2aa201b 100644 --- a/github/interfaces/reactable.py +++ b/github/interfaces/reactable.py @@ -2,8 +2,6 @@ from typing import TYPE_CHECKING if TYPE_CHECKING: - from typing_extensions import Self - from github.connection import Connection, ReactionOrder from github.content import Reaction, ReactionContent from github.interfaces import Node @@ -42,7 +40,7 @@ class Reactable: @property def reaction_count( - self: Self, + self, /, ) -> int: """ @@ -55,7 +53,7 @@ def reaction_count( @property def viewer_can_react( - self: Self, + self, /, ) -> bool: """ @@ -67,7 +65,7 @@ def viewer_can_react( return self._data["viewerCanReact"] async def fetch_reaction_count( - self: Self, + self, /, ) -> int: """ @@ -92,7 +90,7 @@ async def fetch_reaction_count( return await self._fetch_field("reactions{totalCount}") # type: ignore async def fetch_viewer_can_react( - self: Self, + self, /, ) -> bool: """ @@ -107,7 +105,7 @@ async def fetch_viewer_can_react( return await self._fetch_field("viewerCanReact") # type: ignore def fetch_reactions( - self: Self, + self, /, *, cursor: str | None = MISSING, @@ -157,7 +155,7 @@ def fetch_reactions( ) async def add_reaction( - self: Self, + self, content: ReactionContent, /, ) -> Reaction: @@ -204,7 +202,7 @@ async def add_reaction( return github.Reaction._from_data(reaction_data, http=self._http) async def remove_reaction( - self: Self, + self, content: ReactionContent, /, ) -> None: diff --git a/github/interfaces/repositorynode.py b/github/interfaces/repositorynode.py index 697883b4..88678d6f 100644 --- a/github/interfaces/repositorynode.py +++ b/github/interfaces/repositorynode.py @@ -2,8 +2,6 @@ from typing import TYPE_CHECKING if TYPE_CHECKING: - from typing_extensions import Self - from github.interfaces import Node from github.repository import Repository @@ -30,7 +28,7 @@ class RepositoryNode: _data: RepositoryNodeData async def fetch_repository( - self: Self, + self, /, **kwargs, # TODO ) -> Repository: @@ -57,6 +55,6 @@ async def fetch_repository( return github.Repository._from_data(data, http=self._http) -__all__: list[str] = [ +__all__ = [ "RepositoryNode", ] diff --git a/github/interfaces/repositoryowner.py b/github/interfaces/repositoryowner.py index 16e62129..e2471fad 100644 --- a/github/interfaces/repositoryowner.py +++ b/github/interfaces/repositoryowner.py @@ -2,8 +2,6 @@ from typing import TYPE_CHECKING if TYPE_CHECKING: - from typing_extensions import Self - from github.connection import Connection, RepositoryOrder from github.interfaces import Node from github.repository import Repository @@ -44,7 +42,7 @@ class RepositoryOwner: @property def repository_count( - self: Self, + self, /, ) -> int: """ @@ -56,7 +54,7 @@ def repository_count( return self._data["repositories"]["totalCount"] async def fetch_repository_count( - self: Self, + self, /, ) -> int: """ @@ -81,7 +79,7 @@ async def fetch_repository_count( return await self._fetch_field("repositories{totalCount}") # type: ignore async def fetch_repository( - self: Self, + self, name: str, /, *, @@ -126,7 +124,7 @@ async def fetch_repository( return github.Repository._from_data(data, http=self._http) def fetch_repositories( - self: Self, + self, /, *, cursor: str | None = MISSING, @@ -182,6 +180,6 @@ def repositorydata_to_repository(repositorydata: RepositoryData, /) -> Repositor ) -__all__: list[str] = [ +__all__ = [ "RepositoryOwner", ] diff --git a/github/interfaces/resource.py b/github/interfaces/resource.py index b95de2a4..1c6df633 100644 --- a/github/interfaces/resource.py +++ b/github/interfaces/resource.py @@ -3,7 +3,6 @@ if TYPE_CHECKING: from typing import cast - from typing_extensions import Self from github.interfaces import Node, Type from github.utility.types import T_json_key, T_json_value @@ -37,7 +36,7 @@ class Resource: @property def resource_path( - self: Self, + self, /, ) -> str: """ @@ -50,7 +49,7 @@ def resource_path( @property def url( - self: Self, + self, /, ) -> str: """ @@ -62,7 +61,7 @@ def url( return self._data["url"] async def _fetch_field( - self: Self, + self, field: T_json_key, /, *, @@ -96,7 +95,7 @@ async def _fetch_field( return value async def fetch_resource_path( - self: Self, + self, /, ) -> str: """ @@ -118,7 +117,7 @@ async def fetch_resource_path( return await self._fetch_field("resourcePath") # type: ignore async def fetch_url( - self: Self, + self, /, ) -> str: """ @@ -140,6 +139,6 @@ async def fetch_url( return await self._fetch_field("url") # type: ignore -__all__: list[str] = [ +__all__ = [ "Resource", ] diff --git a/github/interfaces/sponsorable.py b/github/interfaces/sponsorable.py index 40ff2e17..9a1b9c54 100644 --- a/github/interfaces/sponsorable.py +++ b/github/interfaces/sponsorable.py @@ -2,8 +2,6 @@ from typing import TYPE_CHECKING if TYPE_CHECKING: - from typing_extensions import Self - from github.core.http import HTTPClient @@ -56,7 +54,7 @@ class Sponsorable: @property def can_viewer_sponsor( - self: Self, + self, /, ) -> bool: """ @@ -69,7 +67,7 @@ def can_viewer_sponsor( @property def has_sponsors_listing( - self: Self, + self, /, ) -> bool: """ @@ -82,7 +80,7 @@ def has_sponsors_listing( @property def is_sponsoring_viewer( - self: Self, + self, /, ) -> bool: """ @@ -95,7 +93,7 @@ def is_sponsoring_viewer( @property def is_viewer_sponsoring( - self: Self, + self, /, ) -> bool: """ @@ -107,7 +105,7 @@ def is_viewer_sponsoring( return self._data["viewerIsSponsoring"] async def fetch_can_viewer_sponsor( - self: Self, + self, /, ) -> bool: """ @@ -122,7 +120,7 @@ async def fetch_can_viewer_sponsor( return await self._fetch_field("viewerCanSponsor") # type: ignore async def fetch_has_sponsors_listing( - self: Self, + self, /, ) -> bool: """ @@ -136,7 +134,7 @@ async def fetch_has_sponsors_listing( return await self._fetch_field("hasSponsorsListing") # type: ignore async def fetch_is_sponsoring_viewer( - self: Self, + self, /, ) -> bool: """ @@ -151,7 +149,7 @@ async def fetch_is_sponsoring_viewer( return await self._fetch_field("isSponsoringViewer") # type: ignore async def fetch_is_viewer_sponsoring( - self: Self, + self, /, ) -> bool: """ @@ -166,6 +164,6 @@ async def fetch_is_viewer_sponsoring( return await self._fetch_field("viewerIsSponsoring") # type: ignore -__all__: list[str] = [ +__all__ = [ "Sponsorable", ] diff --git a/github/interfaces/starrable.py b/github/interfaces/starrable.py index 6037845f..c570e18d 100644 --- a/github/interfaces/starrable.py +++ b/github/interfaces/starrable.py @@ -2,8 +2,6 @@ from typing import TYPE_CHECKING if TYPE_CHECKING: - from typing_extensions import Self - from github.connection import Connection, StargazerOrder from github.interfaces import Node from github.user import User @@ -43,7 +41,7 @@ class Starrable: @property def has_viewer_starred( - self: Self, + self, /, ) -> bool: """ @@ -56,7 +54,7 @@ def has_viewer_starred( @property def stargazer_count( - self: Self, + self, /, ) -> int: """ @@ -68,7 +66,7 @@ def stargazer_count( return self._data["stargazerCount"] async def fetch_has_viewer_starred( - self: Self, + self, /, ) -> bool: """ @@ -82,7 +80,7 @@ async def fetch_has_viewer_starred( return await self._fetch_field("viewerHasStarred") # type: ignore async def fetch_stargazer_count( - self: Self, + self, /, ) -> int: """ @@ -96,7 +94,7 @@ async def fetch_stargazer_count( return await self._fetch_field("stargazerCount") # type: ignore def fetch_stargazers( - self: Self, + self, /, *, cursor: str | None = MISSING, @@ -147,7 +145,7 @@ def userdata_to_user(userdata: UserData, /) -> User: ) async def star( - self: Self, + self, /, ) -> None: """ @@ -168,7 +166,7 @@ async def star( self._data["viewerHasStarred"] = data["viewerHasStarred"] async def unstar( - self: Self, + self, /, ) -> None: """ @@ -189,6 +187,6 @@ async def unstar( self._data["viewerHasStarred"] = data["viewerHasStarred"] -__all__: list[str] = [ +__all__ = [ "Starrable", ] diff --git a/github/interfaces/subscribable.py b/github/interfaces/subscribable.py index 032749bf..f4c533b3 100644 --- a/github/interfaces/subscribable.py +++ b/github/interfaces/subscribable.py @@ -2,9 +2,6 @@ from typing import TYPE_CHECKING if TYPE_CHECKING: - from typing_extensions import Self - - from github.core.http import HTTPClient from github.interfaces import Node from github.repository import SubscriptionState @@ -39,7 +36,7 @@ class Subscribable: @property def viewer_can_update_subscription( - self: Self, + self, /, ) -> bool: """ @@ -53,7 +50,7 @@ def viewer_can_update_subscription( @property def viewer_subscription( - self: Self, + self, /, ) -> SubscriptionState: """ @@ -65,7 +62,7 @@ def viewer_subscription( return github.SubscriptionState(self._data["viewerSubscription"]) async def fetch_viewer_can_update_subscription( - self: Self, + self, /, ) -> bool: """ @@ -80,7 +77,7 @@ async def fetch_viewer_can_update_subscription( return await self._fetch_field("viewerCanSubscribe") # type: ignore async def fetch_viewer_subscription( - self: Self, + self, /, ) -> SubscriptionState: """ @@ -97,7 +94,7 @@ async def fetch_viewer_subscription( return github.SubscriptionState(subscription) async def ignore( - self: Self, + self, /, ) -> None: """ @@ -113,7 +110,7 @@ async def ignore( await self.update_subscription(github.SubscriptionState.ignored) async def subscribe( - self: Self, + self, /, ) -> None: """ @@ -129,7 +126,7 @@ async def subscribe( await self.update_subscription(github.SubscriptionState.subscribed) async def unsubscribe( - self: Self, + self, /, ) -> None: """ @@ -145,7 +142,7 @@ async def unsubscribe( await self.update_subscription(github.SubscriptionState.unsubscribed) async def update_subscription( - self: Self, + self, /, state: SubscriptionState, ) -> None: @@ -168,6 +165,6 @@ async def update_subscription( self._data["viewerSubscription"] = data["viewerSubscription"] -__all__: list[str] = [ +__all__ = [ "Subscribable", ] diff --git a/github/interfaces/type.py b/github/interfaces/type.py index d92b8b05..d8b1dfc1 100644 --- a/github/interfaces/type.py +++ b/github/interfaces/type.py @@ -2,8 +2,7 @@ from typing import TYPE_CHECKING if TYPE_CHECKING: - from typing import ClassVar, Iterable, cast, overload - from typing_extensions import Self + from typing import ClassVar from github.core.http import HTTPClient from github.utility.types import T_json_object @@ -36,7 +35,7 @@ class Type(abc.ABC): _graphql_type: ClassVar[str] def __init__( - self: Self, + self, data: T_json_object, http: HTTPClient | None = None, /, @@ -45,7 +44,7 @@ def __init__( self._http: HTTPClient | None = http def __repr__( - self: Self, + self, /, ) -> str: d_fields = utility.get_defined_repr_fields(self.__class__) @@ -76,15 +75,15 @@ def _patch_data( @classmethod @abc.abstractmethod def _from_data( - cls: type[Self], + cls, data: T_json_object, /, *, http: HTTPClient | None = None, - ) -> Self: + ): raise NotImplementedError -__all__: list[str] = [ +__all__ = [ "Type", ] diff --git a/github/interfaces/updatable.py b/github/interfaces/updatable.py index 7c93ef52..0c0d9ec2 100644 --- a/github/interfaces/updatable.py +++ b/github/interfaces/updatable.py @@ -1,9 +1,6 @@ from __future__ import annotations from typing import TYPE_CHECKING -if TYPE_CHECKING: - from typing_extensions import Self - if TYPE_CHECKING: from typing import TypedDict @@ -28,7 +25,7 @@ class Updatable: @property def viewer_can_update( - self: Self, + self, /, ) -> bool: """ @@ -40,7 +37,7 @@ def viewer_can_update( return self._data["viewerCanUpdate"] async def fetch_viewer_can_update( - self: Self, + self, /, ) -> bool: """ diff --git a/github/interfaces/votable.py b/github/interfaces/votable.py index d645c42b..24f24668 100644 --- a/github/interfaces/votable.py +++ b/github/interfaces/votable.py @@ -1,9 +1,6 @@ from __future__ import annotations from typing import TYPE_CHECKING -if TYPE_CHECKING: - from typing_extensions import Self - if TYPE_CHECKING: from typing import TypedDict @@ -32,7 +29,7 @@ class Votable: @property def upvote_count( - self: Self, + self, /, ) -> int: """ @@ -45,7 +42,7 @@ def upvote_count( @property def viewer_can_upvote( - self: Self, + self, /, ) -> bool: """ @@ -58,7 +55,7 @@ def viewer_can_upvote( @property def viewer_has_upvoted( - self: Self, + self, /, ) -> bool: """ @@ -70,7 +67,7 @@ def viewer_has_upvoted( return self._data["viewerHasUpvoted"] async def fetch_upvote_count( - self: Self, + self, /, ) -> int: """ @@ -84,7 +81,7 @@ async def fetch_upvote_count( return await self._fetch_field("upvoteCount") # type: ignore async def fetch_viewer_can_upvote( - self: Self, + self, /, ) -> bool: """ @@ -98,7 +95,7 @@ async def fetch_viewer_can_upvote( return await self._fetch_field("viewerCanUpvote") # type: ignore async def fetch_viewer_has_upvoted( - self: Self, + self, /, ) -> bool: """ diff --git a/github/organization/__init__.py b/github/organization/__init__.py index ebc9a9bb..a8642ca9 100644 --- a/github/organization/__init__.py +++ b/github/organization/__init__.py @@ -4,7 +4,7 @@ from github.organization.team import __all__ as _team__all__ -__all__: list[str] = [ # type: ignore[reportUnsupportedDunderAll] +__all__ = [ # type: ignore[reportUnsupportedDunderAll] *_organization__all__, *_team__all__, ] diff --git a/github/organization/organization.py b/github/organization/organization.py index de1f456a..db6a9e2b 100644 --- a/github/organization/organization.py +++ b/github/organization/organization.py @@ -3,7 +3,6 @@ if TYPE_CHECKING: from typing import cast - from typing_extensions import Self from github.automation import Mannequin from github.connection import Connection, MannequinOrder, TeamOrder @@ -142,12 +141,12 @@ def _patch_data( @classmethod def _from_data( - cls: type[Self], + cls, data: OrganizationData, /, *, http: HTTPClient, - ) -> Self: + ): return cls(cls._patch_data(data), http) _graphql_fields = { @@ -171,7 +170,7 @@ def _from_data( @property def archived_at( - self: Self, + self, /, ) -> DateTime | None: """ @@ -189,7 +188,7 @@ def archived_at( @property def can_viewer_administer( - self: Self, + self, /, ) -> bool: """ @@ -202,7 +201,7 @@ def can_viewer_administer( @property def can_viewer_create_teams( - self: Self, + self, /, ) -> bool: """ @@ -216,7 +215,7 @@ def can_viewer_create_teams( @property def created_at( - self: Self, + self, /, ) -> DateTime: """ @@ -229,7 +228,7 @@ def created_at( @property def database_id( - self: Self, + self, /, ) -> int: """ @@ -242,7 +241,7 @@ def database_id( @property def description( - self: Self, + self, /, ) -> str | None: """ @@ -255,7 +254,7 @@ def description( @property def description_html( - self: Self, + self, /, ) -> str | None: """ @@ -275,7 +274,7 @@ def description_html( @property def is_verified( - self: Self, + self, /, ) -> bool: """ @@ -288,7 +287,7 @@ def is_verified( @property def is_viewer_following( - self: Self, + self, /, ) -> bool: """ @@ -301,7 +300,7 @@ def is_viewer_following( @property def is_viewer_member( - self: Self, + self, /, ) -> bool: """ @@ -314,7 +313,7 @@ def is_viewer_member( @property def mannequin_count( - self: Self, + self, /, ) -> int: """ @@ -327,7 +326,7 @@ def mannequin_count( @property def team_count( - self: Self, + self, /, ) -> int: """ @@ -340,7 +339,7 @@ def team_count( @property def twitter_username( - self: Self, + self, /, ) -> str | None: """ @@ -353,7 +352,7 @@ def twitter_username( @property def updated_at( - self: Self, + self, /, ) -> DateTime: """ @@ -365,7 +364,7 @@ def updated_at( return github.utility.iso_to_datetime(self._data["updatedAt"]) async def fetch_archived_at( - self: Self, + self, /, ) -> DateTime | None: """ @@ -396,7 +395,7 @@ async def fetch_archived_at( return github.utility.iso_to_datetime(archived_at) async def fetch_can_viewer_administer( - self: Self, + self, /, ) -> bool: """ @@ -419,7 +418,7 @@ async def fetch_can_viewer_administer( return await self._fetch_field("viewerCanAdminister") # type: ignore async def fetch_can_viewer_create_teams( - self: Self, + self, /, ) -> bool: """ @@ -442,7 +441,7 @@ async def fetch_can_viewer_create_teams( return await self._fetch_field("viewerCanCreateTeams") # type: ignore async def fetch_created_at( - self: Self, + self, /, ) -> DateTime: """ @@ -470,7 +469,7 @@ async def fetch_created_at( return github.utility.iso_to_datetime(created_at) async def fetch_database_id( - self: Self, + self, /, ) -> int: """ @@ -492,7 +491,7 @@ async def fetch_database_id( return await self._fetch_field("databaseId") # type: ignore async def fetch_description( - self: Self, + self, /, ) -> str | None: """ @@ -514,7 +513,7 @@ async def fetch_description( return await self._fetch_field("description") # type: ignore async def fetch_description_html( - self: Self, + self, /, ) -> str | None: """ @@ -536,7 +535,7 @@ async def fetch_description_html( return await self._fetch_field("descriptionHTML") # type: ignore async def fetch_is_verified( - self: Self, + self, /, ) -> bool: """ @@ -559,7 +558,7 @@ async def fetch_is_verified( return await self._fetch_field("isVerified") # type: ignore async def fetch_is_viewer_following( - self: Self, + self, /, ) -> bool: """ @@ -582,7 +581,7 @@ async def fetch_is_viewer_following( return await self._fetch_field("viewerIsFollowing") # type: ignore async def fetch_is_viewer_member( - self: Self, + self, /, ) -> bool: """ @@ -605,7 +604,7 @@ async def fetch_is_viewer_member( return await self._fetch_field("viewerIsAMember") # type: ignore async def fetch_mannequin_count( - self: Self, + self, /, ) -> int: """ @@ -627,7 +626,7 @@ async def fetch_mannequin_count( return await self._fetch_field("mannequins{totalCount}") # type: ignore async def fetch_team_count( - self: Self, + self, /, ) -> int: """ @@ -649,7 +648,7 @@ async def fetch_team_count( return await self._fetch_field("teams{totalCount}") # type: ignore async def fetch_twitter_username( - self: Self, + self, /, ) -> str | None: """ @@ -671,7 +670,7 @@ async def fetch_twitter_username( return await self._fetch_field("twitterUsername") # type: ignore async def fetch_updated_at( - self: Self, + self, /, ) -> DateTime: """ @@ -699,7 +698,7 @@ async def fetch_updated_at( return github.utility.iso_to_datetime(updated_at) async def fetch_team( - self: Self, + self, slug: str, /, **kwargs, # TODO @@ -730,7 +729,7 @@ async def fetch_team( return github.Team._from_data(data, http=self._http) def fetch_mannequins( - self: Self, + self, /, *, cursor: str | None = MISSING, @@ -782,7 +781,7 @@ def mannequindata_to_mannequin(mannequindata: MannequinData, /) -> Mannequin: ) def fetch_teams( - self: Self, + self, /, *, cursor: str | None = MISSING, diff --git a/github/organization/team.py b/github/organization/team.py index 91298518..b3079239 100644 --- a/github/organization/team.py +++ b/github/organization/team.py @@ -3,7 +3,6 @@ if TYPE_CHECKING: from typing import cast - from typing_extensions import Self from github.connection import Connection from github.core.http import HTTPClient @@ -110,12 +109,12 @@ def _patch_data( @classmethod def _from_data( - cls: type[Self], + cls, data: TeamData, /, *, http: HTTPClient, - ) -> Self: + ): return cls(cls._patch_data(data), http) _graphql_fields = { @@ -152,7 +151,7 @@ def _from_data( @property def avatar_url( - self: Self, + self, /, ) -> str: """ @@ -165,7 +164,7 @@ def avatar_url( @property def created_at( - self: Self, + self, /, ) -> DateTime: """ @@ -178,7 +177,7 @@ def created_at( @property def database_id( - self: Self, + self, /, ) -> int: """ @@ -191,7 +190,7 @@ def database_id( @property def description( - self: Self, + self, /, ) -> str | None: """ @@ -204,7 +203,7 @@ def description( @property def name( - self: Self, + self, /, ) -> str: """ @@ -217,7 +216,7 @@ def name( @property def slug( - self: Self, + self, /, ) -> str: """ @@ -230,7 +229,7 @@ def slug( @property def updated_at( - self: Self, + self, /, ) -> DateTime: """ @@ -243,7 +242,7 @@ def updated_at( @property def viewer_can_administer( - self: Self, + self, /, ) -> bool: """ @@ -255,7 +254,7 @@ def viewer_can_administer( return self._data["viewerCanAdminister"] async def fetch_avatar_url( - self: Self, + self, /, *, size: int = MISSING, @@ -286,7 +285,7 @@ async def fetch_avatar_url( return await self._fetch_field(field, save=save) # type: ignore async def fetch_created_at( - self: Self, + self, /, ) -> DateTime: """ @@ -313,7 +312,7 @@ async def fetch_created_at( return github.utility.iso_to_datetime(created_at) async def fetch_database_id( - self: Self, + self, /, ) -> int: """ @@ -335,7 +334,7 @@ async def fetch_database_id( return await self._fetch_field("databaseId") # type: ignore async def fetch_description( - self: Self, + self, /, ) -> str | None: """ @@ -357,7 +356,7 @@ async def fetch_description( return await self._fetch_field("description") # type: ignore async def fetch_name( - self: Self, + self, /, ) -> str: """ @@ -379,7 +378,7 @@ async def fetch_name( return await self._fetch_field("name") # type: ignore async def fetch_slug( - self: Self, + self, /, ) -> str: """ @@ -401,7 +400,7 @@ async def fetch_slug( return await self._fetch_field("slug") # type: ignore async def fetch_updated_at( - self: Self, + self, /, ) -> DateTime: """ @@ -428,7 +427,7 @@ async def fetch_updated_at( return github.utility.iso_to_datetime(updated_at) async def fetch_viewer_can_administer( - self: Self, + self, /, ) -> bool: """ @@ -450,7 +449,7 @@ async def fetch_viewer_can_administer( return await self._fetch_field("viewerCanAdminister") # type: ignore def fetch_ancestors( - self: Self, + self, /, *, cursor: str | None = MISSING, diff --git a/github/repository/__init__.py b/github/repository/__init__.py index 76e429dd..878315a4 100644 --- a/github/repository/__init__.py +++ b/github/repository/__init__.py @@ -24,7 +24,7 @@ from github.repository.topic import __all__ as _topic__all__ -__all__: list[str] = [ # type: ignore[reportUnsupportedDunderAll] +__all__ = [ # type: ignore[reportUnsupportedDunderAll] *_discussion__all__, *_discussionstate__all__, *_issue__all__, diff --git a/github/repository/discussion.py b/github/repository/discussion.py index 48f52c99..769506e7 100644 --- a/github/repository/discussion.py +++ b/github/repository/discussion.py @@ -2,8 +2,6 @@ from typing import TYPE_CHECKING if TYPE_CHECKING: - from typing_extensions import Self - from github.core.http import HTTPClient from github.repository import DiscussionState @@ -107,12 +105,12 @@ def _patch_data( @classmethod def _from_data( - cls: type[Self], + cls, data: DiscussionData, /, *, http: HTTPClient, - ) -> Self: + ): return cls(cls._patch_data(data), http) _repr_fields = [ @@ -132,7 +130,7 @@ def _from_data( @property def database_id( - self: Self, + self, /, ) -> int: """ @@ -145,7 +143,7 @@ def database_id( @property def is_answered( - self: Self, + self, /, ) -> bool: """ @@ -158,7 +156,7 @@ def is_answered( @property def number( - self: Self, + self, /, ) -> int: """ @@ -171,7 +169,7 @@ def number( @property def state( - self: Self, + self, /, ) -> DiscussionState: """ @@ -197,7 +195,7 @@ def state( @property def title( - self: Self, + self, /, ) -> str: """ @@ -209,7 +207,7 @@ def title( return self._data["title"] async def fetch_database_id( - self: Self, + self, /, ) -> int: """ @@ -231,7 +229,7 @@ async def fetch_database_id( return await self._fetch_field("databaseId") # type: ignore async def fetch_is_answered( - self: Self, + self, /, ) -> bool: """ @@ -253,7 +251,7 @@ async def fetch_is_answered( return await self._fetch_field("isAnswered") # type: ignore async def fetch_number( - self: Self, + self, /, ) -> int: """ @@ -275,7 +273,7 @@ async def fetch_number( return await self._fetch_field("number") # type: ignore async def fetch_state( - self: Self, + self, /, ) -> DiscussionState: """ @@ -302,7 +300,7 @@ async def fetch_state( return github.DiscussionState.open async def fetch_title( - self: Self, + self, /, ) -> str: """ diff --git a/github/repository/discussionstate.py b/github/repository/discussionstate.py index 9bd759fd..1c69a7be 100644 --- a/github/repository/discussionstate.py +++ b/github/repository/discussionstate.py @@ -25,5 +25,5 @@ class DiscussionState(enum.Enum): __all__ = [ - "DiscussionState" + "DiscussionState", ] diff --git a/github/repository/issue.py b/github/repository/issue.py index ac7d0e0c..0f9be88e 100644 --- a/github/repository/issue.py +++ b/github/repository/issue.py @@ -2,8 +2,6 @@ from typing import TYPE_CHECKING if TYPE_CHECKING: - from typing_extensions import Self - from github.connection import Connection from github.core.http import HTTPClient from github.repository import IssueState, Milestone @@ -129,12 +127,12 @@ def _patch_data( @classmethod def _from_data( - cls: type[Self], + cls, data: IssueData, /, *, http: HTTPClient, - ) -> Self: + ): return cls(cls._patch_data(data), http) _repr_fields = [ @@ -160,7 +158,7 @@ def _from_data( @property def database_id( - self: Self, + self, /, ) -> int: """ @@ -173,7 +171,7 @@ def database_id( @property def is_pinned( - self: Self, + self, /, ) -> bool: """ @@ -186,7 +184,7 @@ def is_pinned( @property def is_read( - self: Self, + self, /, ) -> bool: """ @@ -199,7 +197,7 @@ def is_read( @property def number( - self: Self, + self, /, ) -> int: """ @@ -212,7 +210,7 @@ def number( @property def state( - self: Self, + self, /, ) -> IssueState: """ @@ -225,7 +223,7 @@ def state( @property def title( - self: Self, + self, /, ) -> str: """ @@ -238,7 +236,7 @@ def title( @property def title_html( - self: Self, + self, /, ) -> str: """ @@ -250,7 +248,7 @@ def title_html( return self._data["titleHTML"] async def fetch_database_id( - self: Self, + self, /, ) -> int: """ @@ -272,7 +270,7 @@ async def fetch_database_id( return int(await self._fetch_field("fullDatabaseId")) # type: ignore async def fetch_is_pinned( - self: Self, + self, /, ) -> bool: """ @@ -294,7 +292,7 @@ async def fetch_is_pinned( return await self._fetch_field("isPinned") # type: ignore async def fetch_is_read( - self: Self, + self, /, ) -> bool: """ @@ -317,7 +315,7 @@ async def fetch_is_read( return await self._fetch_field("isReadByViewer") # type: ignore async def fetch_number( - self: Self, + self, /, ) -> int: """ @@ -339,7 +337,7 @@ async def fetch_number( return await self._fetch_field("number") # type: ignore async def fetch_state( - self: Self, + self, /, ) -> IssueState: """ @@ -361,7 +359,7 @@ async def fetch_state( return github.IssueState(await self._fetch_field("state")) async def fetch_title( - self: Self, + self, /, ) -> str: """ @@ -383,7 +381,7 @@ async def fetch_title( return await self._fetch_field("title") # type: ignore async def fetch_title_html( - self: Self, + self, /, ) -> str: """ @@ -405,7 +403,7 @@ async def fetch_title_html( return await self._fetch_field("titleHTML") # type: ignore async def fetch_milestone( - self: Self, + self, /, **kwargs, # TODO ) -> Milestone | None: @@ -433,7 +431,7 @@ async def fetch_milestone( return github.Milestone._from_data(data, http=self._http) def fetch_participants( - self: Self, + self, /, *, cursor: str | None = MISSING, diff --git a/github/repository/issuestate.py b/github/repository/issuestate.py index 57c6fc7e..7d018d72 100644 --- a/github/repository/issuestate.py +++ b/github/repository/issuestate.py @@ -25,5 +25,5 @@ class IssueState(enum.Enum): __all__ = [ - "IssueState" + "IssueState", ] diff --git a/github/repository/label.py b/github/repository/label.py index 9d5eb0d6..31440af1 100644 --- a/github/repository/label.py +++ b/github/repository/label.py @@ -3,7 +3,6 @@ if TYPE_CHECKING: from typing import cast - from typing_extensions import Self from github.connection import Connection, IssueOrder, PullOrder from github.core.http import HTTPClient @@ -73,12 +72,12 @@ def _patch_data( @classmethod def _from_data( - cls: type[Self], + cls, data: LabelData, /, *, http: HTTPClient, - ) -> Self: + ): return cls(cls._patch_data(data), http) _repr_fields = [ @@ -98,7 +97,7 @@ def _from_data( @property def color( - self: Self, + self, /, ) -> int: """ @@ -111,7 +110,7 @@ def color( @property def created_at( - self: Self, + self, /, ) -> DateTime: """ @@ -124,7 +123,7 @@ def created_at( @property def description( - self: Self, + self, /, ) -> str | None: """ @@ -137,7 +136,7 @@ def description( @property def is_default( - self: Self, + self, /, ) -> bool: """ @@ -165,7 +164,7 @@ def is_default( @property def name( - self: Self, + self, /, ) -> str: """ @@ -178,7 +177,7 @@ def name( @property def updated_at( - self: Self, + self, /, ) -> DateTime: """ @@ -190,7 +189,7 @@ def updated_at( return github.utility.iso_to_datetime(self._data["updatedAt"]) async def fetch_color( - self: Self, + self, /, ) -> int: """ @@ -212,7 +211,7 @@ async def fetch_color( return int(await self._fetch_field("color"), 16) # type: ignore async def fetch_created_at( - self: Self, + self, /, ) -> DateTime: """ @@ -239,7 +238,7 @@ async def fetch_created_at( return github.utility.iso_to_datetime(created_at) async def fetch_description( - self: Self, + self, /, ) -> str | None: """ @@ -261,7 +260,7 @@ async def fetch_description( return await self._fetch_field("description") # type: ignore async def fetch_is_default( - self: Self, + self, /, ) -> bool: """ @@ -287,7 +286,7 @@ async def fetch_is_default( return await self._fetch_field("isDefault") # type: ignore async def fetch_name( - self: Self, + self, /, ) -> str: """ @@ -309,7 +308,7 @@ async def fetch_name( return await self._fetch_field("name") # type: ignore async def fetch_updated_at( - self: Self, + self, /, ) -> DateTime: """ @@ -336,7 +335,7 @@ async def fetch_updated_at( return github.utility.iso_to_datetime(updated_at) def fetch_issues( - self: Self, + self, /, *, cursor: str | None = MISSING, @@ -385,7 +384,7 @@ def fetch_issues( ) def fetch_pulls( - self: Self, + self, /, *, cursor: str | None = MISSING, diff --git a/github/repository/milestone.py b/github/repository/milestone.py index 07a3883e..019cee51 100644 --- a/github/repository/milestone.py +++ b/github/repository/milestone.py @@ -3,7 +3,6 @@ if TYPE_CHECKING: from typing import cast - from typing_extensions import Self from github.connection import Connection, IssueOrder, PullOrder from github.core.http import HTTPClient @@ -83,12 +82,12 @@ def _patch_data( @classmethod def _from_data( - cls: type[Self], + cls, data: MilestoneData, /, *, http: HTTPClient, - ) -> Self: + ): return cls(cls._patch_data(data), http) _repr_fields = [ @@ -110,7 +109,7 @@ def _from_data( @property def created_at( - self: Self, + self, /, ) -> DateTime: """ @@ -123,7 +122,7 @@ def created_at( @property def description( - self: Self, + self, /, ) -> str | None: """ @@ -136,7 +135,7 @@ def description( @property def due_at( - self: Self, + self, /, ) -> DateTime | None: """ @@ -154,7 +153,7 @@ def due_at( @property def number( - self: Self, + self, /, ) -> int: """ @@ -167,7 +166,7 @@ def number( @property def progress( - self: Self, + self, /, ) -> float: """ @@ -180,7 +179,7 @@ def progress( @property def state( - self: Self, + self, /, ) -> MilestoneState: """ @@ -193,7 +192,7 @@ def state( @property def title( - self: Self, + self, /, ) -> str: """ @@ -206,7 +205,7 @@ def title( @property def updated_at( - self: Self, + self, /, ) -> DateTime: """ @@ -218,7 +217,7 @@ def updated_at( return github.utility.iso_to_datetime(self._data["updatedAt"]) async def fetch_created_at( - self: Self, + self, /, ) -> DateTime: """ @@ -248,7 +247,7 @@ async def fetch_created_at( return github.utility.iso_to_datetime(created_at) async def fetch_description( - self: Self, + self, /, ) -> str | None: """ @@ -262,7 +261,7 @@ async def fetch_description( return await self._fetch_field("description") # type: ignore async def fetch_due_at( - self: Self, + self, /, ) -> DateTime | None: """ @@ -293,7 +292,7 @@ async def fetch_due_at( return github.utility.iso_to_datetime(due_at) async def fetch_number( - self: Self, + self, /, ) -> int: """ @@ -315,7 +314,7 @@ async def fetch_number( return await self._fetch_field("number") # type: ignore async def fetch_progress( - self: Self, + self, /, ) -> float: """ @@ -338,7 +337,7 @@ async def fetch_progress( return await self._fetch_field("progressPercentage") # type: ignore async def fetch_state( - self: Self, + self, /, ) -> MilestoneState: """ @@ -360,7 +359,7 @@ async def fetch_state( return github.MilestoneState(await self._fetch_field("state")) async def fetch_title( - self: Self, + self, /, ) -> str: """ @@ -382,7 +381,7 @@ async def fetch_title( return await self._fetch_field("title") # type: ignore async def fetch_updated_at( - self: Self, + self, /, ) -> DateTime: """ @@ -410,7 +409,7 @@ async def fetch_updated_at( return github.utility.iso_to_datetime(updated_at) def fetch_issues( - self: Self, + self, /, *, cursor: str | None = MISSING, @@ -459,7 +458,7 @@ def fetch_issues( ) def fetch_pulls( - self: Self, + self, /, *, cursor: str | None = MISSING, diff --git a/github/repository/milestonestate.py b/github/repository/milestonestate.py index be51d0fe..98673734 100644 --- a/github/repository/milestonestate.py +++ b/github/repository/milestonestate.py @@ -25,5 +25,5 @@ class MilestoneState(enum.Enum): __all__ = [ - "MilestoneState" + "MilestoneState", ] diff --git a/github/repository/pull.py b/github/repository/pull.py index 5a4077fe..e99192ec 100644 --- a/github/repository/pull.py +++ b/github/repository/pull.py @@ -3,7 +3,6 @@ if TYPE_CHECKING: from typing import cast - from typing_extensions import Self from github.connection import Connection from github.core.http import HTTPClient @@ -173,12 +172,12 @@ def _patch_data( @classmethod def _from_data( - cls: type[Self], + cls, data: PullData, /, *, http: HTTPClient, - ) -> Self: + ): return cls(cls._patch_data(data), http) _graphql_fields = { @@ -227,7 +226,7 @@ def _from_data( @property def addition_count( - self: Self, + self, /, ) -> int: """ @@ -240,7 +239,7 @@ def addition_count( @property def comment_count( - self: Self, + self, /, ) -> int: """ @@ -253,7 +252,7 @@ def comment_count( @property def database_id( - self: Self, + self, /, ) -> int: """ @@ -266,7 +265,7 @@ def database_id( @property def deletion_count( - self: Self, + self, /, ) -> int: """ @@ -279,7 +278,7 @@ def deletion_count( @property def file_count( - self: Self, + self, /, ) -> int: """ @@ -292,7 +291,7 @@ def file_count( @property def is_draft( - self: Self, + self, /, ) -> bool: """ @@ -305,7 +304,7 @@ def is_draft( @property def is_merged( - self: Self, + self, /, ) -> bool: """ @@ -318,7 +317,7 @@ def is_merged( @property def is_read( - self: Self, + self, /, ) -> bool: """ @@ -332,7 +331,7 @@ def is_read( @property def merged_at( - self: Self, + self, /, ) -> DateTime | None: """ @@ -350,7 +349,7 @@ def merged_at( @property def number( - self: Self, + self, /, ) -> int: """ @@ -363,7 +362,7 @@ def number( @property def state( - self: Self, + self, /, ) -> PullState: """ @@ -376,7 +375,7 @@ def state( @property def title( - self: Self, + self, /, ) -> str: """ @@ -389,7 +388,7 @@ def title( @property def title_html( - self: Self, + self, /, ) -> str: """ @@ -401,7 +400,7 @@ def title_html( return self._data["titleHTML"] async def fetch_addition_count( - self: Self, + self, /, ) -> int: """ @@ -423,7 +422,7 @@ async def fetch_addition_count( return await self._fetch_field("additions") # type: ignore async def fetch_comment_count( - self: Self, + self, /, ) -> int: """ @@ -445,7 +444,7 @@ async def fetch_comment_count( return await self._fetch_field("totalCommentsCount") # type: ignore async def fetch_database_id( - self: Self, + self, /, ) -> int: """ @@ -467,7 +466,7 @@ async def fetch_database_id( return int(await self._fetch_field("fullDatabaseId")) # type: ignore async def fetch_deletion_count( - self: Self, + self, /, ) -> int: """ @@ -489,7 +488,7 @@ async def fetch_deletion_count( return await self._fetch_field("deletions") # type: ignore async def fetch_file_count( - self: Self, + self, /, ) -> int: """ @@ -511,7 +510,7 @@ async def fetch_file_count( return await self._fetch_field("changedFiles") # type: ignore async def fetch_is_draft( - self: Self, + self, /, ) -> bool: """ @@ -533,7 +532,7 @@ async def fetch_is_draft( return await self._fetch_field("isDraft") # type: ignore async def fetch_is_merged( - self: Self, + self, /, ) -> bool: """ @@ -555,7 +554,7 @@ async def fetch_is_merged( return await self._fetch_field("merged") # type: ignore async def fetch_is_read( - self: Self, + self, /, ) -> bool: """ @@ -578,7 +577,7 @@ async def fetch_is_read( return await self._fetch_field("isReadByViewer") # type: ignore async def fetch_merged_at( - self: Self, + self, /, ) -> DateTime | None: """ @@ -609,7 +608,7 @@ async def fetch_merged_at( return github.utility.iso_to_datetime(merged_at) async def fetch_number( - self: Self, + self, /, ) -> int: """ @@ -631,7 +630,7 @@ async def fetch_number( return await self._fetch_field("number") # type: ignore async def fetch_state( - self: Self, + self, /, ) -> PullState: """ @@ -653,7 +652,7 @@ async def fetch_state( return github.PullState(await self._fetch_field("state")) async def fetch_title( - self: Self, + self, /, ) -> str: """ @@ -675,7 +674,7 @@ async def fetch_title( return await self._fetch_field("title") # type: ignore async def fetch_title_html( - self: Self, + self, /, ) -> str: """ @@ -697,7 +696,7 @@ async def fetch_title_html( return await self._fetch_field("titleHTML") # type: ignore async def fetch_milestone( - self: Self, + self, /, **kwargs, # TODO ) -> Milestone | None: @@ -726,7 +725,7 @@ async def fetch_milestone( return github.Milestone._from_data(data, http=self._http) def fetch_participants( - self: Self, + self, /, *, cursor: str | None = MISSING, diff --git a/github/repository/pullstate.py b/github/repository/pullstate.py index c9a9508b..a3f383f0 100644 --- a/github/repository/pullstate.py +++ b/github/repository/pullstate.py @@ -28,5 +28,5 @@ class PullState(enum.Enum): __all__ = [ - "PullState" + "PullState", ] diff --git a/github/repository/repository.py b/github/repository/repository.py index 60ef44c1..51a72f1c 100644 --- a/github/repository/repository.py +++ b/github/repository/repository.py @@ -3,7 +3,6 @@ if TYPE_CHECKING: from typing import Literal, cast - from typing_extensions import Self from github.connection import Connection, DiscussionOrder, IssueOrder, LabelOrder, MilestoneOrder, PullOrder, RepositoryOrder from github.content import CodeOfConduct, License @@ -211,12 +210,12 @@ def _patch_data( @classmethod def _from_data( - cls: type[Self], + cls, data: RepositoryData, /, *, http: HTTPClient, - ) -> Self: + ): return cls(cls._patch_data(data), http) _repr_fields = [ @@ -284,7 +283,7 @@ def _from_data( @property def allows_fork( - self: Self, + self, /, ) -> bool: """ @@ -297,7 +296,7 @@ def allows_fork( @property def allows_merge( - self: Self, + self, /, ) -> bool: """ @@ -311,7 +310,7 @@ def allows_merge( @property def allows_rebase( - self: Self, + self, /, ) -> bool: """ @@ -324,7 +323,7 @@ def allows_rebase( @property def allows_squash( - self: Self, + self, /, ) -> bool: """ @@ -337,7 +336,7 @@ def allows_squash( @property def archived_at( - self: Self, + self, /, ) -> DateTime | None: """ @@ -355,7 +354,7 @@ def archived_at( @property def created_at( - self: Self, + self, /, ) -> DateTime: """ @@ -368,7 +367,7 @@ def created_at( @property def database_id( - self: Self, + self, /, ) -> int: """ @@ -381,7 +380,7 @@ def database_id( @property def description( - self: Self, + self, /, ) -> str | None: """ @@ -394,7 +393,7 @@ def description( @property def description_html( - self: Self, + self, /, ) -> str | None: """ @@ -407,7 +406,7 @@ def description_html( @property def disk_usage( # TODO: KB or KiB # TODO: rounding - self: Self, + self, /, ) -> int: """ @@ -420,7 +419,7 @@ def disk_usage( # TODO: KB or KiB # TODO: rounding @property def fork_count( - self: Self, + self, /, ) -> int: """ @@ -433,7 +432,7 @@ def fork_count( @property def has_discussions_enabled( - self: Self, + self, /, ) -> bool: """ @@ -447,7 +446,7 @@ def has_discussions_enabled( @property def has_issues_enabled( - self: Self, + self, /, ) -> bool: """ @@ -461,7 +460,7 @@ def has_issues_enabled( @property def has_projects_enabled( - self: Self, + self, /, ) -> bool: """ @@ -475,7 +474,7 @@ def has_projects_enabled( @property def has_sponsors_enabled( - self: Self, + self, /, ) -> bool: """ @@ -489,7 +488,7 @@ def has_sponsors_enabled( @property def has_wiki_enabled( - self: Self, + self, /, ) -> bool: """ @@ -502,7 +501,7 @@ def has_wiki_enabled( @property def is_archived( - self: Self, + self, /, ) -> bool: """ @@ -515,7 +514,7 @@ def is_archived( @property def is_disabled( - self: Self, + self, /, ) -> bool: """ @@ -528,7 +527,7 @@ def is_disabled( @property def is_empty( - self: Self, + self, /, ) -> bool: """ @@ -541,7 +540,7 @@ def is_empty( @property def is_fork( - self: Self, + self, /, ) -> bool: """ @@ -554,7 +553,7 @@ def is_fork( @property def is_locked( - self: Self, + self, /, ) -> bool: """ @@ -567,7 +566,7 @@ def is_locked( @property def is_mirror( - self: Self, + self, /, ) -> bool: """ @@ -580,7 +579,7 @@ def is_mirror( @property def is_private( - self: Self, + self, /, ) -> bool: """ @@ -593,7 +592,7 @@ def is_private( @property def is_template( - self: Self, + self, /, ) -> bool: """ @@ -606,7 +605,7 @@ def is_template( @property def name( - self: Self, + self, /, ) -> str: """ @@ -619,7 +618,7 @@ def name( @property def pushed_at( - self: Self, + self, /, ) -> DateTime | None: """ @@ -638,7 +637,7 @@ def pushed_at( @property def updated_at( - self: Self, + self, /, ) -> DateTime: """ @@ -650,7 +649,7 @@ def updated_at( return github.utility.iso_to_datetime(self._data["updatedAt"]) async def fetch_allows_fork( - self: Self, + self, /, ) -> bool: """ @@ -673,7 +672,7 @@ async def fetch_allows_fork( return await self._fetch_field("forkingAllowed") # type: ignore async def fetch_allows_merge( - self: Self, + self, /, ) -> bool: """ @@ -696,7 +695,7 @@ async def fetch_allows_merge( return await self._fetch_field("mergeCommitAllowed") # type: ignore async def fetch_allows_rebase( - self: Self, + self, /, ) -> bool: """ @@ -718,7 +717,7 @@ async def fetch_allows_rebase( return await self._fetch_field("rebaseMergeAllowed") # type: ignore async def fetch_allows_squash( - self: Self, + self, /, ) -> bool: """ @@ -740,7 +739,7 @@ async def fetch_allows_squash( return await self._fetch_field("squashMergeAllowed") # type: ignore async def fetch_archived_at( - self: Self, + self, /, ) -> DateTime | None: """ @@ -771,7 +770,7 @@ async def fetch_archived_at( return github.utility.iso_to_datetime(archived_at) async def fetch_created_at( - self: Self, + self, /, ) -> DateTime | None: """ @@ -798,7 +797,7 @@ async def fetch_created_at( return github.utility.iso_to_datetime(created_at) async def fetch_database_id( - self: Self, + self, /, ) -> int: """ @@ -820,7 +819,7 @@ async def fetch_database_id( return await self._fetch_field("databaseId") # type: ignore async def fetch_description( - self: Self, + self, /, ) -> str | None: """ @@ -842,7 +841,7 @@ async def fetch_description( return await self._fetch_field("description") # type: ignore async def fetch_description_html( - self: Self, + self, /, ) -> str | None: """ @@ -864,7 +863,7 @@ async def fetch_description_html( return await self._fetch_field("descriptionHTML") # type: ignore async def fetch_disk_usage( - self: Self, + self, /, ) -> int: """ @@ -887,7 +886,7 @@ async def fetch_disk_usage( return await self._fetch_field("diskUsage") # type: ignore async def fetch_fork_count( - self: Self, + self, /, ) -> int: """ @@ -909,7 +908,7 @@ async def fetch_fork_count( return await self._fetch_field("forkCount") # type: ignore async def fetch_has_discussions_enabled( - self: Self, + self, /, ) -> bool: """ @@ -932,7 +931,7 @@ async def fetch_has_discussions_enabled( return await self._fetch_field("hasDiscussionsEnabled") # type: ignore async def fetch_has_issues_enabled( - self: Self, + self, /, ) -> bool: """ @@ -955,7 +954,7 @@ async def fetch_has_issues_enabled( return await self._fetch_field("hasIssuesEnabled") # type: ignore async def fetch_has_projects_enabled( - self: Self, + self, /, ) -> bool: """ @@ -978,7 +977,7 @@ async def fetch_has_projects_enabled( return await self._fetch_field("hasProjectsEnabled") # type: ignore async def fetch_has_sponsors_enabled( - self: Self, + self, /, ) -> bool: """ @@ -1001,7 +1000,7 @@ async def fetch_has_sponsors_enabled( return await self._fetch_field("hasSponsorshipsEnabled") # type: ignore async def fetch_has_wiki_enabled( - self: Self, + self, /, ) -> bool: """ @@ -1023,7 +1022,7 @@ async def fetch_has_wiki_enabled( return await self._fetch_field("hasWikiEnabled") # type: ignore async def fetch_is_archived( - self: Self, + self, /, ) -> bool: """ @@ -1045,7 +1044,7 @@ async def fetch_is_archived( return await self._fetch_field("isArchived") # type: ignore async def fetch_is_disabled( - self: Self, + self, /, ) -> bool: """ @@ -1067,7 +1066,7 @@ async def fetch_is_disabled( return await self._fetch_field("isDisabled") # type: ignore async def fetch_is_empty( - self: Self, + self, /, ) -> bool: """ @@ -1089,7 +1088,7 @@ async def fetch_is_empty( return await self._fetch_field("isEmpty") # type: ignore async def fetch_is_fork( - self: Self, + self, /, ) -> bool: """ @@ -1111,7 +1110,7 @@ async def fetch_is_fork( return await self._fetch_field("isFork") # type: ignore async def fetch_is_locked( - self: Self, + self, /, ) -> bool: """ @@ -1133,7 +1132,7 @@ async def fetch_is_locked( return await self._fetch_field("isLocked") # type: ignore async def fetch_is_mirror( - self: Self, + self, /, ) -> bool: """ @@ -1155,7 +1154,7 @@ async def fetch_is_mirror( return await self._fetch_field("isMirror") # type: ignore async def fetch_is_private( - self: Self, + self, /, ) -> bool: """ @@ -1177,7 +1176,7 @@ async def fetch_is_private( return await self._fetch_field("isPrivate") # type: ignore async def fetch_is_template( - self: Self, + self, /, ) -> bool: """ @@ -1199,7 +1198,7 @@ async def fetch_is_template( return await self._fetch_field("isTemplate") # type: ignore async def fetch_name( - self: Self, + self, /, ) -> str: """ @@ -1221,7 +1220,7 @@ async def fetch_name( return await self._fetch_field("name") # type: ignore async def fetch_pushed_at( - self: Self, + self, /, ) -> DateTime | None: """ @@ -1252,7 +1251,7 @@ async def fetch_pushed_at( return github.utility.iso_to_datetime(pushed_at) async def fetch_updated_at( - self: Self, + self, /, ) -> DateTime | None: """ @@ -1280,7 +1279,7 @@ async def fetch_updated_at( return github.utility.iso_to_datetime(updated_at) async def fetch_code_of_conduct( - self: Self, + self, /, **kwargs, # TODO ) -> CodeOfConduct | None: @@ -1308,7 +1307,7 @@ async def fetch_code_of_conduct( return github.CodeOfConduct._from_data(data, http=self._http) async def fetch_discussion( - self: Self, + self, number: int, /, **kwargs, # TODO @@ -1339,7 +1338,7 @@ async def fetch_discussion( return github.Discussion._from_data(data, http=self._http) async def fetch_issue( - self: Self, + self, number: int, /, **kwargs, # TODO @@ -1370,7 +1369,7 @@ async def fetch_issue( return github.Issue._from_data(data, http=self._http) async def fetch_issue_or_pull( - self: Self, + self, number: int, /, **kwargs, # TODO @@ -1409,7 +1408,7 @@ async def fetch_issue_or_pull( raise RuntimeError(f"invalid type {data['__typename']} for Repository.issueOrPullRequest") async def fetch_label( - self: Self, + self, name: str, /, **kwargs, # TODO @@ -1434,7 +1433,7 @@ async def fetch_label( return github.Label._from_data(data, http=self._http) async def fetch_license( - self: Self, + self, /, **kwargs, # TODO ) -> License | None: @@ -1462,7 +1461,7 @@ async def fetch_license( return github.License._from_data(data, http=self._http) async def fetch_milestone( - self: Self, + self, number: int, /, **kwargs, # TODO @@ -1493,7 +1492,7 @@ async def fetch_milestone( return github.Milestone._from_data(data, http=self._http) async def fetch_owner( - self: Self, + self, /, **kwargs, # TODO ) -> Organization | User: @@ -1525,7 +1524,7 @@ async def fetch_owner( raise RuntimeError(f"invalid type {data['__typename']} for Repository.owner") async def fetch_parent( - self: Self, + self, /, **kwargs, # TODO ) -> Repository | None: @@ -1553,7 +1552,7 @@ async def fetch_parent( return github.Repository._from_data(data, http=self._http) async def fetch_pull( - self: Self, + self, number: int, /, **kwargs, # TODO @@ -1584,7 +1583,7 @@ async def fetch_pull( return github.Pull._from_data(data, http=self._http) async def fetch_template( - self: Self, + self, /, **kwargs, # TODO ) -> Repository | None: @@ -1612,7 +1611,7 @@ async def fetch_template( return github.Repository._from_data(data, http=self._http) def fetch_assignable_users( - self: Self, + self, /, *, cursor: str | None = MISSING, @@ -1660,7 +1659,7 @@ def userdata_to_user(userdata: UserData, /) -> User: ) def fetch_collaborators( - self: Self, + self, /, *, cursor: str | None = MISSING, @@ -1714,7 +1713,7 @@ def userdata_to_user(userdata: UserData, /) -> User: ) def fetch_discussions( - self: Self, + self, /, *, cursor: str | None = MISSING, @@ -1766,7 +1765,7 @@ def discussiondata_to_discussion(discussiondata: DiscussionData, /) -> Discussio ) def fetch_forks( - self: Self, + self, /, *, cursor: str | None = MISSING, @@ -1818,7 +1817,7 @@ def repositorydata_to_repository(repositorydata: RepositoryData, /) -> Repositor ) def fetch_issues( - self: Self, + self, /, *, cursor: str | None = MISSING, @@ -1870,7 +1869,7 @@ def issuedata_to_issue(issuedata: IssueData, /) -> Issue: ) def fetch_labels( - self: Self, + self, /, *, cursor: str | None = MISSING, @@ -1922,7 +1921,7 @@ def labeldata_to_label(labeldata: LabelData, /) -> Label: ) def fetch_mentionable_users( - self: Self, + self, /, *, cursor: str | None = MISSING, @@ -1970,7 +1969,7 @@ def userdata_to_user(userdata: UserData, /) -> User: ) def fetch_milestones( - self: Self, + self, /, *, cursor: str | None = MISSING, @@ -2019,7 +2018,7 @@ def fetch_milestones( ) def fetch_pulls( - self: Self, + self, /, *, cursor: str | None = MISSING, @@ -2071,7 +2070,7 @@ def pulldata_to_pull(pulldata: PullData, /) -> Pull: ) def fetch_topics( - self: Self, + self, /, *, cursor: str | None = MISSING, @@ -2119,7 +2118,7 @@ def topicdata_to_topic(userdata: TopicData, /) -> Topic: ) def fetch_watchers( - self: Self, + self, /, *, cursor: str | None = MISSING, @@ -2167,7 +2166,7 @@ def userdata_to_user(userdata: UserData, /) -> User: ) async def archive( - self: Self, + self, /, ) -> None: """ @@ -2188,7 +2187,7 @@ async def archive( self._data["isArchived"] = data["isArchived"] async def unarchive( - self: Self, + self, /, ) -> None: """ @@ -2209,6 +2208,6 @@ async def unarchive( self._data["isArchived"] = data["isArchived"] -__all__: list[str] = [ +__all__ = [ "Repository", ] diff --git a/github/repository/subscriptionstate.py b/github/repository/subscriptionstate.py index f8cca46d..445865d0 100644 --- a/github/repository/subscriptionstate.py +++ b/github/repository/subscriptionstate.py @@ -29,5 +29,5 @@ class SubscriptionState(enum.Enum): __all__ = [ - "SubscriptionState" + "SubscriptionState", ] diff --git a/github/repository/topic.py b/github/repository/topic.py index 467c91c1..fcf9a87f 100644 --- a/github/repository/topic.py +++ b/github/repository/topic.py @@ -3,7 +3,6 @@ if TYPE_CHECKING: from typing import cast - from typing_extensions import Self from github.connection import Connection, RepositoryOrder from github.core.http import HTTPClient @@ -63,12 +62,12 @@ def _patch_data( @classmethod def _from_data( - cls: type[Self], + cls, data: TopicData, /, *, http: HTTPClient, - ) -> Self: + ): return cls(cls._patch_data(data), http) _repr_fields = [ @@ -84,7 +83,7 @@ def _from_data( @property def name( - self: Self, + self, /, ) -> str: """ @@ -97,7 +96,7 @@ def name( @property def repository_count( - self: Self, + self, /, ) -> int: """ @@ -109,7 +108,7 @@ def repository_count( return self._data["repositories"]["totalCount"] async def fetch_name( - self: Self, + self, /, ) -> str: """ @@ -131,7 +130,7 @@ async def fetch_name( return await self._fetch_field("name") # type: ignore async def fetch_repository_count( - self: Self, + self, /, ) -> int: """ @@ -158,7 +157,7 @@ async def fetch_repository_count( return connection["totalCount"] async def fetch_related_topics( - self: Self, + self, /, *, limit: int = MISSING, @@ -191,7 +190,7 @@ async def fetch_related_topics( return [Topic._from_data(d, http=self._http) for d in data] def fetch_repositories( - self: Self, + self, /, *, cursor: str | None = MISSING, @@ -244,6 +243,6 @@ def repositorydata_to_repository(repositorydata: RepositoryData, /) -> Repositor ) -__all__: list[str] = [ +__all__ = [ "Topic", ] diff --git a/github/security/__init__.py b/github/security/__init__.py index 511d4fa5..d60611a3 100644 --- a/github/security/__init__.py +++ b/github/security/__init__.py @@ -8,7 +8,7 @@ from github.security.vulnerability import __all__ as _vulnerability__all__ -__all__: list[str] = [ # type: ignore[reportUnsupportedDunderAll] +__all__ = [ # type: ignore[reportUnsupportedDunderAll] *_advisory__all__, *_advisoryclassification__all__, *_advisoryseverity__all__, diff --git a/github/security/advisory.py b/github/security/advisory.py index 0cbb1e5b..8aee7d38 100644 --- a/github/security/advisory.py +++ b/github/security/advisory.py @@ -3,7 +3,6 @@ if TYPE_CHECKING: from typing import cast - from typing_extensions import Self from github.connection import Connection, VulnerabilityOrder from github.core.http import HTTPClient @@ -79,12 +78,12 @@ def _patch_data( @classmethod def _from_data( - cls: type[Self], + cls, data: AdvisoryData, /, *, http: HTTPClient, - ) -> Self: + ): return cls(cls._patch_data(data), http) _graphql_fields = { @@ -107,7 +106,7 @@ def _from_data( @property def classification( - self: Self, + self, /, ) -> AdvisoryClassification: """ @@ -120,7 +119,7 @@ def classification( @property def database_id( - self: Self, + self, /, ) -> int: """ @@ -133,7 +132,7 @@ def database_id( @property def description( - self: Self, + self, /, ) -> str: """ @@ -146,7 +145,7 @@ def description( @property def published_at( - self: Self, + self, /, ) -> DateTime: """ @@ -159,7 +158,7 @@ def published_at( @property def severity( - self: Self, + self, /, ) -> AdvisorySeverity: """ @@ -172,7 +171,7 @@ def severity( @property def title( - self: Self, + self, /, ) -> str: """ @@ -185,7 +184,7 @@ def title( @property def updated_at( - self: Self, + self, /, ) -> DateTime: """ @@ -198,7 +197,7 @@ def updated_at( @property def withdrawn_at( - self: Self, + self, /, ) -> DateTime | None: """ @@ -215,7 +214,7 @@ def withdrawn_at( return github.utility.iso_to_datetime(withdrawn_at) async def fetch_classification( - self: Self, + self, /, ) -> AdvisoryClassification: """ @@ -237,7 +236,7 @@ async def fetch_classification( return github.AdvisoryClassification(await self._fetch_field("classification")) async def fetch_database_id( - self: Self, + self, /, ) -> int: """ @@ -259,7 +258,7 @@ async def fetch_database_id( return await self._fetch_field("databaseId") # type: ignore async def fetch_description( - self: Self, + self, /, ) -> str: """ @@ -281,7 +280,7 @@ async def fetch_description( return await self._fetch_field("description") # type: ignore async def fetch_published_at( - self: Self, + self, /, ) -> DateTime: """ @@ -308,7 +307,7 @@ async def fetch_published_at( return github.utility.iso_to_datetime(published_at) async def fetch_severity( - self: Self, + self, /, ) -> AdvisorySeverity: """ @@ -330,7 +329,7 @@ async def fetch_severity( return github.AdvisorySeverity(await self._fetch_field("severity")) async def fetch_title( - self: Self, + self, /, ) -> str: """ @@ -352,7 +351,7 @@ async def fetch_title( return await self._fetch_field("summary") # type: ignore async def fetch_updated_at( - self: Self, + self, /, ) -> DateTime: """ @@ -380,7 +379,7 @@ async def fetch_updated_at( return github.utility.iso_to_datetime(updated_at) async def fetch_withdrawn_at( - self: Self, + self, /, ) -> DateTime | None: """ @@ -411,7 +410,7 @@ async def fetch_withdrawn_at( return github.utility.iso_to_datetime(withdrawn_at) def fetch_vulnerabilities( - self: Self, + self, /, *, cursor: str | None = MISSING, diff --git a/github/security/advisoryclassification.py b/github/security/advisoryclassification.py index 168669c9..21a36cc0 100644 --- a/github/security/advisoryclassification.py +++ b/github/security/advisoryclassification.py @@ -25,5 +25,5 @@ class AdvisoryClassification(enum.Enum): __all__ = [ - "AdvisoryClassification" + "AdvisoryClassification", ] diff --git a/github/security/advisoryseverity.py b/github/security/advisoryseverity.py index 726902d9..0353045e 100644 --- a/github/security/advisoryseverity.py +++ b/github/security/advisoryseverity.py @@ -31,5 +31,5 @@ class AdvisorySeverity(enum.Enum): __all__ = [ - "AdvisorySeverity" + "AdvisorySeverity", ] diff --git a/github/security/vulnerability.py b/github/security/vulnerability.py index b38db975..a477736d 100644 --- a/github/security/vulnerability.py +++ b/github/security/vulnerability.py @@ -2,8 +2,6 @@ from typing import TYPE_CHECKING if TYPE_CHECKING: - from typing_extensions import Self - from github.utility.types import DateTime import github @@ -48,10 +46,10 @@ def _patch_data( @classmethod def _from_data( - cls: type[Self], + cls, data: VulnerabilityData, /, - ) -> Self: + ): return cls(cls._patch_data(data)) _graphql_fields = { @@ -65,7 +63,7 @@ def _from_data( @property def updated_at( - self: Self, + self, /, ) -> DateTime: """ diff --git a/github/user/__init__.py b/github/user/__init__.py index c12fa9a4..71d1ca12 100644 --- a/github/user/__init__.py +++ b/github/user/__init__.py @@ -4,7 +4,7 @@ from github.user.userstatus import __all__ as _userstatus__all__ -__all__: list[str] = [ # type: ignore[reportUnsupportedDunderAll] +__all__ = [ # type: ignore[reportUnsupportedDunderAll] *_user__all__, *_userstatus__all__, ] diff --git a/github/user/user.py b/github/user/user.py index 894752af..9d5e6d30 100644 --- a/github/user/user.py +++ b/github/user/user.py @@ -3,7 +3,6 @@ if TYPE_CHECKING: from typing import cast - from typing_extensions import Self from github.connection import Connection, IssueOrder, OrganizationOrder, PullOrder, RepositoryOrder from github.core.http import HTTPClient @@ -160,12 +159,12 @@ def _patch_data( @classmethod def _from_data( - cls: type[Self], + cls, data: UserData, /, *, http: HTTPClient, - ) -> User: + ): data = cls._patch_data(data) if not data.get("isViewer", None): @@ -203,7 +202,7 @@ def _from_data( @property def bio( - self: Self, + self, /, ) -> str | None: """ @@ -216,7 +215,7 @@ def bio( @property def bio_html( - self: Self, + self, /, ) -> str | None: """ @@ -235,7 +234,7 @@ def bio_html( @property def can_viewer_follow( - self: Self, + self, /, ) -> bool: """ @@ -248,7 +247,7 @@ def can_viewer_follow( @property def company( - self: Self, + self, /, ) -> str | None: """ @@ -261,7 +260,7 @@ def company( @property def company_html( - self: Self, + self, /, ) -> str | None: """ @@ -281,7 +280,7 @@ def company_html( @property def created_at( - self: Self, + self, /, ) -> DateTime: """ @@ -294,7 +293,7 @@ def created_at( @property def database_id( - self: Self, + self, /, ) -> int: """ @@ -307,7 +306,7 @@ def database_id( @property def follower_count( - self: Self, + self, /, ) -> int: """ @@ -320,7 +319,7 @@ def follower_count( @property def following_count( - self: Self, + self, /, ) -> int: """ @@ -333,7 +332,7 @@ def following_count( @property def is_administrator( - self: Self, + self, /, ) -> bool: """ @@ -351,7 +350,7 @@ def is_administrator( @property def is_bounty_program_member( - self: Self, + self, /, ) -> bool: """ @@ -364,7 +363,7 @@ def is_bounty_program_member( @property def is_campus_program_member( - self: Self, + self, /, ) -> bool: """ @@ -377,7 +376,7 @@ def is_campus_program_member( @property def is_developer_program_member( - self: Self, + self, /, ) -> bool: """ @@ -390,7 +389,7 @@ def is_developer_program_member( @property def is_employee( - self: Self, + self, /, ) -> bool: """ @@ -403,7 +402,7 @@ def is_employee( @property def is_following_viewer( - self: Self, + self, /, ) -> bool: """ @@ -416,7 +415,7 @@ def is_following_viewer( @property def is_hireable( - self: Self, + self, /, ) -> bool: """ @@ -429,7 +428,7 @@ def is_hireable( @property def is_stars_program_member( - self: Self, + self, /, ) -> bool: """ @@ -442,7 +441,7 @@ def is_stars_program_member( @property def is_viewer( - self: Self, + self, /, ) -> bool: """ @@ -459,7 +458,7 @@ def is_viewer( @property def is_viewer_following( - self: Self, + self, /, ) -> bool: """ @@ -472,7 +471,7 @@ def is_viewer_following( @property def pronouns( - self: Self, + self, /, ) -> str | None: """ @@ -485,7 +484,7 @@ def pronouns( @property def twitter_username( - self: Self, + self, /, ) -> str | None: """ @@ -504,7 +503,7 @@ def twitter_username( @property def updated_at( - self: Self, + self, /, ) -> DateTime: """ @@ -516,7 +515,7 @@ def updated_at( return github.utility.iso_to_datetime(self._data["updatedAt"]) async def fetch_bio( - self: Self, + self, /, ) -> str | None: """ @@ -538,7 +537,7 @@ async def fetch_bio( return await self._fetch_field("bio") # type: ignore async def fetch_bio_html( - self: Self, + self, /, ) -> str | None: """ @@ -566,7 +565,7 @@ async def fetch_bio_html( return await self._fetch_field("bioHTML") # type: ignore async def fetch_can_viewer_follow( - self: Self, + self, /, ) -> bool: """ @@ -588,7 +587,7 @@ async def fetch_can_viewer_follow( return await self._fetch_field("viewerCanFollow") # type: ignore async def fetch_company( - self: Self, + self, /, ) -> str | None: """ @@ -610,7 +609,7 @@ async def fetch_company( return await self._fetch_field("company") # type: ignore async def fetch_company_html( - self: Self, + self, /, ) -> str | None: """ @@ -639,7 +638,7 @@ async def fetch_company_html( return await self._fetch_field("companyHTML") # type: ignore async def fetch_created_at( - self: Self, + self, /, ) -> DateTime: """ @@ -666,7 +665,7 @@ async def fetch_created_at( return github.utility.iso_to_datetime(value) async def fetch_database_id( - self: Self, + self, /, ) -> int: """ @@ -688,7 +687,7 @@ async def fetch_database_id( return await self._fetch_field("databaseId") # type: ignore async def fetch_follower_count( - self: Self, + self, /, ) -> int: """ @@ -710,7 +709,7 @@ async def fetch_follower_count( return (await self._fetch_field("follower_count"))["totalCount"] # type: ignore async def fetch_following_count( - self: Self, + self, /, ) -> int: """ @@ -732,7 +731,7 @@ async def fetch_following_count( return (await self._fetch_field("following_count"))["totalCount"] # type: ignore async def fetch_is_administrator( - self: Self, + self, /, ) -> bool: """ @@ -760,7 +759,7 @@ async def fetch_is_administrator( return await self._fetch_field("isSiteAdmin") # type: ignore async def fetch_is_bounty_program_member( - self: Self, + self, /, ) -> bool: """ @@ -783,7 +782,7 @@ async def fetch_is_bounty_program_member( return await self._fetch_field("isBountyHunter") # type: ignore async def fetch_is_campus_program_member( - self: Self, + self, /, ) -> bool: """ @@ -806,7 +805,7 @@ async def fetch_is_campus_program_member( return await self._fetch_field("isCampusExpert") # type: ignore async def fetch_is_developer_program_member( - self: Self, + self, /, ) -> bool: """ @@ -829,7 +828,7 @@ async def fetch_is_developer_program_member( return await self._fetch_field("isDeveloperProgramMember") # type: ignore async def fetch_is_employee( - self: Self, + self, /, ) -> bool: """ @@ -851,7 +850,7 @@ async def fetch_is_employee( return await self._fetch_field("isEmployee") # type: ignore async def fetch_is_following_viewer( - self: Self, + self, /, ) -> bool: """ @@ -873,7 +872,7 @@ async def fetch_is_following_viewer( return await self._fetch_field("isFollowingViewer") # type: ignore async def fetch_is_stars_program_member( - self: Self, + self, /, ) -> bool: """ @@ -896,7 +895,7 @@ async def fetch_is_stars_program_member( return await self._fetch_field("isGitHubStar") # type: ignore async def fetch_is_hireable( - self: Self, + self, /, ) -> bool: """ @@ -918,7 +917,7 @@ async def fetch_is_hireable( return await self._fetch_field("isHireable") # type: ignore async def fetch_is_viewer( - self: Self, + self, /, ) -> bool: """ @@ -944,7 +943,7 @@ async def fetch_is_viewer( return await self._fetch_field("isViewer") # type: ignore async def fetch_is_viewer_following( - self: Self, + self, /, ) -> bool: """ @@ -966,7 +965,7 @@ async def fetch_is_viewer_following( return await self._fetch_field("viewerIsFollowing") # type: ignore async def fetch_pronouns( - self: Self, + self, /, ) -> str | None: """ @@ -988,7 +987,7 @@ async def fetch_pronouns( return await self._fetch_field("pronouns") # type: ignore async def fetch_twitter_username( - self: Self, + self, /, ) -> str | None: """ @@ -1015,7 +1014,7 @@ async def fetch_twitter_username( return await self._fetch_field("twitterUsername") # type: ignore async def fetch_updated_at( - self: Self, + self, /, ) -> DateTime: """ @@ -1042,7 +1041,7 @@ async def fetch_updated_at( return github.utility.iso_to_datetime(value) async def fetch_organization( - self: Self, + self, login: str, /, **kwargs, # TODO @@ -1073,7 +1072,7 @@ async def fetch_organization( return github.Organization._from_data(data, http=self._http) async def fetch_status( - self: Self, + self, /, **kwargs, # TODO ) -> UserStatus | None: @@ -1101,7 +1100,7 @@ async def fetch_status( return github.UserStatus._from_data(data, http=self._http) def fetch_followers( - self: Self, + self, /, *, cursor: str | None = MISSING, @@ -1147,7 +1146,7 @@ def userdata_to_user(userdata: UserData, /) -> User: ) def fetch_following( - self: Self, + self, /, *, cursor: str | None = MISSING, @@ -1193,7 +1192,7 @@ def userdata_to_user(userdata: UserData, /) -> User: ) def fetch_issues( - self: Self, + self, /, *, cursor: str | None = MISSING, @@ -1241,7 +1240,7 @@ def issuedata_to_issue(issuedata: IssueData, /) -> Issue: ) def fetch_organizations( - self: Self, + self, /, *, cursor: str | None = MISSING, @@ -1291,7 +1290,7 @@ def organizationdata_to_organization(organizationdata: OrganizationData, /) -> O ) def fetch_pulls( - self: Self, + self, /, *, cursor: str | None = MISSING, @@ -1341,7 +1340,7 @@ def pulldata_to_pull(pulldata: PullData, /) -> Pull: ) def fetch_watching( - self: Self, + self, /, *, cursor: str | None = MISSING, @@ -1417,18 +1416,18 @@ def _patch_data( @classmethod def _from_data( - cls: type[Self], + cls, data: ViewerData, /, *, http: HTTPClient, - ) -> Self: + ): data = cls._patch_data(data) return cls(data, http) async def clear_status( - self: Self, + self, /, ) -> None: """ @@ -1446,7 +1445,7 @@ async def clear_status( await self._http.mutate_user_update_status(None, None, None, None, None) async def update_status( - self: Self, + self, /, message: str | None = MISSING, *, @@ -1500,7 +1499,7 @@ async def update_status( return github.UserStatus._from_data(data, http=self._http) -__all__: list[str] = [ +__all__ = [ "User", "AuthenticatedUser", ] diff --git a/github/user/userstatus.py b/github/user/userstatus.py index 9da13e3f..baebf426 100644 --- a/github/user/userstatus.py +++ b/github/user/userstatus.py @@ -3,7 +3,6 @@ if TYPE_CHECKING: from typing import cast - from typing_extensions import Self from github.core.http import HTTPClient from github.organization import Organization @@ -67,12 +66,12 @@ def _patch_data( @classmethod def _from_data( - cls: type[Self], + cls, data: UserStatusData, /, *, http: HTTPClient, - ) -> Self: + ): return cls(cls._patch_data(data), http) _repr_fields = [ @@ -95,7 +94,7 @@ def _from_data( @property def can_viewer_update( - self: Self, + self, /, ) -> bool: """ @@ -108,7 +107,7 @@ def can_viewer_update( @property def created_at( - self: Self, + self, /, ) -> DateTime: """ @@ -121,7 +120,7 @@ def created_at( @property def emoji( - self: Self, + self, /, ) -> str | None: """ @@ -134,7 +133,7 @@ def emoji( @property def emoji_html( - self: Self, + self, /, ) -> str | None: """ @@ -147,7 +146,7 @@ def emoji_html( @property def expires_at( - self: Self, + self, /, ) -> DateTime | None: """ @@ -165,7 +164,7 @@ def expires_at( @property def is_busy( - self: Self, + self, /, ) -> bool: """ @@ -178,7 +177,7 @@ def is_busy( @property def message( - self: Self, + self, /, ) -> str | None: """ @@ -191,7 +190,7 @@ def message( @property def updated_at( - self: Self, + self, /, ) -> DateTime: """ @@ -203,7 +202,7 @@ def updated_at( return github.utility.iso_to_datetime(self._data["updatedAt"]) async def fetch_can_viewer_update( - self: Self, + self, /, ) -> bool: """ @@ -230,7 +229,7 @@ async def fetch_can_viewer_update( return user["isViewer"] async def fetch_created_at( - self: Self, + self, /, ) -> DateTime: """ @@ -257,7 +256,7 @@ async def fetch_created_at( return github.utility.iso_to_datetime(value) async def fetch_emoji( - self: Self, + self, /, ) -> str | None: """ @@ -279,7 +278,7 @@ async def fetch_emoji( return await self._fetch_field("emoji") # type: ignore async def fetch_emoji_html( - self: Self, + self, /, ) -> str | None: """ @@ -301,7 +300,7 @@ async def fetch_emoji_html( return await self._fetch_field("emojiHTML") # type: ignore async def fetch_expires_at( - self: Self, + self, /, ) -> DateTime | None: """ @@ -331,7 +330,7 @@ async def fetch_expires_at( return github.utility.iso_to_datetime(expires_at) async def fetch_is_busy( - self: Self, + self, /, ) -> bool: """ @@ -353,7 +352,7 @@ async def fetch_is_busy( return await self._fetch_field("indicatesLimitedAvailability") # type: ignore async def fetch_message( - self: Self, + self, /, ) -> str | None: """ @@ -375,7 +374,7 @@ async def fetch_message( return await self._fetch_field("message") # type: ignore async def fetch_updated_at( - self: Self, + self, /, ) -> DateTime: """ @@ -402,7 +401,7 @@ async def fetch_updated_at( return github.utility.iso_to_datetime(value) async def fetch_organization( - self: Self, + self, /, **kwargs, ) -> Organization | None: @@ -426,7 +425,7 @@ async def fetch_organization( return github.Organization._from_data(data, http=self._http) async def fetch_user( - self: Self, + self, /, **kwargs, ) -> User: @@ -450,6 +449,6 @@ async def fetch_user( return github.User._from_data(data, http=self._http) -__all__: list[str] = [ +__all__ = [ "UserStatus", ] diff --git a/github/utility/__init__.py b/github/utility/__init__.py index 8ee7e284..b397182a 100644 --- a/github/utility/__init__.py +++ b/github/utility/__init__.py @@ -8,7 +8,7 @@ from github.utility.wrapper import __all__ as _wrapper__all__ -__all__: list[str] = [ # type: ignore[reportUnsupportedDunderAll] +__all__ = [ # type: ignore[reportUnsupportedDunderAll] *__mirror__all__, *_convert__all__, *_helpers__all__, diff --git a/github/utility/convert.py b/github/utility/convert.py index d2611b8d..4689a692 100644 --- a/github/utility/convert.py +++ b/github/utility/convert.py @@ -127,7 +127,7 @@ def node_to_database( return int(id) -__all__: list[str] = [ +__all__ = [ "date_to_iso", "datetime_to_iso", "iso_to_date", diff --git a/github/utility/helpers.py b/github/utility/helpers.py index c50d6fc8..f610a963 100644 --- a/github/utility/helpers.py +++ b/github/utility/helpers.py @@ -102,7 +102,7 @@ def get_defined_repr_fields( return sorted(repr_fields) -__all__: list[str] = [ +__all__ = [ "follow", "get_graphql_type", "get_defined_graphql_fields", diff --git a/github/utility/types.py b/github/utility/types.py index 55e43994..4a369440 100644 --- a/github/utility/types.py +++ b/github/utility/types.py @@ -20,7 +20,7 @@ T_json_object: TypeAlias = Mapping[str, object] -__all__: list[str] = [ +__all__ = [ "Date", "DateTime", "T_json_key", diff --git a/github/utility/wrapper.py b/github/utility/wrapper.py index 0ad8736e..3361edb4 100644 --- a/github/utility/wrapper.py +++ b/github/utility/wrapper.py @@ -1,9 +1,6 @@ from __future__ import annotations from typing import TYPE_CHECKING, Dict, TypeVar -if TYPE_CHECKING: - from typing_extensions import Self - from github.core.errors import ClientObjectMissingFieldError @@ -19,7 +16,7 @@ class DataWrapper(Dict[_K, _V]): def __getitem__( - self: Self, + self, key: _K, /, ) -> _V: @@ -29,6 +26,6 @@ def __getitem__( raise ClientObjectMissingFieldError(key) from None -__all__: list[str] = [ +__all__ = [ "DataWrapper", ]