NatLibFi / Annif

Annif is a multi-algorithm automated subject indexing tool for libraries, archives and museums.
https://annif.org
Other
190 stars 41 forks source link

Make stwfsapy an optional dependency #699

Closed cbartz closed 1 year ago

cbartz commented 1 year ago

We would like to release the STWFSA backend into the community. To ensure that Annif is not fundamentally dependent on the compatibility of stwfsapy with Annif, we suggest making stwfsapy an optional dependency in Annif. This way, stwfsapy can still be used within Annif but cannot break the entire system in case of temporary incompatibilities, because it can be removed more easily than a core dependency.

This can be achieved by declaring stwfsapy as an optional dependency in pyproject.toml. The import statement inside annif/backend/init.py should be wrapped by a try...except block to handle any import errors.