From 1b78f592db41c16d6a5451f1f172e5bbeabe4ca5 Mon Sep 17 00:00:00 2001 From: Alex Johnson Date: Thu, 10 Dec 2020 10:22:12 -0500 Subject: [PATCH] Merge pull request #169 from plotly/import-test improve dash import test --- packages/dash-html-components/CHANGELOG.md | 6 +++++- .../dash_html_components_base/__init__.py | 15 +++------------ 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/packages/dash-html-components/CHANGELOG.md b/packages/dash-html-components/CHANGELOG.md index c930ae9e34..09b604b154 100644 --- a/packages/dash-html-components/CHANGELOG.md +++ b/packages/dash-html-components/CHANGELOG.md @@ -2,8 +2,12 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/). +## [UNRELEASED] +### Fixed +- [#169](https://github.com/plotly/dash-html-components/pull/169) - part of fixing dash import bug https://github.com/plotly/dash/issues/1143 + ## [1.1.1] - 2020-09-03 --Dash.jl Julia component generation +- Dash.jl Julia component generation ## [1.1.0] - 2020-08-25 ### Added diff --git a/packages/dash-html-components/dash_html_components_base/__init__.py b/packages/dash-html-components/dash_html_components_base/__init__.py index 81ee397b85..c9eef231a0 100644 --- a/packages/dash-html-components/dash_html_components_base/__init__.py +++ b/packages/dash-html-components/dash_html_components_base/__init__.py @@ -16,18 +16,9 @@ __version__ = package['version'] # Module imports trigger a dash.development import, need to check this first -if not hasattr(_dash, 'development'): - print( - "Dash was not successfully imported. Make sure you don't have a file " - "named \n'dash.py' in your current directory.", file=_sys.stderr) - _sys.exit(1) - -# Must update to dash>=0.22.0 to use this version of dash-html-components -if not hasattr(_dash.development.base_component, '_explicitize_args'): - print("Please update the `dash` module to >= 0.22.0 to use this " - "version of dash_html_components.\n" - "You are using version {:s}".format(_dash.version.__version__), - file=_sys.stderr) +if not hasattr(_dash, '__plotly_dash') and not hasattr(_dash, 'development'): + print("Dash was not successfully imported. Make sure you don't have a file " + "named \n'dash.py' in your current directory.", file=_sys.stderr) _sys.exit(1)