Skip to content

Commit

Permalink
Do some cleanup and typing in RBTools config/options code.
Browse files Browse the repository at this point in the history
This change does some cleanup, typing, and general modernization in
preparation for allowing config namespacing.

Testing Done:
Ran unit tests.

Reviewed at https://reviews.reviewboard.org/r/14218/
  • Loading branch information
davidt committed Nov 6, 2024
1 parent cfb4adc commit 22792e6
Show file tree
Hide file tree
Showing 8 changed files with 211 additions and 138 deletions.
5 changes: 2 additions & 3 deletions rbtools/clients/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
import logging
import os
import sys
from typing import Optional, TYPE_CHECKING, Tuple
from typing import Optional, TYPE_CHECKING

from housekeeping import ClassMovedMixin

Expand Down Expand Up @@ -113,7 +113,7 @@ def scan_usable_client(
config: RBToolsConfig,
options: argparse.Namespace,
client_name: Optional[str] = None,
) -> Tuple[RepositoryInfo, BaseSCMClient]:
) -> tuple[RepositoryInfo, BaseSCMClient]:
"""Scan for a usable SCMClient.
Args:
Expand Down Expand Up @@ -256,7 +256,6 @@ def scan_usable_client(
'PatchResult',
'RepositoryInfo',
'SCMCLIENTS',
'SCMClient',
'load_scmclients',
'scan_usable_client',
'scmclient_registry',
Expand Down
7 changes: 4 additions & 3 deletions rbtools/clients/base/repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@

from __future__ import annotations

from typing import List, Optional, Union
from typing import List, Optional, TYPE_CHECKING, Union

from rbtools.api.resource import ItemResource
if TYPE_CHECKING:
from rbtools.api.resource import ItemResource


class RepositoryInfo:
Expand Down Expand Up @@ -159,7 +160,7 @@ def set_base_path(
def update_from_remote(
self,
repository: ItemResource,
info: ItemResource,
info: Optional[ItemResource],
) -> None:
"""Update the info from a remote repository.
Expand Down
Loading

0 comments on commit 22792e6

Please sign in to comment.