scottwernervt / cloudstorage

Unified cloud storage API for storage services.
http://cloudstorage.readthedocs.io/en/latest/
MIT License
93 stars 27 forks source link

Undocumented pre-requisite `libmagic` #83

Open burnpanck opened 3 years ago

burnpanck commented 3 years ago

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.)

wallyhall commented 2 years ago

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