Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use all python keywords when checking if prop name is valid #450

Merged
merged 4 commits into from
Nov 6, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .circleci/requirements/dev-requirements-py37.txt
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion .circleci/requirements/dev-requirements.txt
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
44 changes: 44 additions & 0 deletions dash/development/_all_keywords.py
Original file line number Diff line number Diff line change
@@ -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'
])
4 changes: 2 additions & 2 deletions dash/development/base_component.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import copy
import os
import inspect
import keyword
from ._all_keywords import kwlist


def is_number(s):
Expand Down Expand Up @@ -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']
)

Expand Down
2 changes: 1 addition & 1 deletion dash/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '0.28.6'
__version__ = '0.28.7'