From 903879b447aba51febfd086a2ae4d681c3a4c35f Mon Sep 17 00:00:00 2001 From: Ryan Marren Date: Mon, 5 Nov 2018 18:55:30 -0500 Subject: [PATCH 1/4] Add set of all python keywords. --- dash/development/_all_keywords.py | 44 +++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 dash/development/_all_keywords.py diff --git a/dash/development/_all_keywords.py b/dash/development/_all_keywords.py new file mode 100644 index 0000000000..76842b56af --- /dev/null +++ b/dash/development/_all_keywords.py @@ -0,0 +1,44 @@ +# This is a set of Python keywords that cannot be used as prop names. +# Keywords for a particular version are obtained as follows: +# >>> import keyword +# >>> keyword.kwlist + +kwlist = set([ + 'and', + 'elif', + 'is', + 'global', + 'as', + 'in', + 'if', + 'from', + 'raise', + 'for', + 'except', + 'nonlocal', + 'pass', + 'finally', + 'print', + 'import', + 'True', + 'None', + 'return', + 'exec', + 'await', + 'else', + 'break', + 'not', + 'with', + 'class', + 'assert', + 'False', + 'yield', + 'try', + 'while', + 'continue', + 'del', + 'async', + 'or', + 'def', + 'lambda' +]) From 115307cd2cfc5424e7cda2816ec8f44a38e6227d Mon Sep 17 00:00:00 2001 From: Ryan Marren Date: Mon, 5 Nov 2018 18:55:51 -0500 Subject: [PATCH 2/4] Change base_component to use full keyword list rather than version specific. --- dash/development/base_component.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dash/development/base_component.py b/dash/development/base_component.py index c4998be300..44c95521ce 100644 --- a/dash/development/base_component.py +++ b/dash/development/base_component.py @@ -2,7 +2,7 @@ import copy import os import inspect -import keyword +from ._all_keywords import kwlist def is_number(s): @@ -380,7 +380,7 @@ def __repr__(self): '{:s}=Component.UNDEFINED'.format(p)) for p in prop_keys if not p.endswith("-*") and - p not in keyword.kwlist and + p not in kwlist and p not in ['dashEvents', 'fireEvent', 'setProps']] + ['**kwargs'] ) From 0c0dfbfa47b53d5a07ac67852d066f5ac3df248e Mon Sep 17 00:00:00 2001 From: Ryan Marren Date: Mon, 5 Nov 2018 19:18:53 -0500 Subject: [PATCH 3/4] Bump changelog, version. --- CHANGELOG.md | 4 ++++ dash/version.py | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 75d4c36f01..530c0c7a87 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.28.7 - 2018-11-05 +## Fixed +- Component generation now uses the same prop name black list in all supported Python versions. Closes [#361](https://github.com/plotly/dash/issues/361). [#450](https://github.com/plotly/dash/pull/450) + ## 0.28.6 - 2018-11-05 ## Fixed - `Dash.registered_paths` changed to a `collections.defaultdict(set)`, was appending the same package paths on every index. [#443](https://github.com/plotly/dash/pull/443) diff --git a/dash/version.py b/dash/version.py index b0897f0bfd..b9becf56e0 100644 --- a/dash/version.py +++ b/dash/version.py @@ -1 +1 @@ -__version__ = '0.28.6' +__version__ = '0.28.7' From 06f848f95233cdbca36f8f4a5bd7b4a3d13aa24b Mon Sep 17 00:00:00 2001 From: Ryan Marren Date: Mon, 5 Nov 2018 19:43:56 -0500 Subject: [PATCH 4/4] Try lock `dash-core-components==0.35.1` --- .circleci/requirements/dev-requirements-py37.txt | 2 +- .circleci/requirements/dev-requirements.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/requirements/dev-requirements-py37.txt b/.circleci/requirements/dev-requirements-py37.txt index e35c666ff1..1f59ed10b4 100644 --- a/.circleci/requirements/dev-requirements-py37.txt +++ b/.circleci/requirements/dev-requirements-py37.txt @@ -1,4 +1,4 @@ -dash_core_components>=0.35.1 +dash_core_components==0.35.1 dash_html_components==0.12.0rc3 dash-flow-example==0.0.3 dash-dangerously-set-inner-html diff --git a/.circleci/requirements/dev-requirements.txt b/.circleci/requirements/dev-requirements.txt index c80469a4f4..dd09b07796 100644 --- a/.circleci/requirements/dev-requirements.txt +++ b/.circleci/requirements/dev-requirements.txt @@ -1,4 +1,4 @@ -dash_core_components>=0.35.1 +dash_core_components==0.35.1 dash_html_components>=0.12.0rc3 dash_flow_example==0.0.3 dash-dangerously-set-inner-html