Skip to content

Commit 6c4bbe7

Browse files
committed
Merge remote-tracking branch 'origin/dev' into pr4218
# Conflicts: # CHANGELOG.md
2 parents f748b05 + c223096 commit 6c4bbe7

4 files changed

Lines changed: 39 additions & 1 deletion

File tree

‎CHANGELOG.md‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ This project adheres to [Semantic Versioning](https://semver.org/).
55
## [UNRELEASED]
66

77
### Fixed
8-
- [#4218](https://github.com/plotly/dash/pull/4218) Fix `pages_folder` written with `/` on Windows, such as `pages_folder="src/pages"`: page modules were named `src/pages.home` and their inferred paths kept the folder (`/src/pages/home` instead of `/home`). Fixes [#4217](https://github.com/plotly/dash/issues/4217).
8+
- [#4218](https://github.com/plotly/dash/pull/4218) Fix `pages_folder` written with `/` on Windows, such as `"src/pages"`, giving wrong page module names and paths. Fixes [#4217](https://github.com/plotly/dash/issues/4217).
9+
- [#4220](https://github.com/plotly/dash/pull/4220) Fix the `DASH_VALIDATE_CALLBACKS` environment variable being ignored, although `Dash.run` and `Dash.enable_dev_tools` document it for `dev_tools_validate_callbacks`. Fixes [#4219](https://github.com/plotly/dash/issues/4219).
910

1011
## [4.5.2] - 2026-11-27
1112

‎dash/_configs.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ def load_dash_env_vars():
3232
"DASH_SILENCE_ROUTES_LOGGING",
3333
"DASH_DISABLE_VERSION_CHECK",
3434
"DASH_PRUNE_ERRORS",
35+
"DASH_VALIDATE_CALLBACKS",
3536
"DASH_COMPRESS",
3637
"DASH_MCP_ENABLED",
3738
"DASH_MCP_PATH",

‎tests/integration/devtools/test_callback_validation.py‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -917,3 +917,14 @@ def c(_):
917917
wait.until(lambda: ~dash_duo.redux_state_is_loading, 2)
918918
dash_duo.wait_for_no_elements(dash_duo.devtools_error_count_locator)
919919
assert dash_duo.get_logs() == []
920+
921+
922+
def test_validate_callbacks_env_var_reaches_page_config(empty_environ, monkeypatch):
923+
monkeypatch.setenv("DASH_VALIDATE_CALLBACKS", "false")
924+
app = Dash(__name__)
925+
app.layout = html.Div()
926+
app.enable_dev_tools(debug=True, dev_tools_hot_reload=False)
927+
928+
page = app.server.test_client().get("/").get_data(as_text=True)
929+
930+
assert re.search(r'"validate_callbacks": ?false', page)

‎tests/unit/test_configs.py‎

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -493,6 +493,31 @@ def test_debug_mode_enable_dev_tools(empty_environ, debug_env, debug, expected):
493493
assert app._dev_tools.ui == expected
494494

495495

496+
@pytest.mark.parametrize(
497+
"validate_callbacks_env, debug, validate_callbacks, expected",
498+
[
499+
("false", True, None, False),
500+
("true", False, None, True),
501+
("true", True, False, False),
502+
(None, True, None, True),
503+
(None, False, None, False),
504+
],
505+
)
506+
def test_validate_callbacks_enable_dev_tools(
507+
empty_environ,
508+
monkeypatch,
509+
validate_callbacks_env,
510+
debug,
511+
validate_callbacks,
512+
expected,
513+
):
514+
if validate_callbacks_env:
515+
monkeypatch.setenv("DASH_VALIDATE_CALLBACKS", validate_callbacks_env)
516+
app = Dash()
517+
app.enable_dev_tools(debug=debug, dev_tools_validate_callbacks=validate_callbacks)
518+
assert app._dev_tools.validate_callbacks == expected
519+
520+
496521
def test_missing_flask_compress_raises():
497522
with pytest.raises(ImportError):
498523
Dash(compress=True)

0 commit comments

Comments
 (0)