Package Details: python-imagecodecs 2024.9.22-1

Git Clone URL: https://aur.archlinux.org/python-imagecodecs.git (read-only, click to copy)
Package Base: python-imagecodecs
Description: Image transformation, compression, and decompression codecs
Upstream URL: https://github.com/cgohlke/imagecodecs
Licenses: BSD-3-Clause
Submitter: hottea
Maintainer: hottea (lilac)
Last Packager: lilac
Votes: 3
Popularity: 0.000072
First Submitted: 2020-06-20 14:41 (UTC)
Last Updated: 2024-09-22 12:23 (UTC)

Latest Comments

1 2 3 Next › Last »

tacaswell commented on 2024-10-01 01:35 (UTC)


def customize_build(EXTENSIONS, OPTIONS):
    EXTENSIONS['jpeg8']['sources'] = []
    del EXTENSIONS['apng']
    del EXTENSIONS['jetraw']
    del EXTENSIONS['jpegxr']
    del EXTENSIONS['jpegxs']
    del EXTENSIONS['jpeg2k']
    EXTENSIONS['lzham']['libraries'] = ['lzhamdll', 'lzhamcomp', 'lzhamdecomp']
    del EXTENSIONS['lzo']
    del EXTENSIONS['mozjpeg']
    del EXTENSIONS['pcodec']
    del EXTENSIONS['sperr']
    del EXTENSIONS['sz3']
    del EXTENSIONS['ultrahdr']

works for me, but I may have a few more packages installed than are currently listed as dependencies.

Wild_Penguin commented on 2024-01-10 20:16 (UTC)

One more comment - from the README:

To modify other build settings such as library names and compiler arguments, provide a imagecodecs_distributor_setup.customize_build function, which is imported and executed during setup. See setup.py for examples.

So setup.py is considered just an example, distributor providers are expected to make their own customize_build (so the same as they said in the upstream bug report).

Wild_Penguin commented on 2024-01-09 08:13 (UTC)

Unfortunately, the upstream bug report I reported was closed:

https://github.com/cgohlke/imagecodecs/issues/92

I'm a bit over my head on what they are expecting me to do, but what they are basically saying is that use their binaries - and if you compile yourself, you should fix the compiling yourself (talk about effective time-usage, every user manually fixing the compiling, and expecting compiling is some special thing to do...).

So it seems unlikely upstream is going to fix this setup.py script. Because I'm not currently using python-imagecodecs, and given the response I got, I'm not going to bother anytime soon with them.

hottea commented on 2024-01-08 01:39 (UTC)

@carlosal1015 again, what is the output of:

import platform
print(platform.platform())

That's how the upstream build script checks your OS.

carlosal1015 commented on 2024-01-07 16:35 (UTC)

Hi, I have the following the message error

==> Making package: python-imagecodecs 2024.1.1-1 (Sun Jan  7 11:32:53 2024)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> WARNING: Using existing $srcdir/ tree
==> Starting build()...
* Getting build dependencies for wheel...
Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
    main()
  File "/usr/lib/python3.11/site-packages/pyproject_hooks/_in_process/_in_process.py", line 335, in main
    json_out['return_val'] = hook(**hook_input['kwargs'])
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel
    return hook(config_settings)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/setuptools/build_meta.py", line 325, in get_requires_for_build_wheel
    return self._get_build_requires(config_settings, requirements=['wheel'])
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/setuptools/build_meta.py", line 295, in _get_build_requires
    self.run_setup()
  File "/usr/lib/python3.11/site-packages/setuptools/build_meta.py", line 311, in run_setup
    exec(code, locals())
  File "<string>", line 589, in <module>
  File "<string>", line 247, in customize_build_default
KeyError: 'jpegxl'

ERROR Backend subprocess exited when trying to invoke get_requires_for_build_wheel
==> ERROR: A failure occurred in build().
    Aborting...
 -> error making: python-imagecodecs-exit status 4

Wild_Penguin commented on 2024-01-06 23:45 (UTC)

@pwf the code from upstream is utterly broken still. It removes from EXTENSIONS when it should not on arch systems (including mine). So the underlying reason is still not fixed, despite it compiles with your changes.

I've gone ahead and made an upstream issue.

pwf commented on 2024-01-06 06:49 (UTC)

...?

why would upstream fix their code when it's not broken until after a patch applied here?

here, i'll help:

diff --git a/setup.py b/setup.py
index e527a75..1a371de 100644
--- a/setup.py
+++ b/setup.py
@@ -233,18 +233,13 @@ def customize_build_default(EXTENSIONS, OPTIONS):
     import platform

     del EXTENSIONS['apng']  # apng patch not commonly available
-    del EXTENSIONS['avif']  # libavif library not commonly available
-    del EXTENSIONS['blosc2']  # c-blosc2 library not commonly available
     # del EXTENSIONS['heif']  # LGPL/GPL
     del EXTENSIONS['jetraw']  # commercial
-    del EXTENSIONS['lerc']  # LERC library not commonly available
     del EXTENSIONS['lz4f']  # requires static linking
-    del EXTENSIONS['lzfse']  # lzfse not commonly available
     del EXTENSIONS['lzham']  # lzham not commonly available
     del EXTENSIONS['lzo']  # lzokay not commonly available
     del EXTENSIONS['mozjpeg']  # Win32 only
     del EXTENSIONS['sperr']  # sperr not commonly available
-    del EXTENSIONS['zlibng']  # zlib-ng library not commonly available

     if 'arch' not in platform.platform():
         del EXTENSIONS['jpegls']  # CharLS 2.1 library not commonly available
@@ -252,6 +247,9 @@ def customize_build_default(EXTENSIONS, OPTIONS):
         del EXTENSIONS['brunsli']  # Brunsli library not commonly available
         del EXTENSIONS['zfp']  # ZFP library not commonly available

+    if 'jpegxl' in EXTENSIONS:
+        del EXTENSIONS['jpegxl']
+
     if sys.platform == 'win32':
         EXTENSIONS['bz2']['libraries'] = ['libbz2']
     else:

hottea commented on 2024-01-05 06:17 (UTC)

@pants Maybe the upstream need a better method to check the target OS. report this or create a pull request to upstream, not here.

pants commented on 2024-01-04 17:46 (UTC) (edited on 2024-01-04 17:50 (UTC) by pants)

I have the same build error as pwf in a clean chroot using makechrootpkg. I suppose the line of code is using the linux version string to make dependency decisions? This seems absolutely insane... Packages might be built on machines with alternate or custom kernels, or in Arch Linux chroots run on non-Arch Linux distributions. The libraries being enabled or disabled should be done by something like a configure script that actually tests whether the libraries are present or not.

Edit: If you just want to test for Arch, a much more robust way is to read /etc/issue.

hottea commented on 2024-01-04 01:32 (UTC)

@pwf It seems you're using linux-zen? Are you using ArchLinux? Maybe platform.platform() is not a good way to check whether the current OS is ArchLinux. You could report this to upstream.

You could also skip the patch 0001.fix-deps.patch. This patch just add more image code format support, including avif, blocs2, lerc, lzfse, and zlibng. jpegxl will not enable until libjxl 0.9 is available in the ArchLinux repo.