refactor: extract focused clients from GiteaClient (Slices 1-6)
- Create gitea/issues_client.py with IssuesClient class (9 methods) - Create gitea/prs_client.py with PullRequestsClient class (17 methods) - Create gitea/files_client.py with FilesClient class (4 methods) - Create gitea/notifications_client.py with NotificationsClient class (2 methods) - Create gitea/repos_client.py with ReposClient class (2 methods) - Create gitea/__init__.py to export all client classes - Remove delegation methods from GiteaClient (now ~70 lines) - Update all callers to use sub-clients (client.issues, client.prs, etc.) - Update test files to mock sub-client attributes GiteaClient is now a facade that provides access to focused sub-clients: - repos: Repository operations (ReposClient) - issues: Issue operations (IssuesClient) - prs: Pull request operations (PullRequestsClient) - files: File and git ref operations (FilesClient) - notifications: Notification operations (NotificationsClient) Refs: #godclass-refactor
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
"""Gitea API client package."""
|
||||
|
||||
from .client import GiteaClient
|
||||
from .files_client import FilesClient
|
||||
from .issues_client import IssuesClient
|
||||
from .notifications_client import NotificationsClient
|
||||
from .prs_client import PullRequestsClient
|
||||
from .repos_client import ReposClient
|
||||
from .models import (
|
||||
CommentModel,
|
||||
GiteaConfig,
|
||||
IssueModel,
|
||||
LabelModel,
|
||||
PullRequestFileModel,
|
||||
PullRequestModel,
|
||||
RepositoryModel,
|
||||
UserModel,
|
||||
)
|
||||
|
||||
__all__ = [
|
||||
"FilesClient",
|
||||
"GiteaClient",
|
||||
"IssuesClient",
|
||||
"NotificationsClient",
|
||||
"PullRequestsClient",
|
||||
"ReposClient",
|
||||
"CommentModel",
|
||||
"GiteaConfig",
|
||||
"IssueModel",
|
||||
"LabelModel",
|
||||
"PullRequestFileModel",
|
||||
"PullRequestModel",
|
||||
"RepositoryModel",
|
||||
"UserModel",
|
||||
]
|
||||
Reference in New Issue
Block a user