diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 72627f160..6cde84fc1 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -43,19 +43,19 @@ repos: - id: prettier - repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks - rev: v2.13.0 + rev: v2.14.0 hooks: - id: pretty-format-toml args: [--autofix] - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.5.0 + rev: v0.5.6 hooks: - id: ruff args: [--fix, --exit-non-zero-on-fix] - repo: https://github.com/psf/black - rev: 24.4.2 + rev: 24.8.0 hooks: - id: black @@ -67,6 +67,9 @@ repos: additional_dependencies: ["bandit[toml]"] - repo: https://github.com/pre-commit/mirrors-mypy + # Upgrade to v1.11.1 not possible as it doesn't seem compatible with pydantic<2 plugin. + # Similar issue with previous v.1.11.X versions: https://github.com/pydantic/pydantic/issues/10000 + # We need to revert the changes from the pre-commit autoupdate for now. rev: v1.10.1 hooks: - id: mypy @@ -103,7 +106,7 @@ repos: args: ["--fix"] - repo: https://github.com/errata-ai/vale - rev: v3.6.0 + rev: v3.7.0 hooks: - id: vale args: [--config=.vale/.vale.ini] diff --git a/vizro-ai/changelog.d/20240807_113745_huong_li_nguyen_pre_commit_ci_update_config.md b/vizro-ai/changelog.d/20240807_113745_huong_li_nguyen_pre_commit_ci_update_config.md new file mode 100644 index 000000000..f1f65e73c --- /dev/null +++ b/vizro-ai/changelog.d/20240807_113745_huong_li_nguyen_pre_commit_ci_update_config.md @@ -0,0 +1,48 @@ + + + + + + + + + diff --git a/vizro-ai/src/vizro_ai/_vizro_ai.py b/vizro-ai/src/vizro_ai/_vizro_ai.py index 61e2dc48b..0c3362b52 100644 --- a/vizro-ai/src/vizro_ai/_vizro_ai.py +++ b/vizro-ai/src/vizro_ai/_vizro_ai.py @@ -120,7 +120,7 @@ def _get_chart_code(self, df: pd.DataFrame, user_input: str) -> str: # TODO retained for some chat application integration, need deprecation handling return self._run_plot_tasks(df, user_input, explain=False).code - def plot( # pylint: disable=too-many-arguments # noqa: PLR0913 + def plot( self, df: pd.DataFrame, user_input: str, diff --git a/vizro-ai/src/vizro_ai/chains/_llm_chain.py b/vizro-ai/src/vizro_ai/chains/_llm_chain.py index 48cf30946..1d24be4e8 100644 --- a/vizro-ai/src/vizro_ai/chains/_llm_chain.py +++ b/vizro-ai/src/vizro_ai/chains/_llm_chain.py @@ -35,7 +35,7 @@ def execute_chain(self, input_str: str): class FunctionCallChain(VizroBaseChain, ABC): """LLM Chain with Function Calling.""" - def __init__( # noqa: PLR0913 + def __init__( self, llm: BaseChatModel, raw_prompt: str, diff --git a/vizro-ai/src/vizro_ai/utils/helper.py b/vizro-ai/src/vizro_ai/utils/helper.py index 48fe03638..71bf59a9e 100644 --- a/vizro-ai/src/vizro_ai/utils/helper.py +++ b/vizro-ai/src/vizro_ai/utils/helper.py @@ -103,7 +103,6 @@ def _display_markdown(code_snippet: str, biz_insights: str, code_explain: str) - """ try: - # pylint: disable=import-outside-toplevel from IPython.display import Markdown, display except Exception as exc: raise ImportError("Please install IPython before proceeding in jupyter environment.") from exc diff --git a/vizro-ai/tests/unit/vizro-ai/plot/components/test_visual_code.py b/vizro-ai/tests/unit/vizro-ai/plot/components/test_visual_code.py index e6bc021b8..088cb291d 100644 --- a/vizro-ai/tests/unit/vizro-ai/plot/components/test_visual_code.py +++ b/vizro-ai/tests/unit/vizro-ai/plot/components/test_visual_code.py @@ -114,7 +114,7 @@ def test_instantiation(self): def setup_method(self, fake_llm): self.get_visual_code = GetVisualCode(llm=fake_llm) - def test_pre_process(self, chart_type, input_df, df_code_1, df_schema, df_sample): # noqa: PLR0913 + def test_pre_process(self, chart_type, input_df, df_code_1, df_schema, df_sample): _, partial_vars = self.get_visual_code._pre_process(chart_type=chart_type, df_code=df_code_1, df=input_df) assert partial_vars == { "chart_type": chart_type, diff --git a/vizro-core/changelog.d/20240807_113733_huong_li_nguyen_pre_commit_ci_update_config.md b/vizro-core/changelog.d/20240807_113733_huong_li_nguyen_pre_commit_ci_update_config.md new file mode 100644 index 000000000..f1f65e73c --- /dev/null +++ b/vizro-core/changelog.d/20240807_113733_huong_li_nguyen_pre_commit_ci_update_config.md @@ -0,0 +1,48 @@ + + + + + + + + + diff --git a/vizro-core/tests/unit/vizro/actions/_action_loop/test_get_action_loop_components.py b/vizro-core/tests/unit/vizro/actions/_action_loop/test_get_action_loop_components.py index 8713536db..f27f38abc 100644 --- a/vizro-core/tests/unit/vizro/actions/_action_loop/test_get_action_loop_components.py +++ b/vizro-core/tests/unit/vizro/actions/_action_loop/test_get_action_loop_components.py @@ -141,7 +141,7 @@ def test_no_components(self): ], indirect=True, ) - def test_all_action_loop_components( # pylint: disable=too-many-arguments # noqa: PLR0913 + def test_all_action_loop_components( self, fundamental_components, gateway_components, diff --git a/vizro-core/tests/unit/vizro/models/_action/test_action.py b/vizro-core/tests/unit/vizro/models/_action/test_action.py index f42a63542..bc2a0b5e4 100644 --- a/vizro-core/tests/unit/vizro/models/_action/test_action.py +++ b/vizro-core/tests/unit/vizro/models/_action/test_action.py @@ -193,7 +193,7 @@ def test_get_callback_mapping_no_inputs_no_outputs(self, identity_action_functio ), ], ) - def test_get_callback_mapping_with_inputs_and_outputs( # pylint: disable=too-many-arguments + def test_get_callback_mapping_with_inputs_and_outputs( self, inputs_and_outputs, identity_action_function,