beancount icon indicating copy to clipboard operation
beancount copied to clipboard

Make file type logic work with both magic libraries

Open davide125 opened this issue 2 years ago • 2 comments

The current implementation only works with python-magic because it uses its specific API. However, python-magic includes a compatibility API as of 0.4.19, so we can use that instead to make the logic compatible with both python-magic and python-file-magic.

davide125 avatar Nov 25 '23 17:11 davide125

I didn't update the python-magic version in setup.py in here to avoid merge conflicts with https://github.com/beancount/beancount/pull/790, but also because we may want to move the magic requirement to an extra as it's an optional dependency.

davide125 avatar Nov 25 '23 17:11 davide125

I am not sure I follow what the intent. beancount depends on python-magic. Making the API compatible with python-file-magic while still requiring python-magic does not seem to achieve anything.

dnicolodi avatar Dec 10 '23 16:12 dnicolodi