@@ -92,13 +92,26 @@ def update_package_data(distribution):
92
92
"""update package_data to catch changes during setup"""
93
93
build_py = distribution .get_command_obj ("build_py" )
94
94
95
- # Add JupyterLab extension static files as their names are unknown
96
- distribution .data_files .append (
97
- (
98
- "share/jupyter/labextensions/plotlywidget/static" ,
99
- [os .path .join (labstatic , f ) for f in os .listdir (labstatic )],
95
+ # JS assets will not be present if we are skip npm build
96
+ if not skip_npm :
97
+ distribution .data_files .append (
98
+ (
99
+ "share/jupyter/labextensions/plotlywidget" ,
100
+ ["plotlywidget/labextension/package.json" ,],
101
+ ),
102
+ (
103
+ "share/jupyter/labextensions/plotlywidget/static" ,
104
+ [os .path .join (labstatic , f ) for f in os .listdir (labstatic )],
105
+ ),
106
+ (
107
+ "share/jupyter/nbextensions/plotlywidget" ,
108
+ [
109
+ "plotlywidget/nbextension/extension.js" ,
110
+ "plotlywidget/nbextension/index.js" ,
111
+ "plotlywidget/nbextension/index.js.LICENSE.txt" ,
112
+ ],
113
+ ),
100
114
)
101
- )
102
115
103
116
# re-init build_py options which load package_data
104
117
build_py .finalize_options ()
@@ -531,21 +544,7 @@ def run(self):
531
544
],
532
545
"plotlywidget" : ["nbextension/*" , "labextension/*" , "labextension/static/*" ],
533
546
},
534
- data_files = [
535
- (
536
- "share/jupyter/labextensions/plotlywidget" ,
537
- ["plotlywidget/labextension/package.json" ,],
538
- ),
539
- (
540
- "share/jupyter/nbextensions/plotlywidget" ,
541
- [
542
- "plotlywidget/nbextension/extension.js" ,
543
- "plotlywidget/nbextension/index.js" ,
544
- "plotlywidget/nbextension/index.js.LICENSE.txt" ,
545
- ],
546
- ),
547
- ("etc/jupyter/nbconfig/notebook.d" , ["plotlywidget.json" ]),
548
- ],
547
+ data_files = [("etc/jupyter/nbconfig/notebook.d" , ["plotlywidget.json" ]),],
549
548
install_requires = ["retrying>=1.3.3" , "six" ],
550
549
zip_safe = False ,
551
550
cmdclass = dict (
0 commit comments