Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
Marc-André Rivet committed Aug 25, 2020
2 parents a589eca + fed4a91 commit 6bdb53d
Show file tree
Hide file tree
Showing 24 changed files with 614 additions and 472 deletions.
6 changes: 4 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ jobs:
- run:
name: 🔧fix up dash metadata
command: |
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")'
sudo Rscript dashR/tests/circleci/fixup_metadata.R
- run:
name: 🎛 set environment variables
Expand Down Expand Up @@ -287,7 +287,7 @@ jobs:
Rscript -e "message(devtools::check_failures(path = '${DCC_CHECK_DIR}'))"
Rscript -e "message(devtools::check_failures(path = '${DT_CHECK_DIR}'))"
Rscript -e "message(devtools::check_failures(path = '${DASH_CHECK_DIR}'))"
# warnings are errors; enable for stricter checks once CRAN submission finished
# warnings are errors; enabled for stricter CRAN checks, disable if noisy
# if grep -q -R "WARNING" "${DHC_CHECK_DIR}/00check.log"; then exit 1; fi
# if grep -q -R "WARNING" "${DCC_CHECK_DIR}/00check.log"; then exit 1; fi
# if grep -q -R "WARNING" "${DT_CHECK_DIR}/00check.log"; then exit 1; fi
Expand All @@ -296,6 +296,8 @@ jobs:
- run:
name: 🔎 run unit tests
command: |
# unfortunately testthat does not and will not support returning a status
# code other than success, even when tests fail -- this is a workaround
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)}'
- run:
Expand Down
14 changes: 7 additions & 7 deletions @plotly/dash-component-plugins/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions @plotly/dash-generator-test-component-nested/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions @plotly/dash-generator-test-component-standard/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@
All notable changes to `dash` will be documented in this file.
This project adheres to [Semantic Versioning](https://semver.org/).

## [1.15.0] - 2020-08-25
### Added
- [#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)`.
- [#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

### Changed
- [#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.
- [#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.


## [1.14.0] - 2020-07-27
### Added
- [#1343](https://github.com/plotly/dash/pull/1343) Add `title` parameter to set the
Expand Down
4 changes: 2 additions & 2 deletions dash-renderer/dash_renderer/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import sys

__file__
__version__ = "1.6.0"
__version__ = "1.7.0"

_js_dist_dependencies = [
{
Expand Down Expand Up @@ -42,7 +42,7 @@
{
"relative_package_path": "{}.min.js".format(__name__),
"dev_package_path": "{}.dev.js".format(__name__),
"external_url": "https://unpkg.com/dash-renderer@1.6.0"
"external_url": "https://unpkg.com/dash-renderer@1.7.0"
"/dash_renderer/dash_renderer.min.js",
"namespace": "dash_renderer",
},
Expand Down
2 changes: 1 addition & 1 deletion dash-renderer/digest.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@
"MD5 ([email protected])":"a5a4de9578054f7fb44dd553574d0931",
"MD5 ([email protected])":"c0f26206f3dc7a9ec41f1608da1245cc",
"MD5 ([email protected])":"0a82f766cc2d7330a971407e82c4e4a1",
"dash-renderer":"1.6.0"
"dash-renderer":"1.7.0"
}
2 changes: 1 addition & 1 deletion dash-renderer/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions dash-renderer/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "dash-renderer",
"version": "1.6.0",
"version": "1.7.0",
"description": "render dash components in react",
"main": "dash_renderer/dash_renderer.min.js",
"scripts": {
Expand All @@ -14,7 +14,7 @@
"build:js": "webpack --build release",
"build:dev": "webpack --build local",
"build:local": "renderer build local",
"build": "npm run prepublishOnly && renderer build",
"build": "renderer build && npm run prepublishOnly",
"postbuild": "es-check es5 dash_renderer/*.js",
"start": "webpack-serve ./webpack.serve.config.js",
"test": "jest",
Expand Down
95 changes: 50 additions & 45 deletions dash/_validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,73 +2,78 @@
import re

from .development.base_component import Component
from .dependencies import Input, Output, State
from . import exceptions
from ._utils import patch_collections_abc, _strings, stringify_id


def validate_callback(output, inputs, state):
def validate_callback(output, inputs, state, extra_args, types):
is_multi = isinstance(output, (list, tuple))

outputs = output if is_multi else [output]

for args, cls in [(outputs, Output), (inputs, Input), (state, State)]:
validate_callback_args(args, cls)

Input, Output, State = types
if extra_args:
if not isinstance(extra_args[0], (Output, Input, State)):
raise exceptions.IncorrectTypeException(
"""
Callback arguments must be `Output`, `Input`, or `State` objects,
optionally wrapped in a list or tuple. We found (possibly after
unwrapping a list or tuple):
{}
""".format(
repr(extra_args[0])
)
)

def validate_callback_args(args, cls):
name = cls.__name__
if not isinstance(args, (list, tuple)):
raise exceptions.IncorrectTypeException(
"""
The {} argument `{}` must be a list or tuple of
`dash.dependencies.{}`s.
In a callback definition, you must provide all Outputs first,
then all Inputs, then all States. After this item:
{}
we found this item next:
{}
""".format(
name.lower(), str(args), name
repr((outputs + inputs + state)[-1]), repr(extra_args[0])
)
)

for arg in args:
if not isinstance(arg, cls):
raise exceptions.IncorrectTypeException(
"""
The {} argument `{}` must be of type `dash.dependencies.{}`.
""".format(
name.lower(), str(arg), name
)
)
for args in [outputs, inputs, state]:
for arg in args:
validate_callback_arg(arg)

if not isinstance(getattr(arg, "component_property", None), _strings):
raise exceptions.IncorrectTypeException(
"""
component_property must be a string, found {!r}
""".format(
arg.component_property
)
)

if hasattr(arg, "component_event"):
raise exceptions.NonExistentEventException(
"""
Events have been removed.
Use the associated property instead.
"""
def validate_callback_arg(arg):
if not isinstance(getattr(arg, "component_property", None), _strings):
raise exceptions.IncorrectTypeException(
"""
component_property must be a string, found {!r}
""".format(
arg.component_property
)
)

if isinstance(arg.component_id, dict):
validate_id_dict(arg)
if hasattr(arg, "component_event"):
raise exceptions.NonExistentEventException(
"""
Events have been removed.
Use the associated property instead.
"""
)

elif isinstance(arg.component_id, _strings):
validate_id_string(arg)
if isinstance(arg.component_id, dict):
validate_id_dict(arg)

else:
raise exceptions.IncorrectTypeException(
"""
component_id must be a string or dict, found {!r}
""".format(
arg.component_id
)
elif isinstance(arg.component_id, _strings):
validate_id_string(arg)

else:
raise exceptions.IncorrectTypeException(
"""
component_id must be a string or dict, found {!r}
""".format(
arg.component_id
)
)


def validate_id_dict(arg):
Expand Down
Loading

0 comments on commit 6bdb53d

Please sign in to comment.