From 201b0748568a9b1665189c0610d02160abd2282a Mon Sep 17 00:00:00 2001 From: Herman Snevajs Date: Thu, 6 Aug 2026 10:15:36 +0200 Subject: [PATCH 1/9] Try to import trustore and catch the exception if it fails. This allows py-client to be loaded bundled in plugin on QGIS with python<3.10 --- mergin/client.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/mergin/client.py b/mergin/client.py index 61b5235..662fe07 100644 --- a/mergin/client.py +++ b/mergin/client.py @@ -11,7 +11,6 @@ import platform from datetime import datetime, timezone import dateutil.parser -import truststore from enum import Enum, auto import re import typing @@ -71,7 +70,12 @@ ) from .version import __version__ -truststore.inject_into_ssl() +try: + import truststore + + truststore.inject_into_ssl() +except ImportError: + pass json_headers = {"Content-Type": "application/json"} From 788b9536fad18c27499664c34b8ad82779a280c4 Mon Sep 17 00:00:00 2001 From: Herman Snevajs Date: Fri, 7 Aug 2026 09:21:21 +0200 Subject: [PATCH 2/9] log trustore import error --- mergin/client.py | 4 +++- mergin/client_pull.py | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/mergin/client.py b/mergin/client.py index 662fe07..d59cc0b 100644 --- a/mergin/client.py +++ b/mergin/client.py @@ -75,7 +75,9 @@ truststore.inject_into_ssl() except ImportError: - pass + logging.getLogger("mergin.client").warning( + "truststore could not be imported, continuing without it" + ) json_headers = {"Content-Type": "application/json"} diff --git a/mergin/client_pull.py b/mergin/client_pull.py index f751949..5210089 100644 --- a/mergin/client_pull.py +++ b/mergin/client_pull.py @@ -701,7 +701,7 @@ def pull_project_finalize(job: PullJob): except NotImplementedError as e: job.mp.log.error("Failed to get project info v2 in this server version: " + str(e)) job.mp.log.info("--- pull aborted") - raise ClientError("Failed to get project info v2 as server not support it: " + str(e)) + raise ClientError("Failed to get project info v2 as server does not support it: " + str(e)) except ClientError as e: job.mp.log.error("Failed to get project info v2: " + str(e)) job.mp.log.info("--- pull aborted") From 02678e40a0d744ba81e1c70b733d66b7303628a7 Mon Sep 17 00:00:00 2001 From: Herman Snevajs Date: Fri, 7 Aug 2026 09:31:29 +0200 Subject: [PATCH 3/9] black --- mergin/client.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/mergin/client.py b/mergin/client.py index d59cc0b..1555051 100644 --- a/mergin/client.py +++ b/mergin/client.py @@ -75,9 +75,7 @@ truststore.inject_into_ssl() except ImportError: - logging.getLogger("mergin.client").warning( - "truststore could not be imported, continuing without it" - ) + logging.getLogger("mergin.client").warning("truststore could not be imported, continuing without it") json_headers = {"Content-Type": "application/json"} From 912808804f65c4fcb61e31c367de221c59642ead Mon Sep 17 00:00:00 2001 From: Herman Snevajs Date: Fri, 7 Aug 2026 09:56:58 +0200 Subject: [PATCH 4/9] test with python 3.9 --- .github/workflows/autotests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/autotests.yml b/.github/workflows/autotests.yml index d59d2bd..bdfb113 100644 --- a/.github/workflows/autotests.yml +++ b/.github/workflows/autotests.yml @@ -15,7 +15,7 @@ jobs: - uses: actions/setup-python@v2 with: - python-version: "3.10" + python-version: "3.9" - name: Install python package dependencies run: | From c4db5bcdaa4e3c8897a1581150c6885576aacecc Mon Sep 17 00:00:00 2001 From: Herman Snevajs Date: Fri, 7 Aug 2026 10:01:19 +0200 Subject: [PATCH 5/9] test with python 3.9 try2 --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 038393b..4e0ee6f 100644 --- a/setup.py +++ b/setup.py @@ -14,7 +14,7 @@ long_description="Mergin Maps utils and client", packages=find_packages(), platforms="any", - python_requires=">=3.10", + python_requires=">=3.9", install_requires=[ "python-dateutil==2.8.2", "pygeodiff==2.3.0", From f8bf96ddebf6e381d23d87428b9202529235ba16 Mon Sep 17 00:00:00 2001 From: Herman Snevajs Date: Fri, 7 Aug 2026 10:03:21 +0200 Subject: [PATCH 6/9] test with python 3.9 try3 --- setup.py | 1 - 1 file changed, 1 deletion(-) diff --git a/setup.py b/setup.py index 4e0ee6f..fa89cad 100644 --- a/setup.py +++ b/setup.py @@ -20,7 +20,6 @@ "pygeodiff==2.3.0", "pytz==2022.1", "click==8.1.3", - "truststore==0.10.4", ], entry_points={ "console_scripts": ["mergin=mergin.cli:cli"], From 7442ee0cb51f3b6a5c9b2b3f37de0dd3a31252af Mon Sep 17 00:00:00 2001 From: Herman Snevajs Date: Fri, 7 Aug 2026 10:04:54 +0200 Subject: [PATCH 7/9] test with python 3.9 try4 --- .github/workflows/autotests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/autotests.yml b/.github/workflows/autotests.yml index bdfb113..ae29ec9 100644 --- a/.github/workflows/autotests.yml +++ b/.github/workflows/autotests.yml @@ -20,7 +20,7 @@ jobs: - name: Install python package dependencies run: | python -m pip install --upgrade pip - pip install python-dateutil pytz pytest pytest-cov pygeodiff truststore coveralls + pip install python-dateutil pytz pytest pytest-cov pygeodiff coveralls - name: Run tests run: | From 050051e271381489d06037db782d2e5172ecb0ff Mon Sep 17 00:00:00 2001 From: Herman Snevajs Date: Fri, 7 Aug 2026 10:15:19 +0200 Subject: [PATCH 8/9] back python 3.10 --- .github/workflows/autotests.yml | 4 ++-- setup.py | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/autotests.yml b/.github/workflows/autotests.yml index ae29ec9..d59d2bd 100644 --- a/.github/workflows/autotests.yml +++ b/.github/workflows/autotests.yml @@ -15,12 +15,12 @@ jobs: - uses: actions/setup-python@v2 with: - python-version: "3.9" + python-version: "3.10" - name: Install python package dependencies run: | python -m pip install --upgrade pip - pip install python-dateutil pytz pytest pytest-cov pygeodiff coveralls + pip install python-dateutil pytz pytest pytest-cov pygeodiff truststore coveralls - name: Run tests run: | diff --git a/setup.py b/setup.py index fa89cad..4e0ee6f 100644 --- a/setup.py +++ b/setup.py @@ -20,6 +20,7 @@ "pygeodiff==2.3.0", "pytz==2022.1", "click==8.1.3", + "truststore==0.10.4", ], entry_points={ "console_scripts": ["mergin=mergin.cli:cli"], From dc6b7aa3a1b04c74f2ff459f561f050fbb034a38 Mon Sep 17 00:00:00 2001 From: Herman Snevajs Date: Fri, 7 Aug 2026 10:15:46 +0200 Subject: [PATCH 9/9] back python 3.10 2 --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 4e0ee6f..038393b 100644 --- a/setup.py +++ b/setup.py @@ -14,7 +14,7 @@ long_description="Mergin Maps utils and client", packages=find_packages(), platforms="any", - python_requires=">=3.9", + python_requires=">=3.10", install_requires=[ "python-dateutil==2.8.2", "pygeodiff==2.3.0",