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/.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] 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()