diff --git a/README.md b/README.md index 711c13babe48d4f6285047e7605190beed3f6d0b..aee77c9c2c47fbb122f558b76c819424edb3c338 100644 --- a/README.md +++ b/README.md @@ -90,8 +90,7 @@ Taking a very simple example inspired by the excellent [getting started](https:/ ```python import dash -import dash_core_components as dcc -import dash_html_components as html +from dash import dcc, html from django_plotly_dash import DjangoDash diff --git a/demo/demo/assets/image_two.png b/demo/demo/assets/image_two.png new file mode 100644 index 0000000000000000000000000000000000000000..6b839e88512e88de381b09ea0f0fc6072e2c42a9 Binary files /dev/null and b/demo/demo/assets/image_two.png differ diff --git a/demo/demo/dash_apps.py b/demo/demo/dash_apps.py index f569f262bb87a98bb1cf3ce52b801dcecc106b18..94a6e6be08d3e0542f8439d1418adfd2fa803c77 100644 --- a/demo/demo/dash_apps.py +++ b/demo/demo/dash_apps.py @@ -7,8 +7,7 @@ TODO attribution here #pylint: disable=no-member import dash -import dash_core_components as dcc -import dash_html_components as html +from dash import dcc, html import plotly.graph_objs as go #import dpd_components as dpd import numpy as np diff --git a/demo/demo/plotly_apps.py b/demo/demo/plotly_apps.py index 4e880990db964609e5275a8e393301cf87b7550e..917cf6e949b5354ddd5d0eae4fcf13462832f4ac 100644 --- a/demo/demo/plotly_apps.py +++ b/demo/demo/plotly_apps.py @@ -34,9 +34,8 @@ import pandas as pd from django.core.cache import cache import dash +from dash import dcc, html from dash.dependencies import MATCH, ALL -import dash_core_components as dcc -import dash_html_components as html import plotly.graph_objs as go diff --git a/demo/demo/settings.py b/demo/demo/settings.py index 1fab60aae9f17be85f428dea5232744f21734158..6dd763a8bdef74756c3bb8a353ad48592a10c3d0 100644 --- a/demo/demo/settings.py +++ b/demo/demo/settings.py @@ -196,10 +196,8 @@ STATICFILES_FINDERS = [ # be handled by the Django staticfiles infrastructure PLOTLY_COMPONENTS = [ - 'dash_core_components', - 'dash_html_components', + 'dash_bootstrap_components', - 'dash_renderer', 'dpd_components', 'dpd_static_support', ] diff --git a/dev_requirements.txt b/dev_requirements.txt index 45e2fcf78cdaa3bb59097d1c9093708cda927b32..cab46917d075edcea4cd265bc8347838ecf968b3 100644 --- a/dev_requirements.txt +++ b/dev_requirements.txt @@ -18,6 +18,7 @@ pytest-cov python-coveralls pytz redis +setuptools sphinx sphinx-autobuild sphinx_rtd_theme diff --git a/django_plotly_dash/__init__.py b/django_plotly_dash/__init__.py index 3f097d8148fb88e26b3b1a0320039e93e4d71c1d..145da77dd485faf0d42ac62be0e0332bb32fc54f 100644 --- a/django_plotly_dash/__init__.py +++ b/django_plotly_dash/__init__.py @@ -29,3 +29,7 @@ SOFTWARE. from .version import __version__ from .dash_wrapper import DjangoDash + +# Monkeypatching + +import django_plotly_dash._callback diff --git a/django_plotly_dash/_callback.py b/django_plotly_dash/_callback.py new file mode 100644 index 0000000000000000000000000000000000000000..7e8da3d5ad5526da91fb2b7dac0ad203b3212602 --- /dev/null +++ b/django_plotly_dash/_callback.py @@ -0,0 +1,135 @@ +# +# Monkey patching of register_callback +# + +import dash._callback + +from dash._callback import (handle_grouped_callback_args, + insert_callback, + NoUpdate, + ) +import collections +from functools import wraps + +from dash.dependencies import ( + handle_callback_args, + handle_grouped_callback_args, + Output, +) +from dash.exceptions import PreventUpdate + +from dash._grouping import ( + flatten_grouping, + make_grouping_by_index, + grouping_len, +) +from dash._utils import ( + create_callback_id, + stringify_id, + to_json, +) + +from dash import _validate + + +def register_callback( + callback_list, callback_map, config_prevent_initial_callbacks, *_args, **_kwargs +): + ( + output, + flat_inputs, + flat_state, + inputs_state_indices, + prevent_initial_call, + ) = handle_grouped_callback_args(_args, _kwargs) + if isinstance(output, Output): + # Insert callback with scalar (non-multi) Output + insert_output = output + multi = False + else: + # Insert callback as multi Output + insert_output = flatten_grouping(output) + multi = True + + output_indices = make_grouping_by_index(output, list(range(grouping_len(output)))) + callback_id = insert_callback( + callback_list, + callback_map, + config_prevent_initial_callbacks, + insert_output, + output_indices, + flat_inputs, + flat_state, + inputs_state_indices, + prevent_initial_call, + ) + + # pylint: disable=too-many-locals + def wrap_func(func): + @wraps(func) + def add_context(*args, **kwargs): + output_spec = kwargs.pop("outputs_list") + _validate.validate_output_spec(insert_output, output_spec, Output) + + func_args, func_kwargs = _validate.validate_and_group_input_args( + args, inputs_state_indices + ) + + func_kwargs = {**func_kwargs, + **kwargs} + + # don't touch the comment on the next line - used by debugger + output_value = func(*func_args, **func_kwargs) # %% callback invoked %% + + if isinstance(output_value, NoUpdate): + raise PreventUpdate + + if not multi: + output_value, output_spec = [output_value], [output_spec] + flat_output_values = output_value + else: + if isinstance(output_value, (list, tuple)): + # For multi-output, allow top-level collection to be + # list or tuple + output_value = list(output_value) + + # Flatten grouping and validate grouping structure + flat_output_values = flatten_grouping(output_value, output) + + _validate.validate_multi_return( + output_spec, flat_output_values, callback_id + ) + + component_ids = collections.defaultdict(dict) + has_update = False + for val, spec in zip(flat_output_values, output_spec): + if isinstance(val, NoUpdate): + continue + for vali, speci in ( + zip(val, spec) if isinstance(spec, list) else [[val, spec]] + ): + if not isinstance(vali, NoUpdate): + has_update = True + id_str = stringify_id(speci["id"]) + component_ids[id_str][speci["property"]] = vali + + if not has_update: + raise PreventUpdate + + response = {"response": component_ids, "multi": True} + + try: + jsonResponse = to_json(response) + except TypeError: + _validate.fail_callback_output(output_value, output) + + return jsonResponse + + callback_map[callback_id]["callback"] = add_context + + return func + + return wrap_func + + +dash._callback.register_callback = register_callback diff --git a/django_plotly_dash/finders.py b/django_plotly_dash/finders.py index f382821dee3892f9f29698c8e72850076dc2470d..56f92d5959f44459bea1bfedbdc5c3452eefdb66 100644 --- a/django_plotly_dash/finders.py +++ b/django_plotly_dash/finders.py @@ -56,10 +56,20 @@ class DashComponentFinder(BaseFinder): except: components = [] + built_ins = [('dash', ['dcc', 'html', 'dash_table', 'deps', 'dash-renderer', 'dash-renderer/build']), ] + for component_name in components: - module = importlib.import_module(component_name) - path_directory = os.path.dirname(module.__file__) + split_name = component_name.split('/') + try: + module_name = ".".join(split_name) + module = importlib.import_module(module_name) + path_directory = os.path.dirname(module.__file__) + except: + module_name = ".".join(split_name[:-1]) + module = importlib.import_module(module_name) + path_directory = os.path.join(os.path.dirname(module.__file__), + split_name[-1]) root = path_directory storage = FileSystemStorage(location=root) @@ -76,6 +86,29 @@ class DashComponentFinder(BaseFinder): self.storages[component_name] = storage self.components[path] = component_name + for module_name, component_list in built_ins: + + module = importlib.import_module(module_name) + + for specific_component in component_list: + + path_directory = os.path.join(os.path.dirname(module.__file__), + specific_component) + + root = path_directory + component_name = f"{module_name}/{specific_component}" + path = f"dash/component/{component_name}" + + if path not in self.components: + + storage = FileSystemStorage(location=root) + storage.prefix = path + + self.locations.append(component_name) + + self.storages[component_name] = storage + self.components[path] = component_name + super().__init__() def find(self, path, all=False): diff --git a/django_plotly_dash/templates/django_plotly_dash/plotly_app_bootstrap.html b/django_plotly_dash/templates/django_plotly_dash/plotly_app_bootstrap.html index 576c947a4d3486409ef1c44a12453d389d3f5a77..b7dcc67dff7cfc8fb57a2a47bf314a4e003b1bfc 100644 --- a/django_plotly_dash/templates/django_plotly_dash/plotly_app_bootstrap.html +++ b/django_plotly_dash/templates/django_plotly_dash/plotly_app_bootstrap.html @@ -1,3 +1,3 @@ <div class="embed-responsive embed-responsive-{{aspect}}"> - <iframe src="{{app.base_url}}" class="embed-responsive-item"></iframe> + <iframe src="{{app.base_url}}" class="embed-responsive-item" sandbox="allow-downloads allow-scripts allow-same-origin"></iframe> </div> diff --git a/django_plotly_dash/tests.py b/django_plotly_dash/tests.py index c7a3d47376737f7d29a304c3a2f3d54a8aaaa3a2..1be36ae90680832f45285c306b2376e9e3c41398 100644 --- a/django_plotly_dash/tests.py +++ b/django_plotly_dash/tests.py @@ -349,7 +349,7 @@ def test_updating(client): 'value':'medium'}, ]}), content_type="application/json") - assert response.content == b'{"response": {"output-size": {"children": "The chosen T-shirt is a medium blue one."}}, "multi": true}' + assert response.content == b'{"response":{"output-size":{"children":"The chosen T-shirt is a medium blue one."}},"multi":true}' assert response.status_code == 200 @@ -489,7 +489,7 @@ def test_injection_updating(client): 'value':'TestIt'}, ]}), content_type="application/json") - rStart = b'{"response": {"test-output-div": {"children": [{"props": {"id": "line-area-graph2"' + rStart = b'{"response":{"test-output-div":{"children":[{"props":{"id":"line-area-graph2"' assert response.content.startswith(rStart) assert response.status_code == 200 @@ -501,7 +501,7 @@ def test_injection_updating(client): 'value':'TestIt'}, ]}), content_type="application/json") - rStart = b'{"response": {"test-output-div": {"children": [{"props": {"id": "line-area-graph2"' + rStart = b'{"response":{"test-output-div":{"children":[{"props":{"id":"line-area-graph2"' assert response.content.startswith(rStart) assert response.status_code == 200 @@ -530,7 +530,7 @@ def test_injection_updating(client): 'value':'TestIt'}, ]}), content_type="application/json") - rStart = b'{"response": {"test-output-div3": {"children": [{"props": {"id": "line-area-graph2"' + rStart = b'{"response":{"test-output-div3":{"children":[{"props":{"id":"line-area-graph2"' assert response.content.startswith(rStart) assert response.status_code == 200 @@ -551,7 +551,7 @@ def test_injection_updating(client): 'property':'value', 'value':'TestIt'}, ]}), content_type="application/json") - rStart = b'{"response": {"test-output-div2": {"children": [{"props": {"children": ["You have ' + rStart = b'{"response":{"test-output-div2":{"children":[{"props":{"children":["You have ' assert response.content.startswith(rStart) assert response.status_code == 200 diff --git a/django_plotly_dash/tests_dash_contract.py b/django_plotly_dash/tests_dash_contract.py index 8ae4b8c1e9a7be5e3114d19a7f6cba05859329eb..033715fc8900b341891fa6ae81efb607bdbb45d9 100644 --- a/django_plotly_dash/tests_dash_contract.py +++ b/django_plotly_dash/tests_dash_contract.py @@ -9,7 +9,7 @@ from pathlib import Path from typing import Union import dash -import dash_html_components as html +from dash import html import flask from dash import Dash, no_update from dash.dependencies import MATCH, ALL, ALLSMALLER, Input, Output, State diff --git a/django_plotly_dash/urls.py b/django_plotly_dash/urls.py index 9b3397b03829f7c41e521f73de41140575f8d368..d3a59049b186402ac038818d09a217d6bcd607c7 100644 --- a/django_plotly_dash/urls.py +++ b/django_plotly_dash/urls.py @@ -27,7 +27,7 @@ SOFTWARE. from django.urls import path from django.views.decorators.csrf import csrf_exempt -from .views import routes, layout, dependencies, update, main_view, component_suites, component_component_suites, asset_redirection +from .views import routes, layout, dependencies, update, main_view, component_suites, component_component_suites, asset_redirection, component_suites_build from .views import add_stateless_apps from .app_name import app_name, main_view_label @@ -50,6 +50,8 @@ for base_type, args, name_prefix, url_ending, name_suffix in [('instance', {}, ' ('_dash-update-component', csrf_exempt(update), 'update-component', '', ), ('', main_view, main_view_label, '', ), ('_dash-component-suites', component_suites, 'component-suites', '/<slug:component>/<resource>', ), + ('_dash-component-suites', component_suites, 'component-suites', '/<slug:component>/<slug:cpe2>/<resource>', ), + ('_dash-component-suites', component_suites_build, 'component-suites', '/<slug:component>/<slug:cpe2>/build/<resource>', ), ('_dash-component-suites', component_component_suites, 'component-component-suites', '/<slug:component>/_components/<resource>', ), ('assets', asset_redirection, 'asset-redirect', '/<path:path>', ), ]: diff --git a/django_plotly_dash/version.py b/django_plotly_dash/version.py index c907563a07cae986c0630d7ebc4535594e50c53c..296c886a1de7d3ff80bbe1b10736e386a0548fc1 100644 --- a/django_plotly_dash/version.py +++ b/django_plotly_dash/version.py @@ -23,4 +23,4 @@ SOFTWARE. ''' -__version__ = "1.7.1" +__version__ = "2.0.0" diff --git a/django_plotly_dash/views.py b/django_plotly_dash/views.py index bcbc2bc153d45c331b333bb4fe46a064858962e6..9823212515826dbd5c1c28590c249fee57f240d4 100644 --- a/django_plotly_dash/views.py +++ b/django_plotly_dash/views.py @@ -123,15 +123,28 @@ def component_component_suites(request, resource=None, component=None, **kwargs) extra_element="_components/", **kwargs) -def component_suites(request, resource=None, component=None, extra_element="", **kwargs): + +def component_suites_build(request, resource=None, component=None, extra_element="", cpe2=None, **kwargs): 'Return part of a client-side component, served locally for some reason' + return component_suites(request, + resource=resource, + component=component, + extra_element=extra_element, + cpe2=f"{cpe2}/build", + **kwargs) + + +def component_suites(request, resource=None, component=None, extra_element="", cpe2=None, **kwargs): + 'Return part of a client-side component, served locally for some reason' + + extra_path_part = f"{cpe2}/" if cpe2 else "" get_params = request.GET.urlencode() if get_params and False: - redone_url = static_path("dash/component/%s/%s%s?%s" %(component, extra_element, resource, get_params)) + redone_url = static_path("dash/component/%s/%s%s%s?%s" %(component, extra_path_part, extra_element, resource, get_params)) else: resource, _fingerprint = check_fingerprint(resource) - redone_url = static_path("dash/component/%s/%s%s" % (component, extra_element, resource)) + redone_url = static_path("dash/component/%s/%s%s%s" % (component, extra_path_part, extra_element, resource)) return HttpResponseRedirect(redirect_to=redone_url) diff --git a/docs/configuration.rst b/docs/configuration.rst index e95a0c19828d34f5617bf08d42adf9f4a74b2a4c..b614e3961348f78a92f93f8e920647dd20cc2de7 100644 --- a/docs/configuration.rst +++ b/docs/configuration.rst @@ -65,10 +65,7 @@ and also providing a list of components used PLOTLY_COMPONENTS = [ - # Common components - 'dash_core_components', - 'dash_html_components', - 'dash_renderer', + # Common components (ie within dash itself) are automatically added # django-plotly-dash components 'dpd_components', @@ -80,7 +77,9 @@ and also providing a list of components used ] This list should be extended with any additional components that the applications -use, where the components have files that have to be served locally. +use, where the components have files that have to be served locally. The components that +are part of the core ``dash`` package are automatically included and do not need to be +provided in this list. Furthermore, middleware should be added for redirection of external assets from underlying packages, such as ``dash-bootstrap-components``. With the standard diff --git a/docs/extended_callbacks.rst b/docs/extended_callbacks.rst index 02ef6317712c1a6ffbd48c844e6d1fe4daddc0d3..ec58e5b8f1f33c920f5578e33a2a09ec1ae3e809 100644 --- a/docs/extended_callbacks.rst +++ b/docs/extended_callbacks.rst @@ -18,8 +18,7 @@ For example, the ``plotly_apps.py`` example contains this dash application: .. code-block:: python import dash - import dash_core_components as dcc - import dash_html_components as html + from dash import dcc, html from django_plotly_dash import DjangoDash diff --git a/docs/faq.rst b/docs/faq.rst index 4fdd0e1259b011b690cf63352e1e6f7af535e5c0..4c3047274c39fde79525c3adc2f7b472dff68354 100644 --- a/docs/faq.rst +++ b/docs/faq.rst @@ -3,9 +3,14 @@ FAQ === +* What Dash versions are supported? + +Dash v2.0 onwards is supported. The non-backwards-compatible changes of Dash make supporting earlier versions hard. +Note that v1.7.2 is the last version to support (and require) Dash versions prior to v2.0 + * What environment versions are supported? -At least v3.5 of Python, and v2.0 of Django, are needed. +At least v3.8 of Python, and v2.2 of Django, are needed. * Is a ``virtualenv`` mandatory? diff --git a/docs/installation.rst b/docs/installation.rst index 37317bf8d1cdd7d1c49c535ff4c040935fe8710b..d0ab51c1f8d76b40652d0dad4745aade09712b8c 100644 --- a/docs/installation.rst +++ b/docs/installation.rst @@ -3,7 +3,7 @@ Installation ============ -The package requires version 2.2 or greater of Django, and a minimum Python version needed of 3.5. +The package requires version 2.2 or greater of Django, and a minimum Python version needed of 3.8. Use ``pip`` to install the package, preferably to a local ``virtualenv``:: diff --git a/docs/simple_use.rst b/docs/simple_use.rst index 28950406073f36fd46ad0d288f2f8418f94ad515..bff9fbf4732888f4273e4a3777a95d416f85c0b3 100644 --- a/docs/simple_use.rst +++ b/docs/simple_use.rst @@ -11,8 +11,7 @@ Taking a simple example inspired by the excellent `getting started <https://dash .. code-block:: python import dash - import dash_core_components as dcc - import dash_html_components as html + from dash import dcc, html from django_plotly_dash import DjangoDash diff --git a/frozen_dev.txt b/frozen_dev.txt index 6b5ab1f691781bbdf755e7c5527f16df9cabe511..01822b3f0ffb68025e5a2298fe830f81d583be6e 100644 --- a/frozen_dev.txt +++ b/frozen_dev.txt @@ -1,118 +1,121 @@ aioredis==1.3.1 alabaster==0.7.12 -asgiref==3.3.1 -astroid==2.4.2 -async-timeout==3.0.1 +asgiref==3.5.2 +astroid==2.11.5 +async-timeout==4.0.2 attrs==19.3.0 -autobahn==20.7.1 +autobahn==22.5.1 Automat==20.2.0 -Babel==2.9.0 -beautifulsoup4==4.9.3 -bleach==3.2.1 +Babel==2.10.1 +beautifulsoup4==4.11.1 +bleach==5.0.0 Brotli==1.0.9 -certifi==2020.12.5 -cffi==1.14.4 +certifi==2022.5.18.1 +cffi==1.15.0 channels==2.4.0 -channels-redis==3.2.0 -chardet==3.0.4 -click==7.1.2 +channels-redis==3.4.0 +charset-normalizer==2.0.12 +click==8.1.3 colorama==0.4.4 +commonmark==0.9.1 constantly==15.1.0 -coverage==5.3 -coveralls==2.2.0 -cryptography==3.3.1 +coverage==6.4.1 +coveralls==3.3.1 +cryptography==37.0.2 daphne==2.5.0 -dash==1.18.1 -dash-bootstrap-components==0.10.7 -dash-core-components==1.14.1 -dash-html-components==1.1.1 -dash-renderer==1.8.3 -dash-table==4.11.1 -Django==3.1.4 -django-bootstrap4==2.3.1 --e git+https://delsim@github.com/delsim/django-plotly-dash.git@6cef277b20e2f980b6d92f182206ad2d340cc7bc#egg=django_plotly_dash -django-redis==4.12.1 +dash==2.4.1 +dash-bootstrap-components==0.13.1 +dash-core-components==2.0.0 +dash-html-components==2.0.0 +dash-renderer==1.9.1 +dash-table==5.0.0 +Deprecated==1.2.13 +dill==0.3.5.1 +Django==3.2.13 +django-bootstrap4==22.1 +-e git+ssh://git@github.com/delsim/django-plotly-dash.git@9c134318bb94b0e58b6eae46fe21f97c164a9e24#egg=django_plotly_dash +django-redis==5.2.0 docopt==0.6.2 -docutils==0.16 +docutils==0.17.1 dpd-components==0.1.0 dpd-static-support==0.0.5 -Flask==1.1.2 -Flask-Compress==1.8.0 -future==0.18.2 -grip==4.5.2 -hiredis==1.1.0 -hyperlink==20.0.1 -idna==2.10 -imagesize==1.2.0 -importlib-metadata==2.1.1 -incremental==17.5.0 +Flask==2.1.2 +Flask-Compress==1.12 +grip==4.6.1 +hiredis==2.0.0 +hyperlink==21.0.0 +idna==3.3 +imagesize==1.3.0 +importlib-metadata==4.11.4 +incremental==21.3.0 iniconfig==1.1.1 -isort==5.6.4 -itsdangerous==1.1.0 -jeepney==0.6.0 -Jinja2==2.11.2 -keyring==21.5.0 -lazy-object-proxy==1.4.3 +isort==5.10.1 +itsdangerous==2.1.2 +jeepney==0.8.0 +Jinja2==3.1.2 +keyring==23.5.1 +lazy-object-proxy==1.7.1 livereload==2.6.3 -Markdown==3.3.3 -MarkupSafe==1.1.1 -mccabe==0.6.1 -msgpack==1.0.1 -numpy==1.19.4 -packaging==20.7 -pandas==1.1.5 +Markdown==3.3.7 +MarkupSafe==2.1.1 +mccabe==0.7.0 +msgpack==1.0.4 +numpy==1.22.4 +packaging==21.3 +pandas==1.4.2 path-and-address==2.0.1 -pkginfo==1.6.1 -plotly==4.14.1 -pluggy==0.13.1 -py==1.9.0 +pkginfo==1.8.2 +platformdirs==2.5.2 +plotly==5.8.0 +pluggy==1.0.0 +py==1.11.0 pyasn1==0.4.8 pyasn1-modules==0.2.8 -pycparser==2.20 -Pygments==2.7.3 -PyHamcrest==2.0.2 -pylint==2.6.0 -pyOpenSSL==20.0.0 -pyparsing==2.4.7 -pytest==6.1.2 -pytest-cov==2.10.1 -pytest-django==4.1.0 +pycparser==2.21 +Pygments==2.12.0 +pylint==2.14.0 +pyOpenSSL==22.0.0 +pyparsing==3.0.9 +pytest==7.1.2 +pytest-cov==3.0.0 +pytest-django==4.5.2 python-coveralls==2.9.3 -python-dateutil==2.8.1 -pytz==2020.4 -PyYAML==5.3.1 -readme-renderer==28.0 -redis==3.5.3 -requests==2.25.0 +python-dateutil==2.8.2 +pytz==2022.1 +PyYAML==6.0 +readme-renderer==35.0 +redis==4.3.3 +requests==2.27.1 requests-toolbelt==0.9.1 -retrying==1.3.3 -rfc3986==1.4.0 -SecretStorage==3.3.0 -service-identity==18.1.0 -six==1.15.0 -snowballstemmer==2.0.0 -soupsieve==2.1 -Sphinx==3.3.1 -sphinx-autobuild==2020.9.1 -sphinx-rtd-theme==0.5.0 +rfc3986==2.0.0 +rich==12.4.4 +SecretStorage==3.3.2 +service-identity==21.1.0 +six==1.16.0 +snowballstemmer==2.2.0 +soupsieve==2.3.2.post1 +Sphinx==5.0.1 +sphinx-autobuild==2021.3.14 +sphinx-rtd-theme==1.0.0 sphinxcontrib-applehelp==1.0.2 sphinxcontrib-devhelp==1.0.2 -sphinxcontrib-htmlhelp==1.0.3 +sphinxcontrib-htmlhelp==2.0.0 sphinxcontrib-jsmath==1.0.1 sphinxcontrib-qthelp==1.0.3 -sphinxcontrib-serializinghtml==1.1.4 -sqlparse==0.4.1 -toml==0.10.2 +sphinxcontrib-serializinghtml==1.1.5 +sqlparse==0.4.2 +tenacity==8.0.1 +tomli==2.0.1 +tomlkit==0.11.0 tornado==6.1 -tqdm==4.54.1 -twine==3.2.0 -Twisted==20.3.0 -txaio==20.4.1 -typed-ast==1.4.1 -urllib3==1.26.2 +twine==4.0.1 +Twisted==22.4.0 +txaio==22.2.1 +typing_extensions==4.2.0 +urllib3==1.26.9 webencodings==0.5.1 -Werkzeug==1.0.1 -whitenoise==5.2.0 -wrapt==1.12.1 -zipp==3.4.0 -zope.interface==5.2.0 +Werkzeug==2.0.3 +whitenoise==6.1.0 +wrapt==1.14.1 +zipp==3.8.0 +zope.interface==5.4.0 diff --git a/make_env b/make_env index e628f39b96207b36b172f192d934db32bc4555f5..75235219f0e4d067ed9c66efc8f9df98425bbd90 100755 --- a/make_env +++ b/make_env @@ -5,14 +5,15 @@ # Stop on error, rather than continue and trash the environment set -e # -# Default to 3.6 but allow override -DEFAULT_PYTHON_VER=3.6 +# Default to 3.8 but allow override +DEFAULT_PYTHON_VER=3.8 PYTHON_VER=${1:-$DEFAULT_PYTHON_VER} # python${PYTHON_VER} -m venv env # source env/bin/activate # +pip install --upgrade pip setuptools wheel pip install -r requirements.txt pip install -r dev_requirements.txt # diff --git a/requirements.txt b/requirements.txt index f1fc96d6336a5c9659ed69ac52e7313f649b9b3d..a2d57875aa0cdc0cd52f59ea5a33b682d88eb40c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,11 +1,8 @@ -dash>=1.11,<1.21.0 -dash-core-components -dash-html-components -dash-renderer +dash>=2.0 plotly dpd-components -dash-bootstrap-components<1 +dash-bootstrap-components<1.0 channels<3.0 Django>=2.2,<4.0.0 diff --git a/setup.py b/setup.py index 793079baf3ccdcb869a644ab76f85de2c0b745c7..a739aef0cff598c0fc0bac0b6c3c22ba9cb65808 100644 --- a/setup.py +++ b/setup.py @@ -2,15 +2,15 @@ from setuptools import setup -#import django_plotly_dash as dpd -#VERSION = dpd.__version__ with open('django_plotly_dash/version.py') as f: exec(f.read()) + with open('README.md') as f: long_description = f.read() + setup( name="django-plotly-dash", version=__version__, @@ -28,7 +28,7 @@ setup( ], include_package_data=True, classifiers = [ - 'Development Status :: 3 - Alpha', + 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Programming Language :: Python :: 3', @@ -41,18 +41,16 @@ setup( 'Documentation': 'http://django-plotly-dash.readthedocs.io/', }, install_requires = ['plotly', - 'dash>=1.11,<1.21.0', - 'dash-core-components', - 'dash-html-components', - 'dash-renderer', + 'dash>=2.0', 'dpd-components', 'dash-bootstrap-components<1', + 'channels<3.0', 'Django>=2.2,<4.0.0', 'Flask>=1.0.2', 'Werkzeug>=2.0,<2.1', ], - python_requires=">=3.6", + python_requires=">=3.8", )