Skip to content

Commit 1cbbb58

Browse files
authored
Merge branch 'dev' into startup-message
2 parents c5e9e0c + 526af0c commit 1cbbb58

File tree

7 files changed

+51
-36
lines changed

7 files changed

+51
-36
lines changed

.circleci/config.yml

+15-16
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010

1111
artifacts:
1212
docker:
13-
- image: circleci/python:3.7-stretch-node-browsers
13+
- image: circleci/python:3.7.6-stretch-node-browsers
1414
environment:
1515
PYVERSION: python37
1616
steps:
@@ -27,7 +27,7 @@ jobs:
2727
lint-unit-37: &lint-unit
2828
working_directory: ~/dash
2929
docker:
30-
- image: circleci/python:3.7-stretch-node-browsers
30+
- image: circleci/python:3.7.6-stretch-node-browsers
3131
environment:
3232
PYLINTRC: .pylintrc37
3333
PYVERSION: python37
@@ -64,7 +64,7 @@ jobs:
6464
lint-unit-36:
6565
<<: *lint-unit
6666
docker:
67-
- image: circleci/python:3.6-stretch-node-browsers
67+
- image: circleci/python:3.6.9-stretch-node-browsers
6868
environment:
6969
PYLINTRC: .pylintrc
7070
PYVERSION: python36
@@ -80,7 +80,7 @@ jobs:
8080
build-core-37: &build-core
8181
working_directory: ~/dash
8282
docker:
83-
- image: circleci/python:3.7-stretch-node-browsers
83+
- image: circleci/python:3.7.6-stretch-node-browsers
8484
environment:
8585
PYVERSION: python37
8686
steps:
@@ -115,7 +115,7 @@ jobs:
115115
build-core-36:
116116
<<: *build-core
117117
docker:
118-
- image: circleci/python:3.6-stretch-node-browsers
118+
- image: circleci/python:3.6.9-stretch-node-browsers
119119
environment:
120120
PYVERSION: python36
121121

@@ -129,7 +129,7 @@ jobs:
129129
build-misc-37: &build-misc
130130
working_directory: ~/dash
131131
docker:
132-
- image: circleci/python:3.7-stretch-node-browsers
132+
- image: circleci/python:3.7.6-stretch-node-browsers
133133
environment:
134134
PYVERSION: python37
135135

@@ -165,7 +165,7 @@ jobs:
165165
build-misc-36:
166166
<<: *build-misc
167167
docker:
168-
- image: circleci/python:3.6-stretch-node-browsers
168+
- image: circleci/python:3.6.9-stretch-node-browsers
169169
environment:
170170
PYVERSION: python36
171171

@@ -230,8 +230,8 @@ jobs:
230230
command: |
231231
python -m venv venv
232232
. venv/bin/activate
233-
git clone --depth 1 https://github.com/plotly/dash.git -b ${CIRCLE_BRANCH} dash-main
234-
cd dash-main && pip install -e .[dev,testing] --progress-bar off && cd ..
233+
npm ci
234+
pip install --no-cache-dir --upgrade -e .[dev,testing] --progress-bar off
235235
git clone --depth 1 https://github.com/plotly/dashR.git -b dev dashR
236236
git clone --depth 1 https://github.com/plotly/dash-html-components.git
237237
git clone --depth 1 https://github.com/plotly/dash-core-components.git
@@ -240,7 +240,7 @@ jobs:
240240
cd dash-html-components; npm ci && npm run build; rm -rf !(.|..|DESCRIPTION|LICENSE.txt|LICENSE|NAMESPACE|.Rbuildignore|R|man|inst|vignettes|build)
241241
cd ../dash-core-components; npm ci && npm run build; rm -rf !(.|..|DESCRIPTION|LICENSE.txt|LICENSE|NAMESPACE|.Rbuildignore|R|man|inst|vignettes|build)
242242
cd ../dash-table; npm ci && npm run build; rm -rf !(.|..|DESCRIPTION|LICENSE.txt|LICENSE|NAMESPACE|.Rbuildignore|R|man|inst|vignettes|build); cd ..
243-
243+
244244
- run:
245245
name: 🔧fix up dash metadata
246246
command: |
@@ -286,7 +286,7 @@ jobs:
286286
Rscript -e "message(devtools::check_failures(path = '${DHC_CHECK_DIR}'))"
287287
Rscript -e "message(devtools::check_failures(path = '${DCC_CHECK_DIR}'))"
288288
Rscript -e "message(devtools::check_failures(path = '${DT_CHECK_DIR}'))"
289-
Rscript -e "message(devtools::check_failures(path = '${DASH_CHECK_DIR}'))"
289+
Rscript -e "message(devtools::check_failures(path = '${DASH_CHECK_DIR}'))"
290290
# warnings are errors; enable for stricter checks once CRAN submission finished
291291
# if grep -q -R "WARNING" "${DHC_CHECK_DIR}/00check.log"; then exit 1; fi
292292
# if grep -q -R "WARNING" "${DCC_CHECK_DIR}/00check.log"; then exit 1; fi
@@ -303,8 +303,7 @@ jobs:
303303
command: |
304304
python -m venv venv
305305
. venv/bin/activate
306-
cd dash-main/\@plotly/dash-generator-test-component-nested && npm ci && npm run build && sudo R CMD INSTALL . && cd ../../..
307-
cd dash-main/\@plotly/dash-generator-test-component-standard && npm ci && npm run build && sudo R CMD INSTALL . && cd ../../..
306+
npm run setup-tests.R
308307
export PATH=$PATH:/home/circleci/.local/bin/
309308
pytest --nopercyfinalize --junitxml=test-reports/dashr.xml dashR/tests/integration/dopsa/
310309
- store_artifacts:
@@ -317,13 +316,13 @@ jobs:
317316
- run:
318317
name: 🦔 percy finalize
319318
command: npx percy finalize --all
320-
when: on_fail
319+
when: on_fail
321320

