From 8dc2f769c21c3a46b5714bf663126b591da6f347 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 6 Apr 2026 20:49:00 +0000 Subject: [PATCH 1/2] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/pre-commit/pre-commit-hooks: v5.0.0 → v6.0.0](https://github.com/pre-commit/pre-commit-hooks/compare/v5.0.0...v6.0.0) - [github.com/PyCQA/autoflake: v2.3.1 → v2.3.3](https://github.com/PyCQA/autoflake/compare/v2.3.1...v2.3.3) - [github.com/pycqa/isort: 6.0.1 → 8.0.1](https://github.com/pycqa/isort/compare/6.0.1...8.0.1) - https://github.com/psf/black → https://github.com/psf/black-pre-commit-mirror - [github.com/psf/black-pre-commit-mirror: 25.1.0 → 26.3.1](https://github.com/psf/black-pre-commit-mirror/compare/25.1.0...26.3.1) - [github.com/asottile/pyupgrade: v3.20.0 → v3.21.2](https://github.com/asottile/pyupgrade/compare/v3.20.0...v3.21.2) --- .pre-commit-config.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 62937526..bd3fd33e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -4,7 +4,7 @@ exclude: '^.*\.xtf|.*\.xml|.*\.ili|qgepqwat2ili/bin.*$' repos: # Fix end of files - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v5.0.0 + rev: v6.0.0 hooks: - id: trailing-whitespace - id: end-of-file-fixer @@ -14,7 +14,7 @@ repos: # Remove unused imports/variables - repo: https://github.com/PyCQA/autoflake - rev: v2.3.1 + rev: v2.3.3 hooks: - id: autoflake args: @@ -24,7 +24,7 @@ repos: # Sort imports - repo: https://github.com/pycqa/isort - rev: "6.0.1" + rev: "8.0.1" hooks: - id: isort args: @@ -32,15 +32,15 @@ repos: - black # Black formatting - - repo: https://github.com/psf/black - rev: "25.1.0" + - repo: https://github.com/psf/black-pre-commit-mirror + rev: "26.3.1" hooks: - id: black args: ["--line-length=99"] # tool to automatically upgrade syntax for newer versions of the language - repo: https://github.com/asottile/pyupgrade - rev: v3.20.0 + rev: v3.21.2 hooks: - id: pyupgrade args: [--py37-plus] From d03ce24b24dffdf802357600dcfa0d6c0ce460c5 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 6 Apr 2026 20:50:02 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- .deploy/create-dumps.py | 4 +--- test/test_import.py | 30 ++++++++++-------------------- 2 files changed, 11 insertions(+), 23 deletions(-) diff --git a/.deploy/create-dumps.py b/.deploy/create-dumps.py index 2d424e18..44ac1f79 100755 --- a/.deploy/create-dumps.py +++ b/.deploy/create-dumps.py @@ -53,9 +53,7 @@ def files_description(version): * If you plan to **use QGEP for production**, it is more likely you will be using the plain SQL `qgep_{version}_structure_with_value_lists.sql`. * If you want to **give a try at QGEP**, you will likely restore the `qgep_{version}_structure_and_demo_data.backup` backup file. -""".format( - version=version - ) +""".format(version=version) def create_dumps(): diff --git a/test/test_import.py b/test/test_import.py index 98a84708..5340f6d6 100644 --- a/test/test_import.py +++ b/test/test_import.py @@ -201,14 +201,12 @@ def test_update_with_outlet(self): # it should be in the live table qgep_od.reach and qgep_od.reach_point cur = self.cursor() cur.execute( - psycopg2.sql.SQL( - "SELECT re.material, re.clear_height, rp.level, ws.co_level\ + psycopg2.sql.SQL("SELECT re.material, re.clear_height, rp.level, ws.co_level\ FROM {schema}.reach re\ LEFT JOIN {schema}.reach_point rp ON rp.obj_id = re.fk_reach_point_from\ LEFT JOIN {schema}.wastewater_networkelement wn ON wn.obj_id = rp.fk_wastewater_networkelement\ LEFT JOIN {schema}.vw_qgep_wastewater_structure ws ON ws.obj_id = wn.fk_wastewater_structure\ - WHERE ws.obj_id = %(obj_id)s" - ).format(schema=psycopg2.sql.Identifier("qgep_od")), + WHERE ws.obj_id = %(obj_id)s").format(schema=psycopg2.sql.Identifier("qgep_od")), {"obj_id": obj_id}, ) row = cur.fetchone() @@ -221,11 +219,9 @@ def test_update_with_outlet(self): row = self.select("file", obj_id, "qgep_od") cur = self.cursor() cur.execute( - psycopg2.sql.SQL( - "SELECT *\ + psycopg2.sql.SQL("SELECT *\ FROM {schema}.file\ - WHERE object = %(obj_id)s" - ).format(schema=psycopg2.sql.Identifier("qgep_od")), + WHERE object = %(obj_id)s").format(schema=psycopg2.sql.Identifier("qgep_od")), {"obj_id": obj_id}, ) row = cur.fetchone() @@ -255,14 +251,12 @@ def test_update_with_wrong_material(self): # it should be in the live table qgep_od.reach and qgep_od.reach_point cur = self.cursor() cur.execute( - psycopg2.sql.SQL( - "SELECT re.material, re.clear_height, rp.level, ws.co_level\ + psycopg2.sql.SQL("SELECT re.material, re.clear_height, rp.level, ws.co_level\ FROM {schema}.reach re\ LEFT JOIN {schema}.reach_point rp ON rp.obj_id = re.fk_reach_point_from\ LEFT JOIN {schema}.wastewater_networkelement wn ON wn.obj_id = rp.fk_wastewater_networkelement\ LEFT JOIN {schema}.vw_qgep_wastewater_structure ws ON ws.obj_id = wn.fk_wastewater_structure\ - WHERE ws.obj_id = %(obj_id)s" - ).format(schema=psycopg2.sql.Identifier("qgep_od")), + WHERE ws.obj_id = %(obj_id)s").format(schema=psycopg2.sql.Identifier("qgep_od")), {"obj_id": obj_id}, ) row = cur.fetchone() @@ -330,14 +324,12 @@ def test_update_with_unexpected_inlet(self): # it should be in the live table qgep_od.reach and qgep_od.reach_point cur = self.cursor() cur.execute( - psycopg2.sql.SQL( - "SELECT re.material, re.clear_height, rp.level, ws.co_level\ + psycopg2.sql.SQL("SELECT re.material, re.clear_height, rp.level, ws.co_level\ FROM {schema}.reach re\ LEFT JOIN {schema}.reach_point rp ON rp.obj_id = re.fk_reach_point_from\ LEFT JOIN {schema}.wastewater_networkelement wn ON wn.obj_id = rp.fk_wastewater_networkelement\ LEFT JOIN {schema}.vw_qgep_wastewater_structure ws ON ws.obj_id = wn.fk_wastewater_structure\ - WHERE ws.obj_id = %(obj_id)s" - ).format(schema=psycopg2.sql.Identifier("qgep_od")), + WHERE ws.obj_id = %(obj_id)s").format(schema=psycopg2.sql.Identifier("qgep_od")), {"obj_id": obj_id}, ) row = cur.fetchone() @@ -431,14 +423,12 @@ def test_update_with_multiple_inlets(self): # it should be in the live table qgep_od.reach and qgep_od.reach_point cur = self.cursor() cur.execute( - psycopg2.sql.SQL( - "SELECT re.material, re.clear_height, rp.level, ws.co_level\ + psycopg2.sql.SQL("SELECT re.material, re.clear_height, rp.level, ws.co_level\ FROM {schema}.reach re\ LEFT JOIN {schema}.reach_point rp ON rp.obj_id = re.fk_reach_point_from\ LEFT JOIN {schema}.wastewater_networkelement wn ON wn.obj_id = rp.fk_wastewater_networkelement\ LEFT JOIN {schema}.vw_qgep_wastewater_structure ws ON ws.obj_id = wn.fk_wastewater_structure\ - WHERE ws.obj_id = %(obj_id)s" - ).format(schema=psycopg2.sql.Identifier("qgep_od")), + WHERE ws.obj_id = %(obj_id)s").format(schema=psycopg2.sql.Identifier("qgep_od")), {"obj_id": obj_id}, ) row = cur.fetchone()