Repository navigation
Package search: find a package without knowing its exact name - #116
Merged
Merged
Conversation
mpftp search WORDS looks through micropython-lib's mip index, the PyDevices index and the Adafruit and community CircuitPython bundles' release manifests, and ranks the hits: the exact name first, then names that start with or contain the words, then descriptions. Each result has its source, version, a one-line description and the install line to run (mpftp mip NAME, with --index https://PyDevices.github.io/mip for a PyDevices package, or mpftp circup NAME) plus the RPC method and params behind it. --text prints lines for reading; --source, --interpreter and --limit narrow it. Indexes are cached six hours under ~/.mpftp/package-cache; --refresh fetches again, and offline the search runs on the cached copies and says so (or says which index it could not reach and has no copy of). The sidecar exposes it as package_search, with no board needed. Search Packages… in the ⋯ menu (VS Code and the browser interface) searches the indexes the connected board installs from and installs the pick the way Install Package does. Tests use recorded cuts of the four real indexes, so nothing needs the network: parsing, ranking tiers, mirror dedupe, cache freshness, offline with and without a cache, one index down, the CLI flags and the RPC params. The roadmap bullet goes with this.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
mpftp search WORDSfinds a package without knowing its exact name: one search across micropython-lib (the indexmipreads), the PyDevices index and the Adafruit and community CircuitPython bundles (the manifest each release attaches, which is whatcircupinstalls from)._,-and spaces don't matter.methodandparamsbehind it. A PyDevices package's line has--index https://PyDevices.github.io/mip, which mip needs to find it.--textthe answer is JSON.--source,--interpreterand--limitnarrow it; the search needs no board.~/.mpftp/package-cache.--refreshfetches them again. Offline, the search runs on the cached copies and says so, or says which index it could not fetch and has no copy of yet.Search Packages… in the ⋯ menu, in VS Code and in the browser interface, searches the indexes the connected board installs from (micropython-lib and PyDevices on MicroPython, the two bundles on CircuitPython) and installs the result you pick, through the same
mip_install/circup_installcalls as Install Package.Tests run on recorded cuts of the four real indexes, so they need no network: parsing, the ranking tiers, mirror dedupe, cache freshness and
--refresh, offline with a stale cache and with none, one index down while the others answer, the CLI's flags and the RPC's params. The browser dialog's notes have node tests too.The roadmap bullet comes out with this; the CHANGELOG has the entry.