Skip to content

Commit 6bdb53d

Browse files
author
Marc-André Rivet
committed
Merge remote-tracking branch 'origin/dev'
2 parents a589eca + fed4a91 commit 6bdb53d

File tree

24 files changed

+614
-472
lines changed

24 files changed

+614
-472
lines changed

.circleci/config.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ jobs:
244244
- run:
245245
name: 🔧fix up dash metadata
246246
command: |
247-
sudo Rscript -e 'dash_desc <- read.dcf("dashR/DESCRIPTION"); dt_version <- read.dcf("dash-table/DESCRIPTION")[,"Version"]; dcc_version <- read.dcf("dash-core-components/DESCRIPTION")[,"Version"]; dhc_version <- read.dcf("dash-html-components/DESCRIPTION")[,"Version"]; imports <- dash_desc[,"Imports"][[1]]; imports <- gsub("((?<=dashHtmlComponents )(\\\\(.*?\\\\)))", paste0("(= ", dhc_version, ")"), imports, perl = TRUE); imports <- gsub("((?<=dashCoreComponents )(\\\\(.*?\\\\)))", paste0("(= ", dcc_version, ")"), imports, perl = TRUE); imports <- gsub("((?<=dashTable )(\\\\(.*?\\\\)))", paste0("(= ", dt_version, ")"), imports, perl = TRUE); dash_desc[,"Imports"][[1]] <- imports; dhc_hash <- system("cd dash-html-components; git rev-parse HEAD | tr -d '\''\n'\''", intern=TRUE); dcc_hash <- system("cd dash-core-components; git rev-parse HEAD | tr -d '\''\n'\''", intern=TRUE); dt_hash <- system("cd dash-table; git rev-parse HEAD | tr -d '\''\n'\''", intern=TRUE); remotes <- dash_desc[,"Remotes"][[1]]; remotes <- gsub("((?<=plotly\\\\/dash-html-components@)([a-zA-Z0-9]+))", dhc_hash, remotes, perl=TRUE); remotes <- gsub("((?<=plotly\\\\/dash-core-components@)([a-zA-Z0-9]+))", dcc_hash, remotes, perl=TRUE); remotes <- gsub("((?<=plotly\\\\/dash-table@)([a-zA-Z0-9]+))", dt_hash, remotes, perl=TRUE); dash_desc[,"Remotes"][[1]] <- remotes; write.dcf(dash_desc, "dashR/DESCRIPTION")'
247+
sudo Rscript dashR/tests/circleci/fixup_metadata.R
248248
249249
- run:
250250
name: 🎛 set environment variables
@@ -287,7 +287,7 @@ jobs:
287287
Rscript -e "message(devtools::check_failures(path = '${DCC_CHECK_DIR}'))"
288288
Rscript -e "message(devtools::check_failures(path = '${DT_CHECK_DIR}'))"
289289
Rscript -e "message(devtools::check_failures(path = '${DASH_CHECK_DIR}'))"
290-
# warnings are errors; enable for stricter checks once CRAN submission finished
290+
# warnings are errors; enabled for stricter CRAN checks, disable if noisy
291291
# if grep -q -R "WARNING" "${DHC_CHECK_DIR}/00check.log"; then exit 1; fi
292292
# if grep -q -R "WARNING" "${DCC_CHECK_DIR}/00check.log"; then exit 1; fi
293293
# if grep -q -R "WARNING" "${DT_CHECK_DIR}/00check.log"; then exit 1; fi
@@ -296,6 +296,8 @@ jobs:
296296
- run:
297297
name: 🔎 run unit tests
298298
command: |
299+
# unfortunately testthat does not and will not support returning a status
300+
# code other than success, even when tests fail -- this is a workaround
299301
sudo Rscript -e 'res=devtools::test("dashR/tests/", reporter=default_reporter());df=as.data.frame(res);if(sum(df$failed) > 0 || any(df$error)) {q(status=1)}'
300302
301303
- run:

