-
Notifications
You must be signed in to change notification settings - Fork 41
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
Make stwfsapy an optional dependency #700
Make stwfsapy an optional dependency #700
Conversation
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #700 +/- ##
=======================================
Coverage 99.63% 99.63%
=======================================
Files 89 89
Lines 6222 6231 +9
=======================================
+ Hits 6199 6208 +9
Misses 23 23
☔ View full report in Codecov by Sentry. |
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.
STWFSA should be added to be installed in the Docker image by adding it to the optional_dependencies
variable in
Line 5 in 3451bd3
ARG optional_dependencies="fasttext voikko fasttext nn omikuji yake spacy" |
Otherwise looks good and ready to be merged. The missing test coverage could also be addressed (see the inline comment), but that's a minor thing.
(Annif Wiki needs to be modified to account for the changes, but that should be done when/after next Annif release is made, we should remember that.)
return stwfsa.StwfsaBackend | ||
return stwfsa.StwfsaBackend | ||
except ImportError: | ||
raise ValueError("STWFSA not available, cannot use stwfsa backend") |
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.
Test coverage could be extended to these lines by adding a test like
Lines 86 to 93 in 3451bd3
@pytest.mark.skipif( | |
importlib.util.find_spec("yake") is not None, | |
reason="test requires that YAKE is NOT installed", | |
) | |
def test_get_backend_yake_not_installed(): | |
with pytest.raises(ValueError) as excinfo: | |
annif.backend.get_backend("yake") | |
assert "YAKE not available" in str(excinfo.value) |
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
Thanks @cbartz! Merging this now. |
Closes #699