From e45132de7832088c3ab462a41a7dba5b72d0e22e Mon Sep 17 00:00:00 2001 From: Merel Theisen Date: Tue, 29 Mar 2022 13:30:52 +0100 Subject: [PATCH 1/3] Pin black to higher version to solve click complaints Signed-off-by: Merel Theisen --- .../{{ cookiecutter.repo_name }}/src/requirements.txt | 2 +- .../project/{{ cookiecutter.repo_name }}/src/requirements.txt | 2 +- test_requirements.txt | 2 +- tests/extras/datasets/geojson/test_geojson_dataset.py | 4 ++-- tests/extras/datasets/holoviews/test_holoviews_writer.py | 4 ++-- tests/extras/datasets/matplotlib/test_matplotlib_writer.py | 4 ++-- tests/extras/datasets/networkx/test_gml_dataset.py | 4 ++-- tests/extras/datasets/networkx/test_graphml_dataset.py | 4 ++-- tests/extras/datasets/networkx/test_json_dataset.py | 4 ++-- tests/extras/datasets/pandas/test_csv_dataset.py | 4 ++-- tests/extras/datasets/pandas/test_excel_dataset.py | 4 ++-- tests/extras/datasets/pandas/test_feather_dataset.py | 4 ++-- tests/extras/datasets/pandas/test_generic_dataset.py | 4 ++-- tests/extras/datasets/pandas/test_hdf_dataset.py | 4 ++-- tests/extras/datasets/pandas/test_json_dataset.py | 4 ++-- tests/extras/datasets/pandas/test_parquet_dataset.py | 4 ++-- tests/extras/datasets/pandas/test_xml_dataset.py | 4 ++-- tests/extras/datasets/pickle/test_pickle_dataset.py | 4 ++-- tests/extras/datasets/pillow/test_image_dataset.py | 4 ++-- tests/extras/datasets/text/test_text_dataset.py | 4 ++-- tests/extras/datasets/yaml/test_yaml_dataset.py | 4 ++-- tests/runner/test_parallel_runner.py | 4 ++-- 22 files changed, 41 insertions(+), 41 deletions(-) diff --git a/features/steps/test_starter/{{ cookiecutter.repo_name }}/src/requirements.txt b/features/steps/test_starter/{{ cookiecutter.repo_name }}/src/requirements.txt index 0a101e2ead..e638df692e 100644 --- a/features/steps/test_starter/{{ cookiecutter.repo_name }}/src/requirements.txt +++ b/features/steps/test_starter/{{ cookiecutter.repo_name }}/src/requirements.txt @@ -1,4 +1,4 @@ -black~=22.0 +black>=22.3.0 flake8>=3.7.9, <4.0 ipython>=7.31.1, <8.0 isort~=5.0 diff --git a/kedro/templates/project/{{ cookiecutter.repo_name }}/src/requirements.txt b/kedro/templates/project/{{ cookiecutter.repo_name }}/src/requirements.txt index 0d9383e238..884c311ee8 100644 --- a/kedro/templates/project/{{ cookiecutter.repo_name }}/src/requirements.txt +++ b/kedro/templates/project/{{ cookiecutter.repo_name }}/src/requirements.txt @@ -1,4 +1,4 @@ -black~=22.0 +black>=22.3.0 flake8>=3.7.9, <4.0 ipython~=7.10 ipython>=7.31.1, <8.0 diff --git a/test_requirements.txt b/test_requirements.txt index e850b2948c..a3a55930ab 100644 --- a/test_requirements.txt +++ b/test_requirements.txt @@ -3,7 +3,7 @@ adlfs>=2021.7.1, <=2022.2 bandit>=1.6.2, <2.0 behave==1.2.6 biopython~=1.73 -black==21.5b1 +black>=22.3.0 blacken-docs==1.9.2 compress-pickle[lz4]~=1.2.0 coverage[toml] diff --git a/tests/extras/datasets/geojson/test_geojson_dataset.py b/tests/extras/datasets/geojson/test_geojson_dataset.py index baed65152a..5d8b5f286e 100644 --- a/tests/extras/datasets/geojson/test_geojson_dataset.py +++ b/tests/extras/datasets/geojson/test_geojson_dataset.py @@ -197,8 +197,8 @@ def test_save_version_warning( """Check the warning when saving to the path that differs from the subsequent load path.""" pattern = ( - fr"Save version `{save_version}` did not match load version " - fr"`{load_version}` for GeoJSONDataSet\(.+\)" + rf"Save version `{save_version}` did not match load version " + rf"`{load_version}` for GeoJSONDataSet\(.+\)" ) with pytest.warns(UserWarning, match=pattern): versioned_geojson_data_set.save(dummy_dataframe) diff --git a/tests/extras/datasets/holoviews/test_holoviews_writer.py b/tests/extras/datasets/holoviews/test_holoviews_writer.py index d100ae788e..bf1f17f00f 100644 --- a/tests/extras/datasets/holoviews/test_holoviews_writer.py +++ b/tests/extras/datasets/holoviews/test_holoviews_writer.py @@ -160,8 +160,8 @@ def test_save_version_warning( """Check the warning when saving to the path that differs from the subsequent load path.""" pattern = ( - fr"Save version `{save_version}` did not match load version " - fr"`{load_version}` for HoloviewsWriter\(.+\)" + rf"Save version `{save_version}` did not match load version " + rf"`{load_version}` for HoloviewsWriter\(.+\)" ) with pytest.warns(UserWarning, match=pattern): versioned_hv_writer.save(dummy_hv_object) diff --git a/tests/extras/datasets/matplotlib/test_matplotlib_writer.py b/tests/extras/datasets/matplotlib/test_matplotlib_writer.py index 2680506240..7b9b988db8 100644 --- a/tests/extras/datasets/matplotlib/test_matplotlib_writer.py +++ b/tests/extras/datasets/matplotlib/test_matplotlib_writer.py @@ -310,8 +310,8 @@ def test_save_version_warning( """Check the warning when saving to the path that differs from the subsequent load path.""" pattern = ( - fr"Save version `{save_version}` did not match load version " - fr"`{load_version}` for MatplotlibWriter\(.+\)" + rf"Save version `{save_version}` did not match load version " + rf"`{load_version}` for MatplotlibWriter\(.+\)" ) with pytest.warns(UserWarning, match=pattern): versioned_plot_writer.save(mock_single_plot) diff --git a/tests/extras/datasets/networkx/test_gml_dataset.py b/tests/extras/datasets/networkx/test_gml_dataset.py index a35fe90ab8..47baf7e346 100644 --- a/tests/extras/datasets/networkx/test_gml_dataset.py +++ b/tests/extras/datasets/networkx/test_gml_dataset.py @@ -170,8 +170,8 @@ def test_save_version_warning( """Check the warning when saving to the path that differs from the subsequent load path.""" pattern = ( - fr"Save version `{save_version}` did not match " - fr"load version `{load_version}` for GMLDataSet\(.+\)" + rf"Save version `{save_version}` did not match " + rf"load version `{load_version}` for GMLDataSet\(.+\)" ) with pytest.warns(UserWarning, match=pattern): versioned_gml_data_set.save(dummy_graph_data) diff --git a/tests/extras/datasets/networkx/test_graphml_dataset.py b/tests/extras/datasets/networkx/test_graphml_dataset.py index 7c72f46395..e46616cba0 100644 --- a/tests/extras/datasets/networkx/test_graphml_dataset.py +++ b/tests/extras/datasets/networkx/test_graphml_dataset.py @@ -170,8 +170,8 @@ def test_save_version_warning( """Check the warning when saving to the path that differs from the subsequent load path.""" pattern = ( - fr"Save version `{save_version}` did not match " - fr"load version `{load_version}` for GraphMLDataSet\(.+\)" + rf"Save version `{save_version}` did not match " + rf"load version `{load_version}` for GraphMLDataSet\(.+\)" ) with pytest.warns(UserWarning, match=pattern): versioned_graphml_data_set.save(dummy_graph_data) diff --git a/tests/extras/datasets/networkx/test_json_dataset.py b/tests/extras/datasets/networkx/test_json_dataset.py index c89d7caaba..76acf8f22e 100644 --- a/tests/extras/datasets/networkx/test_json_dataset.py +++ b/tests/extras/datasets/networkx/test_json_dataset.py @@ -180,8 +180,8 @@ def test_save_version_warning( """Check the warning when saving to the path that differs from the subsequent load path.""" pattern = ( - fr"Save version `{save_version}` did not match load version " - fr"`{load_version}` for JSONDataSet\(.+\)" + rf"Save version `{save_version}` did not match load version " + rf"`{load_version}` for JSONDataSet\(.+\)" ) with pytest.warns(UserWarning, match=pattern): versioned_json_data_set.save(dummy_graph_data) diff --git a/tests/extras/datasets/pandas/test_csv_dataset.py b/tests/extras/datasets/pandas/test_csv_dataset.py index 4d057549f3..5942378287 100644 --- a/tests/extras/datasets/pandas/test_csv_dataset.py +++ b/tests/extras/datasets/pandas/test_csv_dataset.py @@ -265,8 +265,8 @@ def test_save_version_warning( """Check the warning when saving to the path that differs from the subsequent load path.""" pattern = ( - fr"Save version `{save_version}` did not match load version " - fr"`{load_version}` for CSVDataSet\(.+\)" + rf"Save version `{save_version}` did not match load version " + rf"`{load_version}` for CSVDataSet\(.+\)" ) with pytest.warns(UserWarning, match=pattern): versioned_csv_data_set.save(dummy_dataframe) diff --git a/tests/extras/datasets/pandas/test_excel_dataset.py b/tests/extras/datasets/pandas/test_excel_dataset.py index 9cdc1842d9..3408fc9c7c 100644 --- a/tests/extras/datasets/pandas/test_excel_dataset.py +++ b/tests/extras/datasets/pandas/test_excel_dataset.py @@ -246,8 +246,8 @@ def test_save_version_warning( """Check the warning when saving to the path that differs from the subsequent load path.""" pattern = ( - fr"Save version `{save_version}` did not match load version " - fr"`{load_version}` for ExcelDataSet\(.+\)" + rf"Save version `{save_version}` did not match load version " + rf"`{load_version}` for ExcelDataSet\(.+\)" ) with pytest.warns(UserWarning, match=pattern): versioned_excel_data_set.save(dummy_dataframe) diff --git a/tests/extras/datasets/pandas/test_feather_dataset.py b/tests/extras/datasets/pandas/test_feather_dataset.py index 6d4376fc93..0e6bb685e4 100644 --- a/tests/extras/datasets/pandas/test_feather_dataset.py +++ b/tests/extras/datasets/pandas/test_feather_dataset.py @@ -185,8 +185,8 @@ def test_save_version_warning( """Check the warning when saving to the path that differs from the subsequent load path.""" pattern = ( - fr"Save version `{save_version}` did not match load version " - fr"`{load_version}` for FeatherDataSet\(.+\)" + rf"Save version `{save_version}` did not match load version " + rf"`{load_version}` for FeatherDataSet\(.+\)" ) with pytest.warns(UserWarning, match=pattern): versioned_feather_data_set.save(dummy_dataframe) diff --git a/tests/extras/datasets/pandas/test_generic_dataset.py b/tests/extras/datasets/pandas/test_generic_dataset.py index b5e8236a7c..f1603fd55a 100644 --- a/tests/extras/datasets/pandas/test_generic_dataset.py +++ b/tests/extras/datasets/pandas/test_generic_dataset.py @@ -302,8 +302,8 @@ def test_save_version_warning( """Check the warning when saving to the path that differs from the subsequent load path.""" pattern = ( - fr"Save version `{save_version}` did not match load version " - fr"`{load_version}` for GenericDataSet\(.+\)" + rf"Save version `{save_version}` did not match load version " + rf"`{load_version}` for GenericDataSet\(.+\)" ) with pytest.warns(UserWarning, match=pattern): versioned_csv_data_set.save(dummy_dataframe) diff --git a/tests/extras/datasets/pandas/test_hdf_dataset.py b/tests/extras/datasets/pandas/test_hdf_dataset.py index dd6e258fa2..9413894ba0 100644 --- a/tests/extras/datasets/pandas/test_hdf_dataset.py +++ b/tests/extras/datasets/pandas/test_hdf_dataset.py @@ -205,8 +205,8 @@ def test_save_version_warning( """Check the warning when saving to the path that differs from the subsequent load path.""" pattern = ( - fr"Save version `{save_version}` did not match load version " - fr"`{load_version}` for HDFDataSet\(.+\)" + rf"Save version `{save_version}` did not match load version " + rf"`{load_version}` for HDFDataSet\(.+\)" ) with pytest.warns(UserWarning, match=pattern): versioned_hdf_data_set.save(dummy_dataframe) diff --git a/tests/extras/datasets/pandas/test_json_dataset.py b/tests/extras/datasets/pandas/test_json_dataset.py index 520d3ab6e1..6a740195d0 100644 --- a/tests/extras/datasets/pandas/test_json_dataset.py +++ b/tests/extras/datasets/pandas/test_json_dataset.py @@ -206,8 +206,8 @@ def test_save_version_warning( """Check the warning when saving to the path that differs from the subsequent load path.""" pattern = ( - fr"Save version `{save_version}` did not match load version " - fr"`{load_version}` for JSONDataSet\(.+\)" + rf"Save version `{save_version}` did not match load version " + rf"`{load_version}` for JSONDataSet\(.+\)" ) with pytest.warns(UserWarning, match=pattern): versioned_json_data_set.save(dummy_dataframe) diff --git a/tests/extras/datasets/pandas/test_parquet_dataset.py b/tests/extras/datasets/pandas/test_parquet_dataset.py index ff5f2eccd3..29930f00aa 100644 --- a/tests/extras/datasets/pandas/test_parquet_dataset.py +++ b/tests/extras/datasets/pandas/test_parquet_dataset.py @@ -305,8 +305,8 @@ def test_save_version_warning( """Check the warning when saving to the path that differs from the subsequent load path.""" pattern = ( - fr"Save version `{save_version}` did not match load version " - fr"`{load_version}` for ParquetDataSet\(.+\)" + rf"Save version `{save_version}` did not match load version " + rf"`{load_version}` for ParquetDataSet\(.+\)" ) mocker.patch( "pyarrow.fs._ensure_filesystem", diff --git a/tests/extras/datasets/pandas/test_xml_dataset.py b/tests/extras/datasets/pandas/test_xml_dataset.py index 5c4f0f3031..894b672571 100644 --- a/tests/extras/datasets/pandas/test_xml_dataset.py +++ b/tests/extras/datasets/pandas/test_xml_dataset.py @@ -234,8 +234,8 @@ def test_save_version_warning( """Check the warning when saving to the path that differs from the subsequent load path.""" pattern = ( - fr"Save version `{save_version}` did not match " - fr"load version `{load_version}` for XMLDataSet\(.+\)" + rf"Save version `{save_version}` did not match " + rf"load version `{load_version}` for XMLDataSet\(.+\)" ) with pytest.warns(UserWarning, match=pattern): versioned_xml_data_set.save(dummy_dataframe) diff --git a/tests/extras/datasets/pickle/test_pickle_dataset.py b/tests/extras/datasets/pickle/test_pickle_dataset.py index b345fd1fbd..6c9f793735 100644 --- a/tests/extras/datasets/pickle/test_pickle_dataset.py +++ b/tests/extras/datasets/pickle/test_pickle_dataset.py @@ -229,8 +229,8 @@ def test_save_version_warning( """Check the warning when saving to the path that differs from the subsequent load path.""" pattern = ( - fr"Save version `{save_version}` did not match load version " - fr"`{load_version}` for PickleDataSet\(.+\)" + rf"Save version `{save_version}` did not match load version " + rf"`{load_version}` for PickleDataSet\(.+\)" ) with pytest.warns(UserWarning, match=pattern): versioned_pickle_data_set.save(dummy_dataframe) diff --git a/tests/extras/datasets/pillow/test_image_dataset.py b/tests/extras/datasets/pillow/test_image_dataset.py index 8f804c9aa9..b4eae92b49 100644 --- a/tests/extras/datasets/pillow/test_image_dataset.py +++ b/tests/extras/datasets/pillow/test_image_dataset.py @@ -196,8 +196,8 @@ def test_save_version_warning( """Check the warning when saving to the path that differs from the subsequent load path.""" pattern = ( - fr"Save version `{save_version}` did not match load version " - fr"`{load_version}` for ImageDataSet\(.+\)" + rf"Save version `{save_version}` did not match load version " + rf"`{load_version}` for ImageDataSet\(.+\)" ) with pytest.warns(UserWarning, match=pattern): versioned_image_dataset.save(image_object) diff --git a/tests/extras/datasets/text/test_text_dataset.py b/tests/extras/datasets/text/test_text_dataset.py index 7d9285f046..842e9ba746 100644 --- a/tests/extras/datasets/text/test_text_dataset.py +++ b/tests/extras/datasets/text/test_text_dataset.py @@ -150,8 +150,8 @@ def test_save_version_warning( """Check the warning when saving to the path that differs from the subsequent load path.""" pattern = ( - fr"Save version `{save_version}` did not match load version " - fr"`{load_version}` for TextDataSet\(.+\)" + rf"Save version `{save_version}` did not match load version " + rf"`{load_version}` for TextDataSet\(.+\)" ) with pytest.warns(UserWarning, match=pattern): versioned_txt_data_set.save(STRING) diff --git a/tests/extras/datasets/yaml/test_yaml_dataset.py b/tests/extras/datasets/yaml/test_yaml_dataset.py index 03428a3802..8cf520d65e 100644 --- a/tests/extras/datasets/yaml/test_yaml_dataset.py +++ b/tests/extras/datasets/yaml/test_yaml_dataset.py @@ -175,8 +175,8 @@ def test_save_version_warning( """Check the warning when saving to the path that differs from the subsequent load path.""" pattern = ( - fr"Save version `{save_version}` did not match load version " - fr"`{load_version}` for YAMLDataSet\(.+\)" + rf"Save version `{save_version}` did not match load version " + rf"`{load_version}` for YAMLDataSet\(.+\)" ) with pytest.warns(UserWarning, match=pattern): versioned_yaml_data_set.save(dummy_data) diff --git a/tests/runner/test_parallel_runner.py b/tests/runner/test_parallel_runner.py index bc7f4549fd..42deb4ef52 100644 --- a/tests/runner/test_parallel_runner.py +++ b/tests/runner/test_parallel_runner.py @@ -176,8 +176,8 @@ def test_memory_dataset_not_serializable(self, is_async, catalog, hook_manager): pipeline = Pipeline([node(return_not_serializable, "A", "B")]) catalog.add_feed_dict(feed_dict=dict(A=42)) pattern = ( - fr"{str(data.__class__)} cannot be serialized. ParallelRunner implicit " - fr"memory datasets can only be used with serializable data" + rf"{str(data.__class__)} cannot be serialized. ParallelRunner implicit " + rf"memory datasets can only be used with serializable data" ) with pytest.raises(DataSetError, match=pattern): From 00610743da039e6d0d6c0a82073c418e6ebf9d20 Mon Sep 17 00:00:00 2001 From: Merel Theisen <49397448+MerelTheisenQB@users.noreply.github.com> Date: Tue, 29 Mar 2022 15:17:31 +0200 Subject: [PATCH 2/3] Apply suggestions from code review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Lorena Bălan --- .../{{ cookiecutter.repo_name }}/src/requirements.txt | 2 +- .../project/{{ cookiecutter.repo_name }}/src/requirements.txt | 2 +- test_requirements.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/features/steps/test_starter/{{ cookiecutter.repo_name }}/src/requirements.txt b/features/steps/test_starter/{{ cookiecutter.repo_name }}/src/requirements.txt index e638df692e..b474fe143d 100644 --- a/features/steps/test_starter/{{ cookiecutter.repo_name }}/src/requirements.txt +++ b/features/steps/test_starter/{{ cookiecutter.repo_name }}/src/requirements.txt @@ -1,4 +1,4 @@ -black>=22.3.0 +black>=22.3.0, <23.0 flake8>=3.7.9, <4.0 ipython>=7.31.1, <8.0 isort~=5.0 diff --git a/kedro/templates/project/{{ cookiecutter.repo_name }}/src/requirements.txt b/kedro/templates/project/{{ cookiecutter.repo_name }}/src/requirements.txt index 884c311ee8..dc4008b32c 100644 --- a/kedro/templates/project/{{ cookiecutter.repo_name }}/src/requirements.txt +++ b/kedro/templates/project/{{ cookiecutter.repo_name }}/src/requirements.txt @@ -1,4 +1,4 @@ -black>=22.3.0 +black>=22.3.0, <23.0 flake8>=3.7.9, <4.0 ipython~=7.10 ipython>=7.31.1, <8.0 diff --git a/test_requirements.txt b/test_requirements.txt index a3a55930ab..e8c00a6c1e 100644 --- a/test_requirements.txt +++ b/test_requirements.txt @@ -3,7 +3,7 @@ adlfs>=2021.7.1, <=2022.2 bandit>=1.6.2, <2.0 behave==1.2.6 biopython~=1.73 -black>=22.3.0 +black>=22.3.0, <23.0 blacken-docs==1.9.2 compress-pickle[lz4]~=1.2.0 coverage[toml] From 7c25e09a7ed8a1b894ba2becfd5809357368c639 Mon Sep 17 00:00:00 2001 From: Merel Theisen Date: Tue, 29 Mar 2022 15:00:48 +0100 Subject: [PATCH 3/3] Revert + only pin test_reqs Signed-off-by: Merel Theisen --- .../{{ cookiecutter.repo_name }}/src/requirements.txt | 2 +- .../project/{{ cookiecutter.repo_name }}/src/requirements.txt | 2 +- test_requirements.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/features/steps/test_starter/{{ cookiecutter.repo_name }}/src/requirements.txt b/features/steps/test_starter/{{ cookiecutter.repo_name }}/src/requirements.txt index b474fe143d..0a101e2ead 100644 --- a/features/steps/test_starter/{{ cookiecutter.repo_name }}/src/requirements.txt +++ b/features/steps/test_starter/{{ cookiecutter.repo_name }}/src/requirements.txt @@ -1,4 +1,4 @@ -black>=22.3.0, <23.0 +black~=22.0 flake8>=3.7.9, <4.0 ipython>=7.31.1, <8.0 isort~=5.0 diff --git a/kedro/templates/project/{{ cookiecutter.repo_name }}/src/requirements.txt b/kedro/templates/project/{{ cookiecutter.repo_name }}/src/requirements.txt index dc4008b32c..0d9383e238 100644 --- a/kedro/templates/project/{{ cookiecutter.repo_name }}/src/requirements.txt +++ b/kedro/templates/project/{{ cookiecutter.repo_name }}/src/requirements.txt @@ -1,4 +1,4 @@ -black>=22.3.0, <23.0 +black~=22.0 flake8>=3.7.9, <4.0 ipython~=7.10 ipython>=7.31.1, <8.0 diff --git a/test_requirements.txt b/test_requirements.txt index e8c00a6c1e..d80baa18cc 100644 --- a/test_requirements.txt +++ b/test_requirements.txt @@ -3,8 +3,8 @@ adlfs>=2021.7.1, <=2022.2 bandit>=1.6.2, <2.0 behave==1.2.6 biopython~=1.73 -black>=22.3.0, <23.0 blacken-docs==1.9.2 +black~=22.0 compress-pickle[lz4]~=1.2.0 coverage[toml] dask[complete]~=2021.10 # pinned by Snyk to avoid a vulnerability