Skip to content

Commit

Permalink
refactor(stubs): remove search remote from stub manager.
Browse files Browse the repository at this point in the history
Signed-off-by: Braden Mars <bradenmars@bradenmars.me>
  • Loading branch information
BradenM committed Dec 11, 2022
1 parent e81ac84 commit 95d42f0
Showing 1 changed file with 1 addition and 20 deletions.
21 changes: 1 addition & 20 deletions micropy/stubs/stubs.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from packaging.utils import parse_sdist_filename

if TYPE_CHECKING:
from micropy.stubs.repo import StubRepository, StubRepositoryPackage
from micropy.stubs.repo import StubRepository


class StubManager:
Expand Down Expand Up @@ -399,25 +399,6 @@ def from_metadata(self, package_name: str, path: Path) -> dict[str, str]:
info_path.write_text(json.dumps(info_json))
return info_json

def search_remote(self, query) -> list[tuple[StubRepositoryPackage, bool]]:
"""Search all repositories for query.
Args:
query (str): query to search for
Returns:
[tuple]: List of result tuples. The first item
is the package name, and the second is a bool
based on whether the package is installed or not
"""
results = []
installed = [str(s) for s in self._loaded.union(self._firmware)]
for p in self.repo.search(query):
result = (p, p.name in installed)
results.append(result)
return results

def resolve_subresource(self, stubs, subresource):
"""Resolve or Create StubManager from list of stubs.
Expand Down

0 comments on commit 95d42f0

Please sign in to comment.