Source: python-shapely
Version: 2.2.0-1
Hi,
The python3-shapely 2.2.0-1+b1 amd64 binary ships Python distribution
metadata with Version: 0+unknown. I extracted the .deb with dpkg-deb -x and
checked this file:
usr/lib3/python3/dist-packages/shapely-0+unkown.dist-info/METADATA
It contains:
Name: shapely
Version: 0+unknown
I expected the Python distribution version to be 2.2.0. PyInstaller reads
this metadata, treats Shapely as older than 1.7, and fails when this hook
tries to read shapely/.libs. This explains the Shapely failures in the
pyinstaller-hooks-contrib build report (#1150835) and in Debian CI:
```
elif compat.is_linux and is_module_satisfies('shapely < 1.7'):
# This duplicates the libgeos*.so* files in the build. PyInstaller will
# copy them into the root of the build by default, but shapely
cannot load
# them from there in linux IF shapely was installed via a whl file. The
# whl bundles its own libgeos with a different name, something like
# libgeos_c-*.so.* but shapely tries to load libgeos_c.so if
there isn't a
# ./libs directory under its package.
#
# The fix for this (https://github.com/Toblerity/Shapely/pull/485) has
# been available in shapely since version 1.7.
lib_dir = os.path.join(pkg_dir, '.libs')
dest_dir = os.path.join('shapely', '.libs')
> binaries += [(os.path.join(lib_dir, f), dest_dir) for f in
> os.listdir(lib_dir)]
^^^^^^^^^^^^^^^^^^^
E FileNotFoundError: [Errno 2] No such file or directory:
'/usr/lib/python3/dist-packages/shapely/.libs'
/<<PKGBUILDDIR>>/.pybuild/cpython3_3.15/build/_pyinstaller_hooks_contrib/stdhooks/hook-shapely.py:91:
FileNotFoundError
```
[Link]
https://ci.debian.net/packages/p/pyinstaller-hooks-contrib/testing/amd64/78118119/#L4484
I also saw the same failure in Ubuntu Tenacious:
[Link]
https://launchpad.net/ubuntu/+source/pyinstaller-hooks-contrib/2026.8-1/+build/33936857
The debian orig tarball does not contain the generated top-level
_version.py, but the upstream PyPI source distribution for 2.2.0 does. I'd
be happy to prepare and test a packing patch. Is there a fix you'd prefer
for the current Debian source package?
Thanks,
Rishabh