cgohlke/imagecodecs

Checking for distributions (Arch in this case) should be done in a more reliable way

WildPenquin opened this issue · 2 comments

Hi!

In setup.py, on line 249:

if 'arch' not in platform.platform():

This does not work on many Arch installations. The kernel version reported by platform.platform() is really independent of the distribution.

On my system:

>>> platform.platform()
'Linux-6.6.9-zen1-1-zen-x86_64-with-glibc2.38'

Also see discussion in AUR.

Cheers!

I suggest using platform.freedesktop_os_release(). I haven't red the freedesktop standard (just found it), but something like: platform.freedesktop_os_release()['ID'] != 'arch' could work.

See:

EDIT: Of course this test should be only done to test for the distribution(s), and would be an improvement. But that is not enough to determine which libraries are available, as that might change at any time.

The project provides pre-compiled wheels for manylinux_aarch64 on PyPI. AArch64 binaries are also available on conda-forge. If you must build imagecodecs form source and the default configuration does not work, provide a customize_build function in an importable imagecodecs_distributor_setup module. That allows to define which extensions are built and to modify library names, include paths, compiler options, etc.