From dc67c0366298fb1fe1487ab9b4bc5a07e41df070 Mon Sep 17 00:00:00 2001 From: Jeremy Hooke Date: Thu, 7 Mar 2024 11:21:06 +1100 Subject: [PATCH] Bump pre-commit versions --- .pre-commit-config.yaml | 2 +- eodatasets3/assemble.py | 3 +-- eodatasets3/names.py | 3 +-- eodatasets3/scripts/recompress.py | 1 + .../integration/prepare/test_prepare_sentinel_l1.py | 6 +++--- tests/integration/test_naming_conventions.py | 12 ++++++------ versioneer.py | 1 - 7 files changed, 13 insertions(+), 15 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index bdb86ac9..05f86ae1 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -5,7 +5,7 @@ exclude: tests/integration/data repos: # Normalise all Python code. (Black + isort + pyupgrade + autoflake) - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.2.2 + rev: v0.3.1 hooks: - id: ruff args: [--fix, --show-fixes, --output-format, grouped] diff --git a/eodatasets3/assemble.py b/eodatasets3/assemble.py index 13bd741f..727184c5 100644 --- a/eodatasets3/assemble.py +++ b/eodatasets3/assemble.py @@ -464,8 +464,7 @@ def __init__( def __enter__(self) -> "DatasetPrepare": return self - def __exit__(self, exc_type, exc_val, exc_tb): - ... + def __exit__(self, exc_type, exc_val, exc_tb): ... @property def collection_location(self) -> Path: diff --git a/eodatasets3/names.py b/eodatasets3/names.py index 6646f7f8..59d225d8 100644 --- a/eodatasets3/names.py +++ b/eodatasets3/names.py @@ -334,8 +334,7 @@ def __get__(self, c: "NamingConventions", owner) -> str: return f"{c.collection_prefix}/{offset}/" -class MissingRequiredFieldsError(ValueError): - ... +class MissingRequiredFieldsError(ValueError): ... class RequiredPropertyDict(Eo3Dict): diff --git a/eodatasets3/scripts/recompress.py b/eodatasets3/scripts/recompress.py index 9e44835c..be713f87 100755 --- a/eodatasets3/scripts/recompress.py +++ b/eodatasets3/scripts/recompress.py @@ -7,6 +7,7 @@ We compress the inner tiffs and store them in an uncompressed tar. This allows random reads within the files. We also append a checksum file at the end of the tar. """ + import copy import io import socket diff --git a/tests/integration/prepare/test_prepare_sentinel_l1.py b/tests/integration/prepare/test_prepare_sentinel_l1.py index 2404f63f..dc8073d3 100644 --- a/tests/integration/prepare/test_prepare_sentinel_l1.py +++ b/tests/integration/prepare/test_prepare_sentinel_l1.py @@ -448,9 +448,9 @@ def test_filter_folder_structure_info( # Our output metadata is in a different place than the data, so we expect it to # embed the true location in the metadata (by default) if input_dataset_path.is_dir(): - expected_metadata_doc[ - "location" - ] = f"file://{input_dataset_path.as_posix()}/tileInfo.json" + expected_metadata_doc["location"] = ( + f"file://{input_dataset_path.as_posix()}/tileInfo.json" + ) else: expected_metadata_doc["location"] = f"zip:{input_dataset_path}!/" diff --git a/tests/integration/test_naming_conventions.py b/tests/integration/test_naming_conventions.py index 2db29789..e557eabe 100644 --- a/tests/integration/test_naming_conventions.py +++ b/tests/integration/test_naming_conventions.py @@ -110,9 +110,9 @@ def test_minimal_s2_dataset_normal(tmp_path: Path): p.datetime = datetime(2018, 11, 4) p.product_family = "blueberries" p.processed = "2018-11-05T12:23:23" - p.properties[ - "sentinel:sentinel_tile_id" - ] = "S2A_OPER_MSI_L1C_TL_SGS__20170822T015626_A011310_T54KYU_N02.05" + p.properties["sentinel:sentinel_tile_id"] = ( + "S2A_OPER_MSI_L1C_TL_SGS__20170822T015626_A011310_T54KYU_N02.05" + ) dataset_id, metadata_path = p.done() @@ -139,9 +139,9 @@ def test_s2_naming_conventions(tmp_path: Path): p.dataset_version = "1.0.0" p.region_code = "Oz" p.properties["odc:file_format"] = "GeoTIFF" - p.properties[ - "sentinel:sentinel_tile_id" - ] = "S2A_OPER_MSI_L1C_TL_SGS__20170822T015626_A011310_T54KYU_N02.05" + p.properties["sentinel:sentinel_tile_id"] = ( + "S2A_OPER_MSI_L1C_TL_SGS__20170822T015626_A011310_T54KYU_N02.05" + ) p.note_source_datasets( "telemetry", diff --git a/versioneer.py b/versioneer.py index d1839109..f54f836e 100644 --- a/versioneer.py +++ b/versioneer.py @@ -275,7 +275,6 @@ """ - try: import configparser except ImportError: