Bug#1068290: python3-fastkml: ImportError since python3-pygeoif 1.4.0

2024-05-25 Thread Antonio Valentino

Dear Thomas and Andreas,

On Wed, 3 Apr 2024 01:22:14 +0100 Tomas Janousek  wrote:

Hi,

On Wed, Apr 03, 2024 at 12:29:36AM +0100, Tomas Janousek wrote:
>I believe this is because both shapely and pygeoif deprecated
>asShape/as_shape respectively. The function is now called just "shape"
>in both.
>[…]
>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.

Yep, almost that. The following seems to work well (makes my CI pass):
https://github.com/liskin/liscopridge/commit/c44c3e6054af5a12bdf24d5687b6478d39480194#diff-e8ae9ced1dd6c13b4566c8a4a669116272e05115ce64aa743658523f4455ad5fR11

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


Apparently the fix was a little bit more complex that expected.
I think that I have managed to adapt the current version of the 
python3-fastkml package to the new pygeoif.


A MR is available in salsa [1].

I would appreciate if you could review, apply the patch and proceed with 
a new upload.


This would allow to "doris" one of my packages to migrate back in testing.


P.S:: @Andreas, I'm a DM and I would be happy to be listed as uploader 
of this package if it is OK for you.



[1] https://salsa.debian.org/python-team/packages/fastkml/-/merge_requests/1



kind regards
--
Antonio Valentino



Bug#1068290: python3-fastkml: ImportError since python3-pygeoif 1.4.0

2024-04-02 Thread Tomas Janousek

Hi,

On Wed, Apr 03, 2024 at 12:29:36AM +0100, Tomas Janousek wrote:

I believe this is because both shapely and pygeoif deprecated
asShape/as_shape respectively. The function is now called just "shape"
in both.
[…]
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.


Yep, almost that. The following seems to work well (makes my CI pass):
https://github.com/liskin/liscopridge/commit/c44c3e6054af5a12bdf24d5687b6478d39480194#diff-e8ae9ced1dd6c13b4566c8a4a669116272e05115ce64aa743658523f4455ad5fR11

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


Bug#1068290: python3-fastkml: ImportError since python3-pygeoif 1.4.0

2024-04-02 Thread Tomas Janousek
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  python33.11.6-1
ii  python3-dateutil   2.9.0-2
ii  python3-pkg-resources  68.1.2-2
ii  python3-pygeoif1.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/