Repository navigation
perf(cli): check PyPI for a newer release at most once a day - #223
Merged
Merged
Conversation
lianakoleva
requested review from
ethanwharris,
justusschock,
k223kim,
rusenask and
tejapulagam
as code owners
October 29, 2026 19:51
lianakoleva
force-pushed
the
lk/cache-version-check
branch
from
October 29, 2026 19:55
1aa9d6e to
7cbe417
Compare
mbeidler
approved these changes
Oct 29, 2026
stazcp
approved these changes
Oct 29, 2026
andyland
approved these changes
Oct 29, 2026
andyland
enabled auto-merge (squash)
October 29, 2026 20:54
ethanwharris
approved these changes
Oct 29, 2026
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.
previously, the version check ran on every import of
lightning_sdk, so every CLI command made a blocking request to pypi.org with no timeout. there was already per-process caching, but for CLI, this meant no caching. now, we store the outcome in~/.lightning/version_check.jsonand reuse it for 24 hours. the cache is keyed by the installed version, so an upgrade triggers a fresh check.lightning-sdktypically gets released at most once a day, so we can safely check the version 1x/day.demo: https://www.loom.com/share/7c175bf4911f48fa83908742b2be2c81
evidence
timing command (averaged over 5 runs):
/usr/bin/time -p lightning --helpLIGHTNING_DISABLE_VERSION_CHECK=1