diff --git a/CHANGELOG.md b/CHANGELOG.md index fcf11203b8..d7e80c7eff 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,8 @@ -## 0.31.0 - 2018-11-26 +## 0.31.1 - 2018-11-29 +## Fixed +- Fix `_imports_.py` indentation generation. [#473](https://github.com/plotly/dash/pull/473/files) + +## 0.31.0 - 2018-11-29 ## Added - Combined `extract-meta` and python component files generation in a cli [#451](https://github.com/plotly/dash/pull/451) diff --git a/dash/development/_py_components_generation.py b/dash/development/_py_components_generation.py index ba17ccd84d..a5d9a4e05e 100644 --- a/dash/development/_py_components_generation.py +++ b/dash/development/_py_components_generation.py @@ -1,7 +1,6 @@ import collections import copy import os -import textwrap from dash.development.base_component import _explicitize_args from ._all_keywords import kwlist @@ -167,19 +166,14 @@ def generate_class_file(typename, props, description, namespace): def generate_imports(project_shortname, components): with open(os.path.join(project_shortname, '_imports_.py'), 'w') as f: - f.write(textwrap.dedent( - ''' - {} - - __all__ = [ - {} - ] - '''.format( - '\n'.join( - 'from .{0} import {0}'.format(x) for x in components), - ',\n'.join(' "{}"'.format(x) for x in components) - ) - ).lstrip()) + imports_string = '{}\n\n{}'.format( + '\n'.join( + 'from .{0} import {0}'.format(x) for x in components), + '__all__ = [\n{}\n]'.format( + ',\n'.join(' "{}"'.format(x) for x in components)) + ) + + f.write(imports_string) def generate_classes_files(project_shortname, metadata, *component_generators): diff --git a/dash/version.py b/dash/version.py index c3d10d7c49..74f9490deb 100644 --- a/dash/version.py +++ b/dash/version.py @@ -1 +1 @@ -__version__ = '0.31.0' +__version__ = '0.31.1'