Package: python3-fastkml
Version: 0.12-3
Severity: grave
Tags: upstream
Justification: renders package unusable
X-Debbugs-Cc: t...@nomi.cz

Dear Maintainer,

Since python3-pygeoif 1.4.0-1 appeared in Debian testing, fastkml cannot 
be imported at all:

    In [1]: import fastkml
    ---------------------------------------------------------------------------
    ImportError                               Traceback (most recent call last)
    File /usr/lib/python3/dist-packages/fastkml/geometry.py:39
         38 from shapely.geometry import Polygon
    ---> 39 from shapely.geometry import asShape
         40 from shapely.geometry.polygon import LinearRing

    ImportError: cannot import name 'asShape' from 'shapely.geometry' 
(/usr/lib/python3/dist-packages/shapely/geometry/__init__.py)

    During handling of the above exception, another exception occurred:

    ImportError                               Traceback (most recent call last)
    Cell In[1], line 1
    ----> 1 import fastkml

    File /usr/lib/python3/dist-packages/fastkml/__init__.py:34
         32 from .atom import Contributor
         33 from .atom import Link
    ---> 34 from .kml import KML
         35 from .kml import Data
         36 from .kml import Document

    File /usr/lib/python3/dist-packages/fastkml/kml.py:46
         44 import fastkml.atom as atom
         45 import fastkml.config as config
    ---> 46 import fastkml.gx as gx
         48 from .base import _BaseObject
         49 from .base import _XMLObject

    File /usr/lib/python3/dist-packages/fastkml/gx.py:92
         89 from pygeoif.geometry import GeometryCollection
         91 from .config import GXNS as NS
    ---> 92 from .geometry import Geometry
         94 logger = logging.getLogger(__name__)
         97 class GxGeometry(Geometry):

    File /usr/lib/python3/dist-packages/fastkml/geometry.py:46
         44     from pygeoif.geometry import MultiPoint, MultiLineString, 
MultiPolygon
         45     from pygeoif.geometry import LinearRing
    ---> 46     from pygeoif.geometry import as_shape as asShape
         48 import logging
         50 from pygeoif.geometry import GeometryCollection

    ImportError: cannot import name 'as_shape' from 'pygeoif.geometry' 
(/usr/lib/python3/dist-packages/pygeoif/geometry.py)

I believe this is because both shapely and pygeoif deprecated 
asShape/as_shape respectively. The function is now called just "shape" 
in both.

Unfortunately, fastkml doesn't have a newer release compatible with 
recent pygeoif (or shapely) versions. There's only been a steady stream 
of 1.0.alphas, most of which are broken in various ways (I have a 
project that depends on fastkml so its CI has been notifying me of ways 
my project breaks with those alphas and I tried to work around these for 
a while but recently gave up and just pinned fastkml to 0.12).

I think it might be okay to just patch fastkml/geometry.py to

    from shapely.geometry import shape as asShape
    …
    from pygeoif.geometry import shape as asShape

but it needs to be tested more thoroughly.

Also, fastkml 0.12 explicitly depends on pygeoif < 1.0, for good reason 
apparently, so it's a bit unfortunate that this dependency is relaxed in 
the Debian package. :-(

-- System Information:
Debian Release: trixie/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 6.6.15-amd64 (SMP w/4 CPU threads; PREEMPT)
Kernel taint flags: TAINT_CPU_OUT_OF_SPEC, TAINT_USER
Locale: LANG=C, LC_CTYPE=C.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: unable to detect

Versions of packages python3-fastkml depends on:
ii  python3                3.11.6-1
ii  python3-dateutil       2.9.0-2
ii  python3-pkg-resources  68.1.2-2
ii  python3-pygeoif        1.4.0-1

python3-fastkml recommends no packages.

python3-fastkml suggests no packages.

-- no debconf information

-- 
Tomáš "liskin" ("Pivník") Janoušek, https://lisk.in/

Reply via email to