Skip to content

Commit f59c868

Browse files
committed
import geodiff from deps in client_push
1 parent 4ad9bbf commit f59c868

File tree

1 file changed

+9
-12
lines changed

1 file changed

+9
-12
lines changed

mergin/client_push.py

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,10 @@
1515
import tempfile
1616
import concurrent.futures
1717
import os
18-
from pygeodiff import (
19-
GeoDiff,
20-
GeoDiffLibError,
21-
GeoDiffLibConflictError,
22-
GeoDiffLibUnsupportedChangeError,
23-
GeoDiffLibVersionError,
24-
)
18+
try:
19+
from .deps import pygeodiff
20+
except (ImportError, ModuleNotFoundError):
21+
import pygeodiff
2522

2623
from .common import UPLOAD_CHUNK_SIZE, ClientError
2724
from .merginproject import MerginProject
@@ -338,12 +335,12 @@ def _geodiff_changes_count(mp: MerginProject, diff_rel_path: str):
338335

339336
diff_abs = mp.fpath_meta(diff_rel_path)
340337
try:
341-
return GeoDiff().changes_count(diff_abs)
338+
return pygeodiff.GeoDiff().changes_count(diff_abs)
342339
except (
343-
GeoDiffLibError,
344-
GeoDiffLibConflictError,
345-
GeoDiffLibUnsupportedChangeError,
346-
GeoDiffLibVersionError,
340+
pygeodiff.GeoDiffLibError,
341+
pygeodiff.GeoDiffLibConflictError,
342+
pygeodiff.GeoDiffLibUnsupportedChangeError,
343+
pygeodiff.GeoDiffLibVersionError,
347344
FileNotFoundError,
348345
):
349346
return None

0 commit comments

Comments
 (0)