diff --git a/.github/workflows/code_checks.yml b/.github/workflows/code_checks.yml index 9a7dde6dfe14..bfe50532422a 100644 --- a/.github/workflows/code_checks.yml +++ b/.github/workflows/code_checks.yml @@ -116,7 +116,7 @@ jobs: run: python3 ./scripts/check_binaries.py linting: - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 - uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0 @@ -135,16 +135,16 @@ jobs: make doxygen_check_warnings other_checks: - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: - name: Checkout uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 - name: Install Requirements run: | - sudo apt install python3-pip wget - # ruamel.yaml.clib 0.2.9 throws a 'TypeError: a string or stream input is required' when running cffconvert --validate - sudo pip3 install cffconvert "ruamel.yaml.clib<0.2.9" + sudo apt-get install -y --no-install-recommends python3-pip + sudo apt-get remove -y python3-jsonschema + PYTHON_CMD=python3 && sudo $PYTHON_CMD -m pip install --break-system-packages cffconvert - name: Validate citation file run: | diff --git a/autotest/gcore/vsiaz.py b/autotest/gcore/vsiaz.py index d2b094453148..f632c40ac744 100755 --- a/autotest/gcore/vsiaz.py +++ b/autotest/gcore/vsiaz.py @@ -471,7 +471,7 @@ def test_vsiaz_fake_readdir_protection_again_infinite_looping(): a_dir with_space/ - bla{i+1} + bla{i + 1} """, ) diff --git a/autotest/pymod/ogrtest.py b/autotest/pymod/ogrtest.py index fae366bc013e..6277d53cc82b 100755 --- a/autotest/pymod/ogrtest.py +++ b/autotest/pymod/ogrtest.py @@ -196,7 +196,7 @@ def check_feature_geometry( assert actual_pt == pytest.approx( expected_pt, abs=max_error - ), f"Error in vertex {i+1}/{count} exceeds tolerance. {context_msg}\n Expected: {_root_expected.ExportToWkt()}\n Actual: {_root_actual.ExportToWkt()}" + ), f"Error in vertex {i + 1}/{count} exceeds tolerance. {context_msg}\n Expected: {_root_expected.ExportToWkt()}\n Actual: {_root_actual.ExportToWkt()}" ############################################################################### diff --git a/swig/python/gdal-utils/osgeo_utils/auxiliary/gdal_argparse.py b/swig/python/gdal-utils/osgeo_utils/auxiliary/gdal_argparse.py index dbc4d23521a5..edfa36fb3fb3 100644 --- a/swig/python/gdal-utils/osgeo_utils/auxiliary/gdal_argparse.py +++ b/swig/python/gdal-utils/osgeo_utils/auxiliary/gdal_argparse.py @@ -44,7 +44,8 @@ def __init__( else: if formatter_class is None: formatter_class = argparse.RawDescriptionHelpFormatter - description = f'{title}\n{"-"*(2+len(title))}\n{description}' + number_dashes = 2 + len(title) + description = f'{title}\n{"-" * number_dashes}\n{description}' if formatter_class is None: formatter_class = argparse.HelpFormatter @@ -227,7 +228,7 @@ def get_epilog(self): prog = os.path.basename(sys.argv[0]) example_list = [] for idx, (title, args) in enumerate(self.examples): - example_list.append(f"example #{idx+1}: {title}\n{prog} {args}") + example_list.append(f"example #{idx + 1}: {title}\n{prog} {args}") epilog = "\n\n".join(example_list) if self.epilog: epilog = epilog + "\n\n" + self.epilog