diff --git a/pyproject.toml b/pyproject.toml index 9d92dc4f9..438db43d7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -68,23 +68,9 @@ select = [ "C4", # flake8-comprehensions "RUF", # Ruff-specific rules "PL", # pylint - "UP" # pyupgrade + "UP" # pyupgrade ] - -# future imports -# trailing comma -# other ruff rules -# search Optional, Union - -[tool.ruff.lint.pyupgrade] -# need to use future annotations sometimes at least -# enable keep-runtime-typing true -# don't convert any Union or Optional -# Preserve types, even if a file imports `from __future__ import annotations`. -keep-runtime-typing = true - - [tool.ruff.lint.per-file-ignores] # Tests can use magic values, assertions, and relative imports, ignore missing docstrings, # compare to empty string @@ -97,3 +83,10 @@ convention = "google" [tool.ruff.lint.pylint] max-args = 6 + +[tool.ruff.lint.pyupgrade] +# need to use future annotations sometimes at least +# enable keep-runtime-typing true +# don't convert any Union or Optional +# Preserve types, even if a file imports `from __future__ import annotations`. +keep-runtime-typing = true diff --git a/vizro-ai/src/vizro_ai/dashboard/_response_models/df_info.py b/vizro-ai/src/vizro_ai/dashboard/_response_models/df_info.py index c9ce5b817..1dd203564 100644 --- a/vizro-ai/src/vizro_ai/dashboard/_response_models/df_info.py +++ b/vizro-ai/src/vizro_ai/dashboard/_response_models/df_info.py @@ -1,6 +1,5 @@ """Data Summary Node.""" - import pandas as pd try: diff --git a/vizro-ai/src/vizro_ai/utils/helper.py b/vizro-ai/src/vizro_ai/utils/helper.py index edc381b3b..74061ca9a 100644 --- a/vizro-ai/src/vizro_ai/utils/helper.py +++ b/vizro-ai/src/vizro_ai/utils/helper.py @@ -1,6 +1,5 @@ """Helper Functions For Vizro AI.""" - import pandas as pd diff --git a/vizro-ai/tests/integration/test_example.py b/vizro-ai/tests/integration/test_example.py index 7d1f3b5bc..e18bfa4fc 100644 --- a/vizro-ai/tests/integration/test_example.py +++ b/vizro-ai/tests/integration/test_example.py @@ -1,4 +1,3 @@ - import vizro.plotly.express as px from hamcrest import any_of, assert_that, contains_string, is_not, matches_regexp diff --git a/vizro-core/examples/visual-vocabulary/custom_charts.py b/vizro-core/examples/visual-vocabulary/custom_charts.py index 6d4eb12b1..4dd62d514 100644 --- a/vizro-core/examples/visual-vocabulary/custom_charts.py +++ b/vizro-core/examples/visual-vocabulary/custom_charts.py @@ -1,6 +1,5 @@ """Contains custom charts used inside the dashboard.""" - import pandas as pd import vizro.plotly.express as px from plotly import graph_objects as go diff --git a/vizro-core/examples/visual-vocabulary/pages/examples/sankey.py b/vizro-core/examples/visual-vocabulary/pages/examples/sankey.py index 07419aa0b..c96c927e5 100644 --- a/vizro-core/examples/visual-vocabulary/pages/examples/sankey.py +++ b/vizro-core/examples/visual-vocabulary/pages/examples/sankey.py @@ -1,4 +1,3 @@ - import pandas as pd import plotly.graph_objects as go import vizro.models as vm diff --git a/vizro-core/examples/visual-vocabulary/pages/examples/waterfall.py b/vizro-core/examples/visual-vocabulary/pages/examples/waterfall.py index a42ced313..e5d4c029e 100644 --- a/vizro-core/examples/visual-vocabulary/pages/examples/waterfall.py +++ b/vizro-core/examples/visual-vocabulary/pages/examples/waterfall.py @@ -1,4 +1,3 @@ - import pandas as pd import plotly.graph_objects as go import vizro.models as vm diff --git a/vizro-core/tests/tests_utils/demo_asserts.py b/vizro-core/tests/tests_utils/demo_asserts.py index 21f3aca54..1a7dd22d7 100644 --- a/vizro-core/tests/tests_utils/demo_asserts.py +++ b/vizro-core/tests/tests_utils/demo_asserts.py @@ -1,6 +1,5 @@ """Demo to show how to use asserts. These are not real tests that are run as part of testing, just a teaching aid.""" - from asserts import STRIP_ALL, assert_component_equal from dash import html