Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

fix: Properly cache svg files in svg_path #5

Merged
merged 7 commits into from
Oct 9, 2023

Conversation

Czaki
Copy link
Contributor

@Czaki Czaki commented Oct 9, 2023

This is bugfix PR. Currently if cache is enabled but, icon is not downloaded yet, the obsolete temporary file is created and proper cached file is used since next run. This PR fix this by prefetch data if they are missed in cache struct.

@codecov
Copy link

codecov bot commented Oct 9, 2023

Codecov Report

All modified lines are covered by tests ✅

Comparison is base (548bc81) 100.00% compared to head (3426f70) 100.00%.

Additional details and impacted files
@@            Coverage Diff            @@
##              main        #5   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            3         3           
  Lines          205       207    +2     
=========================================
+ Hits           205       207    +2     
Files Coverage Δ
src/pyconify/_cache.py 100.00% <100.00%> (ø)
src/pyconify/api.py 100.00% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@tlambert03
Copy link
Member

thanks @Czaki.

I pushed a change here that elaborates the documentation and enables the commented out line in your test. Specifically, I test that you can use tmp_path and monkeypatch (monkeypatch.setattr(_cache, "PYCONIFY_CACHE", str(tmp_path))) to temporarily change the cache directory in tests. To do so, I disabled the global cache override in conftest, and replaced it with an autouse tests that simply checks that none of the tests create/delete/modify the user's cache.

@tlambert03 tlambert03 changed the title Properly cache svg files in svg_path fix: Properly cache svg files in svg_path Oct 9, 2023
@tlambert03 tlambert03 added the bug Something isn't working label Oct 9, 2023
@tlambert03 tlambert03 merged commit 5a9f864 into pyapp-kit:main Oct 9, 2023
@Czaki Czaki deleted the svg_path_cache branch October 9, 2023 16:37
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants