Erotemic / ubelt

A Python utility library with a stdlib like feel and extra batteries. Paths, Progress, Dicts, Downloads, Caching, Hashing: ubelt makes it easy!
Apache License 2.0
719 stars 43 forks source link

Refactor grabdata to use CacheStamp #110

Closed Erotemic closed 2 years ago

Erotemic commented 2 years ago

Refactors ub.grab_data to use ub.CacheStamp instead of its own caching solution.

This also adds support to ub.CacheStamp for hash_prefix, which will expire if it is incorrect and also prevent renewal.

codecov[bot] commented 2 years ago

Codecov Report

Merging #110 (d309ee7) into main (2e9f610) will not change coverage. The diff coverage is 100.00%.

@@            Coverage Diff            @@
##              main      #110   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           28        28           
  Lines         3139      3171   +32     
  Branches       634       638    +4     
=========================================
+ Hits          3139      3171   +32     
Impacted Files Coverage Δ
ubelt/util_cache.py 100.00% <100.00%> (ø)
ubelt/util_download.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 2e9f610...d309ee7. Read the comment docs.