diff --git a/.circleci/config.yml b/.circleci/config.yml index f1d5e193cb..2fa41ef72f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,4 +1,6 @@ -version: 2 +version: 2.1 +orbs: + win: circleci/windows@2.4.0 jobs: percy-finalize: docker: @@ -183,6 +185,45 @@ jobs: environment: PYVERSION: python27 + build-windows-37: &build-windows + working_directory: ~/dash + executor: + name: win/default + shell: bash.exe + environment: + PYVERSION: python37 + steps: + - checkout + - run: echo $PYVERSION > ver.txt + - restore_cache: + key: dep-{{ checksum ".circleci/config.yml" }}-{{ checksum "ver.txt" }}-{{ checksum "requires-dev.txt" }}-{{ checksum "requires-install.txt" }}-{{ checksum "requires-testing.txt" }} + - run: + name: ️️🏗️ pip dev requirements + command: | + pip install --upgrade virtualenv + virtualenv venv + source venv/Scripts/activate + sed -i '/dash-/d' requires-install.txt + pip install -e . --no-cache-dir -r requires-install.txt -r requires-dev.txt -r requires-testing.txt --progress-bar off + - save_cache: + key: dep-{{ checksum ".circleci/config.yml" }}-{{ checksum "ver.txt" }}-{{ checksum "requires-dev.txt" }}-{{ checksum "requires-install.txt" }}-{{ checksum "requires-testing.txt" }} + paths: + - venv + - run: + name: ️️🏗️ build core + command: | + source venv/Scripts/activate && pip install --no-cache-dir --upgrade -e . --progress-bar off && mkdir packages + cd dash-renderer && renderer build && python setup.py sdist && mv dist/* ../packages/ && cd .. + git clone --depth 1 https://github.com/plotly/dash-core-components.git + cd dash-core-components && npm ci && npm run build && python setup.py sdist && mv dist/* ../packages/ && cd .. + git clone --depth 1 https://github.com/plotly/dash-renderer-test-components + cd dash-renderer-test-components && npm ci && npm run build:all && python setup.py sdist && mv dist/* ../packages/ && cd .. + ls -la packages + - persist_to_workspace: + root: ~/dash + paths: + - packages/*.tar.gz + test-37: &test working_directory: ~/dash docker: @@ -246,6 +287,7 @@ workflows: jobs: - lint-unit-37 - build-core-37 + - build-windows-37 - build-misc-37 - test-37: requires: diff --git a/CHANGELOG.md b/CHANGELOG.md index 6028f4751c..82386318d5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ All notable changes to `dash` will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/). +## [Unreleased] +### Added +- [#1133](github.com/plotly/dash/pull/1133) Allow the `compress` config variable to be set with an environment variable with DASH_COMPRESS=FALSE + ## [1.9.0] - 2020-02-04 ### Fixed - [#1080](https://github.com/plotly/dash/pull/1080) Handle case where dash fails to load when used inside an iframe with a sandbox attribute that only has allow-scripts diff --git a/dash-renderer/src/persistence.js b/dash-renderer/src/persistence.js index 39bd011854..5d8059214f 100644 --- a/dash-renderer/src/persistence.js +++ b/dash-renderer/src/persistence.js @@ -3,8 +3,9 @@ * * When users input new prop values, they can be stored and reapplied later, * when the component is recreated (changing `Tab` for example) or when the - * page is reloaded (depending on `persistence_type`) Storage is tied to - * component ID and will not on with components without an ID. + * page is reloaded (depending on `persistence_type`). Storage is tied to + * component ID, and the prop values will not be stored with components + * without an ID. * * Renderer handles the mechanics, but components must define a few props: * diff --git a/dash/_configs.py b/dash/_configs.py index c93fca5eba..0c4fae55b4 100644 --- a/dash/_configs.py +++ b/dash/_configs.py @@ -29,12 +29,13 @@ def load_dash_env_vars(): 'DASH_HOT_RELOAD_MAX_RETRY', 'DASH_SILENCE_ROUTES_LOGGING', 'DASH_PRUNE_ERRORS', + 'DASH_COMPRESS' ) } ) -DASH_ENV_VARS = load_dash_env_vars() +DASH_ENV_VARS = load_dash_env_vars() # used in tests def get_combined_config(name, val, default=None): diff --git a/dash/dash.py b/dash/dash.py index 679ed0ee9a..4a702aab6d 100644 --- a/dash/dash.py +++ b/dash/dash.py @@ -221,7 +221,7 @@ def __init__( requests_pathname_prefix=None, routes_pathname_prefix=None, serve_locally=True, - compress=True, + compress=None, meta_tags=None, index_string=_default_index, external_scripts=None, @@ -276,7 +276,9 @@ def __init__( routes_pathname_prefix=routes_prefix, requests_pathname_prefix=requests_prefix, serve_locally=serve_locally, - compress=compress, + compress=get_combined_config( + "compress", compress, True + ), meta_tags=meta_tags or [], external_scripts=external_scripts or [], external_stylesheets=external_stylesheets or [], diff --git a/tests/integration/test_scripts.py b/tests/integration/test_scripts.py index 3900ea6979..9a9e6f2d91 100644 --- a/tests/integration/test_scripts.py +++ b/tests/integration/test_scripts.py @@ -36,7 +36,7 @@ def findSyncPlotlyJs(scripts): def findAsyncPlotlyJs(scripts): for script in scripts: - if "dash_core_components/async~plotlyjs" in script.get_attribute( + if "dash_core_components/async-plotlyjs" in script.get_attribute( 'src' ): return script