Skip to content

Commit c1422cb

Browse files
committed
Force error on import * from the .py file. Update tests.
We *want* users to be able to do: ```python from plotly.graph_objs import * ``` NO ONE should do: ```python from plotly.graph_objs.graph_objs import * ``` The former is a nicely-controlled namespace. The latter is not.
1 parent 02cfc3a commit c1422cb

File tree

4 files changed

+5
-35
lines changed

4 files changed

+5
-35
lines changed

plotly/graph_objs/graph_objs.py

Lines changed: 1 addition & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -40,37 +40,7 @@
4040
from collections import OrderedDict
4141
import json
4242

43-
__all__ = ["Data",
44-
"Annotations",
45-
"Area",
46-
"Bar",
47-
"Box",
48-
"Contour",
49-
"Heatmap",
50-
"Histogram",
51-
"Histogram2d",
52-
"Histogram2dContour",
53-
"Scatter",
54-
"Annotation",
55-
"AngularAxis",
56-
"ColorBar",
57-
"Contours",
58-
"ErrorX",
59-
"ErrorY",
60-
"Figure",
61-
"Font",
62-
"Layout",
63-
"Legend",
64-
"Line",
65-
"Margin",
66-
"Marker",
67-
"RadialAxis",
68-
"Stream",
69-
"Trace",
70-
"XAxis",
71-
"XBins",
72-
"YAxis",
73-
"YBins"]
43+
__all__ = None
7444

7545
# TODO: BIG ONE, how should exceptions bubble up in this inheritance scheme?
7646
# TODO: related, WHAT exceptions should bubble up?

plotly/tests/test_core/test_graph_objs/test_annotations.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from __future__ import absolute_import
99

1010
from nose.tools import raises
11-
from plotly.graph_objs.graph_objs import *
11+
from plotly.graph_objs import *
1212
from plotly.exceptions import (PlotlyError,
1313
PlotlyDictKeyError,
1414
PlotlyDictValueError,

plotly/tests/test_core/test_graph_objs/test_data.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from __future__ import absolute_import
99

1010
from nose.tools import raises
11-
from plotly.graph_objs.graph_objs import *
11+
from plotly.graph_objs import *
1212
from plotly.exceptions import (PlotlyError,
1313
PlotlyDictKeyError,
1414
PlotlyDictValueError,

plotly/tests/test_core/test_graph_objs/test_error_bars.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from __future__ import absolute_import
99

1010
from nose.tools import raises
11-
from plotly.graph_objs.graph_objs import *
11+
from plotly.graph_objs import *
1212
from plotly.exceptions import (PlotlyDictKeyError,
1313
PlotlyDictValueError,
1414
PlotlyDataTypeError,
@@ -48,4 +48,4 @@ def test_instantiate_error_y():
4848

4949
@raises(PlotlyDictKeyError)
5050
def test_key_error():
51-
ErrorX(value=0.1, typ='percent', color='red')
51+
ErrorX(value=0.1, typ='percent', color='red')

0 commit comments

Comments
 (0)