@plotly/dash-component-plugins/package-lock.json

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

@plotly/dash-generator-test-component-nested/package-lock.json

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

@plotly/dash-generator-test-component-standard/package-lock.json

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,16 @@
22
All notable changes to `dash` will be documented in this file.
33
This project adheres to [Semantic Versioning](https://semver.org/).
44

5+
## [1.15.0] - 2020-08-25
6+
### Added
7+
- [#1355](https://github.com/plotly/dash/pull/1355) Removed redundant log message and consolidated logger initialization. You can now control the log level - for example suppress informational messages from Dash with `app.logger.setLevel(logging.WARNING)`.
8+
- [#1253](https://github.com/plotly/dash/pull/1253), [#1377](https://github.com/plotly/dash/pull/1377) Added experimental `--jl-prefix` option to `dash-generate-components`, optionally generates Julia version of components and corresponding Julia package
9+
10+
### Changed
11+
- [#1180](https://github.com/plotly/dash/pull/1180) and [#1375](https://github.com/plotly/dash/pull/1375) `Input`, `Output`, and `State` in callback definitions don't need to be in lists. You still need to provide `Output` items first, then `Input` items, then `State`, and the list form is still supported. In particular, if you want to return a single output item wrapped in a length-1 list, you should still wrap the `Output` in a list. This can be useful for procedurally-generated callbacks.
12+
- [#1368](https://github.com/plotly/dash/pull/1368) Updated pytest to v6.0.1. To avoid deprecation warnings, this also updated pytest-sugar to 0.9.4 and pytest-mock to 3.2.0. The pytest-mock update only effects python >= 3.0. Pytest-mock remains pinned at 2.0.0 for python == 2.7.
13+
14+
515
## [1.14.0] - 2020-07-27
616
### Added
717
- [#1343](https://github.com/plotly/dash/pull/1343) Add `title` parameter to set the

dash-renderer/dash_renderer/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import sys
22

33
__file__
4-
__version__ = "1.6.0"
4+
__version__ = "1.7.0"
55

66
_js_dist_dependencies = [
77
{
@@ -42,7 +42,7 @@
4242
{
4343
"relative_package_path": "{}.min.js".format(__name__),
4444
"dev_package_path": "{}.dev.js".format(__name__),
45-
"external_url": "https://unpkg.com/dash-renderer@1.6.0"
45+
"external_url": "https://unpkg.com/dash-renderer@1.7.0"
4646
"/dash_renderer/dash_renderer.min.js",
4747
"namespace": "dash_renderer",
4848
},

dash-renderer/digest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@
88
"MD5 (react-dom@16.13.0.min.js)":"a5a4de9578054f7fb44dd553574d0931",
99
"MD5 (react@16.13.0.js)":"c0f26206f3dc7a9ec41f1608da1245cc",
1010
"MD5 (react@16.13.0.min.js)":"0a82f766cc2d7330a971407e82c4e4a1",
11-
"dash-renderer":"1.6.0"
11+
"dash-renderer":"1.7.0"
1212
}

dash-renderer/package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dash-renderer/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "dash-renderer",
3-
"version": "1.6.0",
3+
"version": "1.7.0",
44
"description": "render dash components in react",
55
"main": "dash_renderer/dash_renderer.min.js",
66
"scripts": {
@@ -14,7 +14,7 @@
1414
"build:js": "webpack --build release",
1515
"build:dev": "webpack --build local",
1616
"build:local": "renderer build local",
17-
"build": "npm run prepublishOnly && renderer build",
17+
"build": "renderer build && npm run prepublishOnly",
1818
"postbuild": "es-check es5 dash_renderer/*.js",
1919
"start": "webpack-serve ./webpack.serve.config.js",
2020
"test": "jest",

dash/_validate.py

Lines changed: 50 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -2,73 +2,78 @@
22
import re
33

44
from .development.base_component import Component
5-
from .dependencies import Input, Output, State
65
from . import exceptions
76
from ._utils import patch_collections_abc, _strings, stringify_id
87

98

10-
def validate_callback(output, inputs, state):
9+
def validate_callback(output, inputs, state, extra_args, types):
1110
is_multi = isinstance(output, (list, tuple))
1211

1312
outputs = output if is_multi else [output]
1413

15-
for args, cls in [(outputs, Output), (inputs, Input), (state, State)]:
16-
validate_callback_args(args, cls)
17-
14+
Input, Output, State = types
15+
if extra_args:
16+
if not isinstance(extra_args[0], (Output, Input, State)):
17+
raise exceptions.IncorrectTypeException(
18+
"""
19+
Callback arguments must be `Output`, `Input`, or `State` objects,
20+
optionally wrapped in a list or tuple. We found (possibly after
21+
unwrapping a list or tuple):
22+
{}
23+
""".format(
24+
repr(extra_args[0])
25+
)
26+
)
1827

19-
def validate_callback_args(args, cls):
20-
name = cls.__name__
21-
if not isinstance(args, (list, tuple)):
2228
raise exceptions.IncorrectTypeException(
2329
"""
24-
The {} argument `{}` must be a list or tuple of
25-
`dash.dependencies.{}`s.
30+
In a callback definition, you must provide all Outputs first,
31+
then all Inputs, then all States. After this item:
32+
{}
33+
we found this item next:
34+
{}
2635
""".format(
27-
name.lower(), str(args), name
36+
repr((outputs + inputs + state)[-1]), repr(extra_args[0])
2837
)
2938
)
3039

31-
for arg in args:
32-
if not isinstance(arg, cls):
33-
raise exceptions.IncorrectTypeException(
34-
"""
35-
The {} argument `{}` must be of type `dash.dependencies.{}`.
36-
""".format(
37-
name.lower(), str(arg), name
38-
)
39-
)
40+
for args in [outputs, inputs, state]:
41+
for arg in args:
42+
validate_callback_arg(arg)
4043

41-
if not isinstance(getattr(arg, "component_property", None), _strings):
42-
raise exceptions.IncorrectTypeException(
43-
"""
44-
component_property must be a string, found {!r}
45-
""".format(
46-
arg.component_property
47-
)
48-
)
4944

50-
if hasattr(arg, "component_event"):
51-
raise exceptions.NonExistentEventException(
52-
"""
53-
Events have been removed.
54-
Use the associated property instead.
55-
"""
45+
def validate_callback_arg(arg):
46+
if not isinstance(getattr(arg, "component_property", None), _strings):
47+
raise exceptions.IncorrectTypeException(
48+
"""
49+
component_property must be a string, found {!r}
50+
""".format(
51+
arg.component_property
5652
)
53+
)
5754

58-
if isinstance(arg.component_id, dict):
59-
validate_id_dict(arg)
55+
if hasattr(arg, "component_event"):
56+
raise exceptions.NonExistentEventException(
57+
"""
58+
Events have been removed.
59+
Use the associated property instead.
60+
"""
61+
)
6062

61-
elif isinstance(arg.component_id, _strings):
62-
validate_id_string(arg)
63+
if isinstance(arg.component_id, dict):
64+
validate_id_dict(arg)
6365

64-
else:
65-
raise exceptions.IncorrectTypeException(
66-
"""
67-
component_id must be a string or dict, found {!r}
68-
""".format(
69-
arg.component_id
70-
)
66+
elif isinstance(arg.component_id, _strings):
67+
validate_id_string(arg)
68+
69+
else:
70+
raise exceptions.IncorrectTypeException(
71+
"""
72+
component_id must be a string or dict, found {!r}
73+
""".format(
74+
arg.component_id
7175
)
76+
)
7277

7378

7479
def validate_id_dict(arg):

0 commit comments

Comments
 (0)