-
Notifications
You must be signed in to change notification settings - Fork 441
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix download_zip #2787
fix download_zip #2787
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Go for it.
I'll merge if passing. |
Codecov Report
@@ Coverage Diff @@
## main #2787 +/- ##
==========================================
- Coverage 93.96% 93.90% -0.06%
==========================================
Files 76 76
Lines 16292 16292
==========================================
- Hits 15308 15299 -9
- Misses 984 993 +9 |
@adeak, this needs another look over. Turns out it's not as easy as a cache bump. |
Turns out files are hard. Had to handle another edge case where the retriever returns the exact same path as the requested filename. This edge case only occurs in testing, but I figure if someone wanted to implement a custom retriever for whatever reason in the future we should handle that as well rather than modifying the test. |
Ok, ready to review. There was one final fix needed in bdd3248: our example was assuming paths. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've pushed a few cosmetic changes (some unrelated to the PR), please check. Otherwise this LGTM, thanks
Your changes LGTM. As always, thanks for the attention to detail @adeak! |
I'm fine with the changes here since it is all private methods, and as long as we play by our rules everything should still work. But, I think the testing is flawed. If I'm understanding the issue is that a zip file retrieved is placed into the examples path by the retriever. Then the name clashes when we try to make a directory with the same name? We shouldn't allow for retrievers to return files in the example path as many bad things will happen. IMO we should raise an error instead and fix the tests. |
PR #2727 introduced a breaking change to our downloads module CI/CD is failing. It should have bumped the cache version in that PR and discovered the flaw with the PR.
Turns out there's an edge case that #2787 didn't consider with a fresh cache: a zip file (without extension) that's the same name as a directory. For example, we have
Ensight
anEnsight.zip
. If theEnsight
directory already exists locally, ourEnsight.zip
won't be downloaded and PyVista will look in theEnsight
directory. However, since it's a different directory altogether, thedownloads
module won't find the file it's looking for and will fail outright.The fix for this is to simply keep the "zip" in the directory name. It will look a little strange, but this is good in two ways:
vtk-data
better. Archives will simply appear as directories.Recommend immediate merge to get this CI working again.