322321

323322
test-37: &test
324323
working_directory: ~/dash
325324
docker:
326-
- image: circleci/python:3.7-stretch-node-browsers
325+
- image: circleci/python:3.7.6-stretch-node-browsers
327326
environment:
328327
PERCY_PARALLEL_TOTAL: -1
329328
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: True
@@ -365,7 +364,7 @@ jobs:
365364
test-36:
366365
<<: *test
367366
docker:
368-
- image: circleci/python:3.6-stretch-node-browsers
367+
- image: circleci/python:3.6.9-stretch-node-browsers
369368
environment:
370369
PERCY_ENABLE: 0
371370
PYVERSION: python36

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
1515
- [#1249](https://github.com/plotly/dash/pull/1249) Fixes [#919](https://github.com/plotly/dash/issues/919) so `dash.testing` is compatible with more `pytest` plugins, particularly `pytest-flake8` and `pytest-black`.
1616
- [#1248](https://github.com/plotly/dash/pull/1248) Fixes [#1245](https://github.com/plotly/dash/issues/1245), so you can use prop persistence with components that have dict IDs, ie for pattern-matching callbacks.
1717
- [#1185](https://github.com/plotly/dash/pull/1185) Sort asset directories, same as we sort files inside those directories. This way if you need your assets loaded in a certain order, you can add prefixes to subdirectory names and enforce that order.
18+
- [#1288](https://github.com/plotly/dash/pull/1288) Closes [#1285](https://github.com/plotly/dash/issues/1285): Debug=True should work in the __main__ module.
1819

1920
## [1.12.0] - 2020-05-05
2021
### Added

dash/dash.py

+9-4
Original file line numberDiff line numberDiff line change
@@ -1338,14 +1338,19 @@ def enable_dev_tools(
13381338
_reload = self._hot_reload
13391339
_reload.hash = generate_hash()
13401340

1341+
# find_loader should return None on __main__ but doesn't
1342+
# on some python versions https://bugs.python.org/issue14710
1343+
packages = [
1344+
pkgutil.find_loader(x)
1345+
for x in list(ComponentRegistry.registry) + ["dash_renderer"]
1346+
if x != "__main__"
1347+
]
1348+
13411349
component_packages_dist = [
13421350
os.path.dirname(package.path)
13431351
if hasattr(package, "path")
13441352
else package.filename
1345-
for package in (
1346-
pkgutil.find_loader(x)
1347-
for x in list(ComponentRegistry.registry) + ["dash_renderer"]
1348-
)
1353+
for package in packages
13491354
]
13501355

13511356
_reload.watch_thread = threading.Thread(

dash/testing/application_runners.py

+8-6
Original file line numberDiff line numberDiff line change
@@ -222,8 +222,7 @@ def stop(self):
222222
logger.info("proc.terminate with pid %s", self.proc.pid)
223223
self.proc.terminate()
224224
if self.tmp_app_path and os.path.exists(self.tmp_app_path):
225-
logger.debug("removing temporary app path %s",
226-
self.tmp_app_path)
225+
logger.debug("removing temporary app path %s", self.tmp_app_path)
227226
shutil.rmtree(self.tmp_app_path)
228227
if utils.PY3:
229228
# pylint:disable=no-member
@@ -343,7 +342,9 @@ def start(self, app, start_timeout=2, cwd=None):
343342

344343
class JuliaRunner(ProcessRunner):
345344
def __init__(self, keep_open=False, stop_timeout=3):
346-
super(JuliaRunner, self).__init__(keep_open=keep_open, stop_timeout=stop_timeout)
345+
super(JuliaRunner, self).__init__(
346+
keep_open=keep_open, stop_timeout=stop_timeout
347+
)
347348
self.proc = None
348349

349350
# pylint: disable=arguments-differ
@@ -385,7 +386,9 @@ def start(self, app, start_timeout=30, cwd=None):
385386
logger.warning("get cwd from inspect => %s", cwd)
386387
break
387388
if cwd:
388-
logger.info("JuliaRunner inferred cwd from the Python call stack: %s", cwd)
389+
logger.info(
390+
"JuliaRunner inferred cwd from the Python call stack: %s", cwd
391+
)
389392

390393
# try copying all valid sub folders (i.e. assets) in cwd to tmp
391394
# note that the R assets folder name can be any valid folder name
@@ -415,8 +418,7 @@ def start(self, app, start_timeout=30, cwd=None):
415418
logger.info("Run Dash.jl app with julia => %s", app)
416419

417420
args = shlex.split(
418-
"julia {}".format(os.path.realpath(app)),
419-
posix=not self.is_windows,
421+
"julia {}".format(os.path.realpath(app)), posix=not self.is_windows,
420422
)
421423
logger.debug("start Dash.jl process with %s", args)
422424

dash/testing/plugin.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,12 @@
44

55

66
try:
7-
from dash.testing.application_runners import ThreadedRunner, ProcessRunner, RRunner, JuliaRunner
7+
from dash.testing.application_runners import (
8+
ThreadedRunner,
9+
ProcessRunner,
10+
RRunner,
11+
JuliaRunner,
12+
)
813
from dash.testing.browser import Browser
914
from dash.testing.composite import DashComposite, DashRComposite, DashJuliaComposite
1015
except ImportError:

package.json

+9-4
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,21 @@
1010
"private::lint.pylint-dash": "PYLINTRC=${PYLINTRC:=.pylintrc37} && pylint dash setup.py --rcfile=$PYLINTRC",
1111
"private::lint.pylint-tests": "PYLINTRC=${PYLINTRC:=.pylintrc37} && pylint tests/unit tests/integration -d all --rcfile=$PYLINTRC",
1212
"private::lint.renderer": "cd dash-renderer && npm run lint",
13-
"private::test.setup-nested": "cd \\@plotly/dash-generator-test-component-nested && npm ci && npm run build && pip install -e .",
14-
"private::test.setup-standard": "cd \\@plotly/dash-generator-test-component-standard && npm ci && npm run build && pip install -e .",
13+
"private::test.setup-nested": "cd \\@plotly/dash-generator-test-component-nested && npm ci && npm run build",
14+
"private::test.setup-standard": "cd \\@plotly/dash-generator-test-component-standard && npm ci && npm run build",
15+
"private::test.py.deploy-nested": "npm run private::test.setup-nested && cd \\@plotly/dash-generator-test-component-nested && pip install -e .",
16+
"private::test.py.deploy-standard": "npm run private::test.setup-standard && cd \\@plotly/dash-generator-test-component-standard && pip install -e .",
17+
"private::test.R.deploy-nested": "npm run private::test.setup-nested && cd \\@plotly/dash-generator-test-component-nested && sudo R CMD INSTALL .",
18+
"private::test.R.deploy-standard": "npm run private::test.setup-standard && cd \\@plotly/dash-generator-test-component-standard && sudo R CMD INSTALL .",
1519
"private::test.unit-dash": "PYTHONPATH=~/dash/tests/assets pytest tests/unit",
1620
"private::test.unit-renderer": "cd dash-renderer && npm run test",
1721
"private::test.integration-dash": "TESTFILES=$(circleci tests glob \"tests/integration/**/test_*.py\" | circleci tests split --split-by=timings) && pytest --headless --nopercyfinalize --junitxml=test-reports/junit_intg.xml ${TESTFILES}",
1822
"format": "run-s private::format.*",
1923
"initialize": "run-s private::initialize.*",
2024
"lint": "run-s private::lint.*",
21-
"setup-tests": "run-s private::test.setup-*",
22-
"test.integration": "run-s setup-tests private::test.integration-*",
25+
"setup-tests.py": "run-s private::test.py.deploy-*",
26+
"setup-tests.R": "run-s private::test.R.deploy-*",
27+
"test.integration": "run-s setup-tests.py private::test.integration-*",
2328
"test.unit": "run-s private::test.unit-**"
2429
},
2530
"devDependencies": {

tests/integration/devtools/test_hot_reload.py

+3-5
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,7 @@
2020

2121

2222
def replace_file(filename, new_content):
23-
path = os.path.join(
24-
os.path.dirname(__file__), "hr_assets", filename
25-
)
23+
path = os.path.join(os.path.dirname(__file__), "hr_assets", filename)
2624
with open(path, "r+") as fp:
2725
sleep(1) # ensure a new mod time
2826
old_content = fp.read()
@@ -92,7 +90,7 @@ def new_text(n):
9290
try:
9391
until(
9492
lambda: dash_duo.driver.execute_script("return window.cheese") == "gouda",
95-
timeout=3
93+
timeout=3,
9694
)
9795
finally:
9896
sleep(1) # ensure a new mod time
@@ -101,7 +99,7 @@ def new_text(n):
10199

102100
until(
103101
lambda: dash_duo.driver.execute_script("return window.cheese") == "roquefort",
104-
timeout=3
102+
timeout=3,
105103
)
106104

107105
# we've done a hard reload so someVar is gone

0 commit comments

Comments
 (0)