arduino-cli
arduino-cli copied to clipboard
cli: use cached index with lib search (#1624)
trafficstars
Please check if the PR fulfills these requirements
- [x] The PR has no duplicates (please search among the Pull Requests before creating one)
- [x] The PR follows our contributing guidelines
- [ ] Tests for the changes have been added (for bug fixes / features)
- [ ] Docs have been added / updated (for bug fixes / features)
- [ ]
UPGRADING.mdhas been updated with a migration guide (for breaking changes)
- What kind of change does this PR introduce? Feature
- What is the current behavior?
A new copy of
library_index.jsonis downloaded every timelib searchis called (unconditionally).
- What is the new behavior?
A new copy of
library_index.jsonis downloaded every timelib searchis called and either one of the following conditions exists:- The index has never been downloaded
- The time since the last index update is greater than one hour
- Does this PR introduce a breaking change, and is titled accordingly? No
- Other information:
- Fixes: #1624
- Changes based on: #1063
- Need assistance adding test cases and documentation for this change
I think that just removing these two lines https://github.com/arduino/arduino-cli/blob/f556aff7079ac5b02683f305329c90f8755c50f0/test/test_lib.py#L456-L457 should be enough to fix the integration tests.