diff --git a/.lintstagedrc.js b/.lintstagedrc.js index fd701b086a..e4449e59cd 100644 --- a/.lintstagedrc.js +++ b/.lintstagedrc.js @@ -26,10 +26,18 @@ const sh_cd = (directory, command) => { module.exports = { // Python checks (run from root, using root venv) - "*.py": (filenames) => [ + "dash/*.py": (filenames) => [ `${venvBin("python")} -m pylint --rcfile=.pylintrc ${filenames.join( " " - )}`, // Add your pylintrc if you have one + )}`, + `${venvBin("flake8")} ${filenames.join(" ")}`, + `${venvBin("black")} --check ${filenames.join(" ")}`, + ], + + "**/tests/**/*.py": (filenames) => [ + `${venvBin("python")} -m pylint -d all -e C0410,C0413,W0109 --rcfile=.pylintrc ${filenames.join( + " " + )}`, `${venvBin("flake8")} ${filenames.join(" ")}`, `${venvBin("black")} --check ${filenames.join(" ")}`, ], diff --git a/components/dash-core-components/tests/integration/calendar/test_date_picker_single.py b/components/dash-core-components/tests/integration/calendar/test_date_picker_single.py index f1e38a05b8..d13194511f 100644 --- a/components/dash-core-components/tests/integration/calendar/test_date_picker_single.py +++ b/components/dash-core-components/tests/integration/calendar/test_date_picker_single.py @@ -3,7 +3,6 @@ import time import pytest -import werkzeug from dash import Dash, Input, Output, html, dcc, no_update @@ -75,11 +74,6 @@ def test_dtps010_local_and_session_persistence(dash_dcc): assert dash_dcc.get_logs() == [] -@pytest.mark.xfail( - condition=werkzeug.__version__ in ("2.1.0", "2.1.1"), - reason="Bug with 204 and Transfer-Encoding", - strict=False, -) def test_dtps011_memory_persistence(dash_dcc): app = Dash(__name__) app.layout = html.Div( diff --git a/components/dash-core-components/tests/integration/graph/test_graph_varia.py b/components/dash-core-components/tests/integration/graph/test_graph_varia.py index 582c211aa7..92481ee811 100644 --- a/components/dash-core-components/tests/integration/graph/test_graph_varia.py +++ b/components/dash-core-components/tests/integration/graph/test_graph_varia.py @@ -3,7 +3,6 @@ import time import json -import werkzeug from selenium.webdriver import ActionChains from dash import Dash, Input, Output, State, dcc, html @@ -229,10 +228,6 @@ def assert_graph_equals(browser, graph_id, graph_data): assert y == expected_y -@pytest.mark.skipif( - werkzeug.__version__ in ("2.1.0", "2.1.1"), - reason="Bug with no_update 204 responses get Transfer-Encoding header.", -) @pytest.mark.parametrize("is_eager", [True, False]) def test_grva004_graph_prepend_trace(dash_dcc, is_eager): app = Dash(__name__, eager_loading=is_eager) @@ -380,10 +375,6 @@ def trace_will_prepend_with_max_points(n_intervals): assert dash_dcc.get_logs() == [] -@pytest.mark.skipif( - werkzeug.__version__ in ("2.1.0", "2.1.1"), - reason="Bug with no_update 204 responses get Transfer-Encoding header.", -) @pytest.mark.parametrize("is_eager", [True, False]) def test_grva005_graph_extend_trace(dash_dcc, is_eager): app = Dash(__name__, eager_loading=is_eager) diff --git a/components/dash-core-components/tests/integration/store/test_data_lifecycle.py b/components/dash-core-components/tests/integration/store/test_data_lifecycle.py index cec4a9857a..e3d5d7da17 100644 --- a/components/dash-core-components/tests/integration/store/test_data_lifecycle.py +++ b/components/dash-core-components/tests/integration/store/test_data_lifecycle.py @@ -1,14 +1,6 @@ -import pytest -import werkzeug - import dash.testing.wait as wait -@pytest.mark.xfail( - condition=werkzeug.__version__ in ("2.1.0", "2.1.1"), - reason="Bug with 204 and Transfer-Encoding", - strict=False, -) def test_stdl001_data_lifecycle_with_different_condition(store_app, dash_dcc): dash_dcc.start_server(store_app) diff --git a/components/dash-core-components/tests/integration/tab/test_tabs_with_graphs.py b/components/dash-core-components/tests/integration/tab/test_tabs_with_graphs.py index 3be3ae0992..48b085850d 100644 --- a/components/dash-core-components/tests/integration/tab/test_tabs_with_graphs.py +++ b/components/dash-core-components/tests/integration/tab/test_tabs_with_graphs.py @@ -1,5 +1,3 @@ -import werkzeug - from dash import Dash, Input, Output, dcc, html from dash.exceptions import PreventUpdate import json @@ -117,11 +115,6 @@ def render_content(tab): assert dash_dcc.get_logs() == [] -@pytest.mark.xfail( - condition=werkzeug.__version__ in ("2.1.0", "2.1.1"), - reason="Bug with 204 and Transfer-Encoding", - strict=False, -) @pytest.mark.parametrize("is_eager", [True, False]) def test_tagr002_tabs_render_without_selected(dash_dcc, is_eager): app = Dash(__name__, eager_loading=is_eager) diff --git a/requirements/install.txt b/requirements/install.txt index 65fccc279d..df0e1299e3 100644 --- a/requirements/install.txt +++ b/requirements/install.txt @@ -1,5 +1,5 @@ -Flask>=1.0.4,<3.1 -Werkzeug<3.1 +Flask>=1.0.4,<3.2 +Werkzeug<3.2 plotly>=5.0.0 importlib-metadata typing_extensions>=4.1.1 diff --git a/tests/integration/callbacks/test_basic_callback.py b/tests/integration/callbacks/test_basic_callback.py index d22e1c3e00..72af7d3cac 100644 --- a/tests/integration/callbacks/test_basic_callback.py +++ b/tests/integration/callbacks/test_basic_callback.py @@ -5,7 +5,6 @@ import time import numpy as np -import werkzeug from dash_test_components import ( AsyncComponent, @@ -305,11 +304,6 @@ def set_out(opts): dash_duo.select_dcc_dropdown("#dd", "opt{}".format(i)) -@pytest.mark.xfail( - condition=werkzeug.__version__ in ("2.1.0", "2.1.1"), - reason="Bug with 204 and Transfer-Encoding", - strict=False, -) @pytest.mark.parametrize("refresh", [False, True]) def test_cbsc007_parallel_updates(refresh, dash_duo): # This is a funny case, that seems to mostly happen with dcc.Location