Skip to content
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

Only suppress imports of optional external dependencies #550

Merged
merged 4 commits into from
Dec 3, 2024

Conversation

dstansby
Copy link
Contributor

@dstansby dstansby commented Jul 14, 2024

This makes the suppression of import errors consistent with which codecs depend on optional external packages. If a codec doesn't depend on any code external to numcodecs, then import errors shouldn't be suppressed as they are indicating an issue with numcodecs itself.

I looked in git blame and there doesn't seem to be any commentary/reason given for these suppressions, and they all seem to have been added in the original PRs where each codec was added.

This came up over at zarr-developers/zarr-python#2032.

Copy link

codecov bot commented Jul 14, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.92%. Comparing base (d8a0a55) to head (86738ee).
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #550      +/-   ##
==========================================
- Coverage   99.92%   99.92%   -0.01%     
==========================================
  Files          62       62              
  Lines        2736     2732       -4     
==========================================
- Hits         2734     2730       -4     
  Misses          2        2              
Files with missing lines Coverage Δ
numcodecs/__init__.py 100.00% <100.00%> (ø)

@rabernat
Copy link
Contributor

Thanks for this @dstansby! This seems like the right behavior to me. But it's a significant change. I'd want to get @jakirkham's opinion before merging. Perhaps John has some context on the original intended behavior?

@dstansby dstansby force-pushed the consistent-suppress branch from fd7adc7 to 7d0083d Compare December 3, 2024 08:05
@dstansby dstansby merged commit 9bdbaf0 into zarr-developers:main Dec 3, 2024
26 checks passed
@dstansby dstansby deleted the consistent-suppress branch December 3, 2024 11:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants