cloudstorage icon indicating copy to clipboard operation
cloudstorage copied to clipboard

Undocumented pre-requisite `libmagic`

Open burnpanck opened this issue 4 years ago • 1 comments

While setup.py correctly declares a dependency on python-magic, relying on PIP for dependency resolution still fails; python-magic requires that the libmagic shared library is installed into the system separately, and refuses to import otherwise. Because this library imports magic at the top-level, it therefore transitively also depends on that shared library to be installed at the top-level. This should at least be documented prominently,

(Personally, I would prefer if that functionality were made an optional dependency. The docstring already indicates that if inferring the mime-type fails, that task is left to the cloud storage. By not raising an exception, this library already made the design choice that leaving mime-type determination to the cloud storage as an acceptable solution. Therefore, allowing a dependency-free installation for simple use-cases would be preferrable IMHO.)

burnpanck avatar May 29 '21 13:05 burnpanck

I'm guessing related to this, I had issues bundling into an Alpine based container due to libmagic missing. I had to explicitly install it:

apk add libmagic

wallyhall avatar Oct 26 '21 16:10 wallyhall