Skip to content

Commit 09f68fd

Browse files
authored
Relax dash dependency (#11)
1 parent cae3f0a commit 09f68fd

File tree

6 files changed

+13
-27
lines changed

6 files changed

+13
-27
lines changed

.travis.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ before_install:
1515
- sudo apt-get install node
1616
- export DISPLAY=:99.0
1717
- sh -e /etc/init.d/xvfb start
18+
- pip freeze | grep -vw "pip" | xargs pip uninstall -y
19+
- pip install --upgrade pip
1820

1921
install:
2022
- pip install .[tests]

setup.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
package_name = package['name'].replace(' ', '_').replace('-', '_')
1313

1414
install_requires = [
15-
'dash==0.41' # Same dependency as of webviz-config (to be relaxed)
15+
'dash~=1.0.0'
1616
]
1717

1818
tests_require = [
@@ -21,8 +21,7 @@
2121
'percy',
2222
'selenium',
2323
'flake8',
24-
'pylint',
25-
'pytest-dash>=2.1.1'
24+
'pylint'
2625
]
2726

2827
setup(

tests/test_hm.py

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,9 @@
22
from dash.dependencies import Input, Output
33
import webviz_subsurface_components
44
import dash_html_components as html
5-
from pytest_dash.wait_for import (
6-
wait_for_text_to_equal,
7-
wait_for_element_by_css_selector
8-
)
9-
from pytest_dash.application_runners import import_app
105

116
# Basic test for the component rendering.
12-
def test_render_hm(dash_threaded):
13-
# dash_threaded is a fixture by pytest-dash
7+
def test_render_hm(dash_duo):
148

159
with open('tests/data/hm_data.json', 'r') as f:
1610
hm_data = f.read()
@@ -23,10 +17,9 @@ def test_render_hm(dash_threaded):
2317
data=hm_data),
2418
])
2519

26-
driver = dash_threaded.driver
27-
dash_threaded(app)
20+
dash_duo.start_server(app)
2821

2922
# Get text of first data series
30-
my_component = wait_for_element_by_css_selector(driver, '#g_history_matching_plot > text')
23+
my_component = dash_duo.wait_for_element_by_css_selector('#g_history_matching_plot > text', timeout=4)
3124

3225
assert 'Misfit overview for Iteration 0' == my_component.text

tests/test_morris.py

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,9 @@
33
import webviz_subsurface_components
44
import json
55
import dash_html_components as html
6-
from pytest_dash.wait_for import (
7-
wait_for_text_to_equal,
8-
wait_for_element_by_css_selector
9-
)
10-
from pytest_dash.application_runners import import_app
116

127
# Basic test for the component rendering.
13-
def test_render(dash_threaded):
14-
# dash_threaded is a fixture by pytest-dash
8+
def test_render(dash_duo):
159

1610
with open('tests/data/morris_data.json', 'r') as f:
1711
data = json.loads(f.read())
@@ -25,12 +19,10 @@ def test_render(dash_threaded):
2519
parameter=data['parameter'])
2620
])
2721

28-
driver = dash_threaded.driver
29-
dash_threaded(app)
22+
dash_duo.start_server(app)
3023

3124
# Get y-axis text with selenium
32-
my_component = wait_for_element_by_css_selector(
33-
driver,
25+
my_component = dash_duo.wait_for_element_by_css_selector(
3426
'#sensitivity-slider-plot__graph-container > svg > g > text')
3527

3628
assert 'FOPT' == my_component.text

webviz_subsurface_components/Map.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class Map(Component):
1313
components in an app.
1414
- data (dict; required): The data the Map component should render (JSON format).
1515
- height (number; optional): The height of the Map component
16-
- layerNames (list; optional): The name of individual layers"""
16+
- layerNames (list of strings; optional): The name of individual layers"""
1717
@_explicitize_args
1818
def __init__(self, id=Component.REQUIRED, data=Component.REQUIRED, height=Component.UNDEFINED, layerNames=Component.UNDEFINED, **kwargs):
1919
self._prop_names = ['id', 'data', 'height', 'layerNames']

webviz_subsurface_components/Morris.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ class Morris(Component):
1010
Keyword arguments:
1111
- id (string; required)
1212
- parameter (string; optional)
13-
- output (list; optional)
14-
- parameters (list; optional)
13+
- output (list of dicts; optional)
14+
- parameters (list of dicts; optional)
1515
- height (number; optional)"""
1616
@_explicitize_args
1717
def __init__(self, id=Component.REQUIRED, parameter=Component.UNDEFINED, output=Component.UNDEFINED, parameters=Component.UNDEFINED, height=Component.UNDEFINED, **kwargs):

0 commit comments

Comments
 (0)