From 8aa67e1bfb6aa397e12b25f0615f2bfb93eb6127 Mon Sep 17 00:00:00 2001 From: "geo-ghci-int[bot]" <146321879+geo-ghci-int[bot]@users.noreply.github.com> Date: Wed, 10 Jul 2024 07:47:44 +0000 Subject: [PATCH] Fix c2cciutils-checks From the artifact of the previous workflow run --- tilecloud_chain/__init__.py | 8 +++++--- tilecloud_chain/configuration.py | 1 - tilecloud_chain/generate.py | 8 +++++--- tilecloud_chain/tests/test_copy.py | 16 ++++++++++------ tilecloud_chain/views/admin.py | 8 +++++--- 5 files changed, 25 insertions(+), 16 deletions(-) diff --git a/tilecloud_chain/__init__.py b/tilecloud_chain/__init__.py index 759672963..04ee765c5 100644 --- a/tilecloud_chain/__init__.py +++ b/tilecloud_chain/__init__.py @@ -99,9 +99,11 @@ def add_common_options( parser.add_argument( "-c", "--config", - default=os.environ.get("TILEGENERATION_CONFIGFILE", "tilegeneration/config.yaml") - if default_config_file - else None, + default=( + os.environ.get("TILEGENERATION_CONFIGFILE", "tilegeneration/config.yaml") + if default_config_file + else None + ), help="path to the configuration file", metavar="FILE", ) diff --git a/tilecloud_chain/configuration.py b/tilecloud_chain/configuration.py index 6781c492c..d45b9468a 100644 --- a/tilecloud_chain/configuration.py +++ b/tilecloud_chain/configuration.py @@ -2,7 +2,6 @@ Automatically generated file from a JSON schema. """ - from typing import Any, Dict, List, Literal, Tuple, TypedDict, Union ADMIN_PATH_DEFAULT = "admin" diff --git a/tilecloud_chain/generate.py b/tilecloud_chain/generate.py index 268539882..d77e591da 100644 --- a/tilecloud_chain/generate.py +++ b/tilecloud_chain/generate.py @@ -196,9 +196,11 @@ def _generate_tiles(self) -> None: ) ) self._gene.init( - self._queue_tilestore - if "error_file" in self._gene.get_main_config().config["generation"] - else None, + ( + self._queue_tilestore + if "error_file" in self._gene.get_main_config().config["generation"] + else None + ), self._options.daemon, ) else: diff --git a/tilecloud_chain/tests/test_copy.py b/tilecloud_chain/tests/test_copy.py index dd8ea63d3..40f48477f 100644 --- a/tilecloud_chain/tests/test_copy.py +++ b/tilecloud_chain/tests/test_copy.py @@ -33,7 +33,8 @@ def test_copy(self) -> None: cmd=f".build/venv/bin/generate_copy {d} -c tilegeneration/test-copy.yaml src dst", main_func=copy_.main, regex=True, - expected="""The tile copy of layer 'point_hash' is finish + expected=( + """The tile copy of layer 'point_hash' is finish Nb copy tiles: 1 Nb errored tiles: 0 Nb dropped tiles: 0 @@ -43,8 +44,9 @@ def test_copy(self) -> None: Size per tile: 10(.0)? o """ - if d != "-q" - else "", + if d != "-q" + else "" + ), empty_err=True, ) with open("/tmp/tiles/dst/1.0.0/point_hash/default/21781/0/0/0.png") as f: @@ -70,7 +72,8 @@ def test_process(self) -> None: "tilegeneration/test-copy.yaml --cache src optipng".format(d), main_func=copy_.process, regex=True, - expected="""The tile process of layer 'point_hash' is finish + expected=( + """The tile process of layer 'point_hash' is finish Nb process tiles: 1 Nb errored tiles: 0 Nb dropped tiles: 0 @@ -80,8 +83,9 @@ def test_process(self) -> None: Size per tile: 103(.0)? o """ - if d != "-q" - else "", + if d != "-q" + else "" + ), empty_err=True, ) statinfo = os.stat( diff --git a/tilecloud_chain/views/admin.py b/tilecloud_chain/views/admin.py index 1089d02e8..4bb24b366 100644 --- a/tilecloud_chain/views/admin.py +++ b/tilecloud_chain/views/admin.py @@ -213,9 +213,11 @@ def admin_test(self) -> Dict[str, Any]: "zoom": config.config["openlayers"]["zoom"], "http_url": urljoin( self.request.current_route_url(), - "/" + main_config.config["server"].get("wmts_path", "wmts") + "/" - if "server" in config.config - else "/", + ( + "/" + main_config.config["server"].get("wmts_path", "wmts") + "/" + if "server" in config.config + else "/" + ), ), }