From b3577786828b102cba8db7de328ef0aa9a9d0d3c Mon Sep 17 00:00:00 2001 From: Ziga Luksic Date: Fri, 27 Sep 2024 10:17:54 +0200 Subject: [PATCH] update precommit --- .pre-commit-config.yaml | 6 +++--- eogrow/utils/testing.py | 2 +- pyproject.toml | 2 +- tests/core/area/test_batch.py | 2 +- tests/pipelines/test_byoc.py | 2 +- tests/pipelines/test_download.py | 2 +- tests/pipelines/test_import_vector.py | 2 +- tests/pipelines/test_merge_samples.py | 2 +- tests/pipelines/test_rasterize.py | 4 ++-- tests/pipelines/test_testing.py | 2 +- tests/tasks/test_testing.py | 2 +- tests/test_cli.py | 2 +- 12 files changed, 15 insertions(+), 15 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 5d1e3263..7537f259 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -20,18 +20,18 @@ repos: types_or: [json] - repo: https://github.com/psf/black - rev: 24.4.2 + rev: 24.8.0 hooks: - id: black language_version: python3 - repo: https://github.com/charliermarsh/ruff-pre-commit - rev: "v0.4.9" + rev: "v0.6.8" hooks: - id: ruff - repo: https://github.com/nbQA-dev/nbQA - rev: 1.8.5 + rev: 1.8.7 hooks: - id: nbqa-black - id: nbqa-ruff diff --git a/eogrow/utils/testing.py b/eogrow/utils/testing.py index 98f3241e..459c84fa 100644 --- a/eogrow/utils/testing.py +++ b/eogrow/utils/testing.py @@ -355,7 +355,7 @@ def compare_content( stats_path: str, *, config: StatCalcConfig | None = None, - save_new_stats: bool = True, + save_new_stats: bool = False, ) -> None: """Compares the results from a pipeline run with the saved statistics. Constructed to be coupled with `run_config` hence the `Optional` input. diff --git a/pyproject.toml b/pyproject.toml index 0e9feb6c..84799a5e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -165,7 +165,7 @@ lint.ignore = [ "PT011", # complains for `pytest.raises(ValueError)` but we use it a lot ] lint.per-file-ignores = { "__init__.py" = ["F401"] } -exclude = [".git", "__pycache__", "build", "dist"] +exclude = [".git", "__pycache__", "build", "dist", "*.ipynb"] [tool.ruff.lint.isort] diff --git a/tests/core/area/test_batch.py b/tests/core/area/test_batch.py index 2c49a073..9d668b91 100644 --- a/tests/core/area/test_batch.py +++ b/tests/core/area/test_batch.py @@ -80,7 +80,7 @@ def test_no_batch_id_error(storage, area_config): manager.get_grid() -@pytest.mark.integration() +@pytest.mark.integration @pytest.mark.usefixtures("configured_requests_mock") def test_grid(storage, area_config): manager = BatchAreaManager.from_raw_config(area_config, storage) diff --git a/tests/pipelines/test_byoc.py b/tests/pipelines/test_byoc.py index c73e9081..3775f13b 100644 --- a/tests/pipelines/test_byoc.py +++ b/tests/pipelines/test_byoc.py @@ -70,7 +70,7 @@ def _get_tile_cover_geometry_mock(_: str) -> Geometry: return pipeline, relevant_requests -@pytest.mark.chain() +@pytest.mark.chain @pytest.mark.parametrize(("preparation_config", "config"), [("prepare_lulc_data", "ingest_lulc")]) @pytest.mark.order(after=["test_rasterize.py::test_rasterize_feature_with_resolution"]) def test_timeless_byoc(config_and_stats_paths, preparation_config, config, configured_requests_mock): diff --git a/tests/pipelines/test_download.py b/tests/pipelines/test_download.py index 91dfd813..ba8c1f90 100644 --- a/tests/pipelines/test_download.py +++ b/tests/pipelines/test_download.py @@ -5,7 +5,7 @@ pytestmark = pytest.mark.integration -@pytest.mark.chain() +@pytest.mark.chain @pytest.mark.order(before=["test_download_pipeline"]) @pytest.mark.usefixtures("storage") def test_preparation(): diff --git a/tests/pipelines/test_import_vector.py b/tests/pipelines/test_import_vector.py index 105de353..160d375f 100644 --- a/tests/pipelines/test_import_vector.py +++ b/tests/pipelines/test_import_vector.py @@ -5,7 +5,7 @@ pytestmark = pytest.mark.integration -@pytest.mark.chain() +@pytest.mark.chain @pytest.mark.parametrize("experiment_name", ["import_vector", "import_vector_temporal"]) def test_import_vector_pipeline(config_and_stats_paths, experiment_name): config_path, stats_path = config_and_stats_paths("import_vector", experiment_name) diff --git a/tests/pipelines/test_merge_samples.py b/tests/pipelines/test_merge_samples.py index 66f69c1c..b8fe5a6e 100644 --- a/tests/pipelines/test_merge_samples.py +++ b/tests/pipelines/test_merge_samples.py @@ -5,7 +5,7 @@ pytestmark = pytest.mark.integration -@pytest.mark.chain() +@pytest.mark.chain @pytest.mark.order(after="test_features.py::test_features_pipeline") def test_merge_samples_pipeline(config_and_stats_paths): config_path, stats_path = config_and_stats_paths("merge_samples", "merge_features_samples") diff --git a/tests/pipelines/test_rasterize.py b/tests/pipelines/test_rasterize.py index 57081bb9..2263f236 100644 --- a/tests/pipelines/test_rasterize.py +++ b/tests/pipelines/test_rasterize.py @@ -12,7 +12,7 @@ def test_rasterize_file(config_and_stats_paths, experiment_name): compare_content(output_path, stats_path) -@pytest.mark.chain() +@pytest.mark.chain @pytest.mark.order(before="test_rasterize_feature_with_resolution") @pytest.mark.parametrize(("preparation_config", "config"), [("load_crops_vector_data", "rasterize_feature_with_shape")]) def test_rasterize_feature_with_shape(config_and_stats_paths, preparation_config, config): @@ -24,7 +24,7 @@ def test_rasterize_feature_with_shape(config_and_stats_paths, preparation_config compare_content(output_path, stats_path) -@pytest.mark.chain() +@pytest.mark.chain @pytest.mark.parametrize( ("preparation_config", "config"), [("load_lulc_vector_data", "rasterize_feature_with_resolution")] ) diff --git a/tests/pipelines/test_testing.py b/tests/pipelines/test_testing.py index 4ce75f18..aae6a1db 100644 --- a/tests/pipelines/test_testing.py +++ b/tests/pipelines/test_testing.py @@ -5,7 +5,7 @@ pytestmark = pytest.mark.integration -@pytest.mark.chain() +@pytest.mark.chain @pytest.mark.parametrize("experiment_name", ["testing", "timestamps_only"]) def test_data_generating_pipeline(config_and_stats_paths, experiment_name): config_path, stats_path = config_and_stats_paths("testing", experiment_name) diff --git a/tests/tasks/test_testing.py b/tests/tasks/test_testing.py index 72c3e0d0..b4ba4bc6 100644 --- a/tests/tasks/test_testing.py +++ b/tests/tasks/test_testing.py @@ -16,7 +16,7 @@ ) -@pytest.fixture() +@pytest.fixture def dummy_eopatch() -> EOPatch: return EOPatch(bbox=BBox((0, 0, 1, 1), CRS.POP_WEB)) diff --git a/tests/test_cli.py b/tests/test_cli.py index 443d503b..e2a5c337 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -26,7 +26,7 @@ def test_pipeline_chain_validation(config_folder): assert subprocess.call(f"eogrow-validate {config_folder}/chain_pipeline.json", shell=True) == 0 -@pytest.mark.integration() +@pytest.mark.integration @pytest.mark.order(after="tests/pipelines/test_zipmap.py::test_zipmap_pipeline") def test_pipeline_chain_execution(config_folder): """Tests a simple execution from command line"""