Skip to content
This repository was archived by the owner on Jun 3, 2024. It is now read-only.

use dash loosen-testing-reqs branch and fix linting #907

Merged
merged 8 commits into from
Dec 17, 2020
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
command: |
sudo pip install virtualenv --upgrade
python -m venv venv || virtualenv venv && . venv/bin/activate
pip install --progress-bar off -e git+https://github.com/plotly/dash.git@dev#egg=dash[dev,testing]
pip install --progress-bar off -e git+https://github.com/plotly/dash.git@loosen-testing-reqs#egg=dash[dev,testing]
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can revert these branches and merge this PR even before plotly/dash#1506 merges, because all I'm doing here is adding more linting exclusions and making tests more robust.

pip install --progress-bar off --no-cache-dir -r dev-requirements.txt
- save_cache:
key: dep-{{ checksum ".circleci/config.yml" }}-{{ checksum "ver.txt" }}-{{ checksum "dev-requirements.txt" }}
Expand Down Expand Up @@ -98,7 +98,7 @@ jobs:
. venv/bin/activate && mkdir packages
set -eo pipefail
# build main dash
git clone --depth 1 https://github.com/plotly/dash.git dash-main
git clone --depth 1 -b loosen-testing-reqs https://github.com/plotly/dash.git dash-main
cd dash-main && pip install -e .[dev] --progress-bar off && python setup.py sdist && mv dist/* ../packages/
cd dash-renderer && npm ci && npm run build
python setup.py sdist && mv dist/* ../../packages/ && cd ../..
Expand Down
2 changes: 1 addition & 1 deletion dash_core_components_base/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"named \n'dash.py' in your current directory.", file=_sys.stderr)
_sys.exit(1)

from ._imports_ import * # noqa: F401, F403
from ._imports_ import * # noqa: F401, F403, E402
from ._imports_ import __all__ # noqa: E402

_current_path = _os.path.dirname(_os.path.abspath(__file__))
Expand Down
4 changes: 2 additions & 2 deletions dev-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pandas
xlrd
xlrd<2
mimesis;python_version>="3.6"
virtualenv;python_version=="2.7"
virtualenv;python_version=="2.7"
1 change: 1 addition & 0 deletions tests/integration/location/test_location_callback.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ def update_pathname(n_clicks, current_pathname):

dash_dcc.start_server(app)

dash_dcc.wait_for_text_to_equal("#test-pathname", "/")
dash_dcc.percy_snapshot("link -- location")

# Check that link updates pathname
Expand Down
27 changes: 12 additions & 15 deletions tests/integration/upload/test_upload_different_file_types.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import io
import base64
import os
import time
import pytest
import pandas as pd

Expand All @@ -24,29 +23,26 @@ def load_table(filetype, payload):
)

return html.Div(
[
DataTable(
data=df.to_dict("records"),
columns=[{"id": i} for i in ["city", "country"]],
),
html.Hr(),
html.Div("Raw Content"),
html.Pre(payload, style=pre_style),
]
DataTable(
data=df.to_dict("records"),
columns=[{"id": i} for i in ["city", "country"]],
)
)


def load_data_by_type(filetype, contents):
children = []
_type, payload = contents.split(",")
if filetype in {"csv", "xlsx", "xls"}:
return load_table(filetype, payload)
children = [load_table(filetype, payload)]
elif filetype in {"png", "svg"}:
children = [html.Img(src=contents)]

children.extend(
(html.Hr(), html.Div("Raw Content"), html.Pre(payload, style=pre_style))
)
children += [
html.Hr(),
html.Div("Raw Content", id="raw-title"),
html.Pre(payload, style=pre_style),
]
return html.Div(children)


Expand Down Expand Up @@ -92,5 +88,6 @@ def update_output(contents):

upload_div = dash_dcc.wait_for_element("#upload-div input[type=file]")
upload_div.send_keys(filepath)
time.sleep(0.5)

dash_dcc.wait_for_text_to_equal("#raw-title", "Raw Content")
dash_dcc.percy_snapshot(filepath)