Skip to content

Commit 71fe11c

Browse files
author
Frédéric Collonval
committed
Skip building JS assets except in plotlyjs_dev_build
1 parent ab9feef commit 71fe11c

File tree

4 files changed

+50
-13
lines changed

4 files changed

+50
-13
lines changed

.circleci/config.yml

Lines changed: 33 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,12 @@ jobs:
2626
- checkout
2727
- run:
2828
name: Install tox
29-
command: "sudo pip install tox jupyterlab~=3.0"
29+
command: "sudo pip install tox"
3030
- run:
3131
name: Test with tox
3232
command: "cd packages/python/plotly; tox -e py27-core"
33+
environment:
34+
SKIP_NPM: 1
3335
no_output_timeout: 20m
3436

3537
python-3.5-core:
@@ -43,10 +45,12 @@ jobs:
4345
- checkout
4446
- run:
4547
name: Install tox
46-
command: "sudo pip install tox jupyterlab~=3.0"
48+
command: "sudo pip install tox"
4749
- run:
4850
name: Test with tox
4951
command: "cd packages/python/plotly; tox -e py35-core"
52+
environment:
53+
SKIP_NPM: 1
5054
no_output_timeout: 20m
5155

5256
python-3.6-core:
@@ -60,10 +64,12 @@ jobs:
6064
- checkout
6165
- run:
6266
name: Install tox
63-
command: "sudo pip install tox jupyterlab~=3.0"
67+
command: "sudo pip install tox"
6468
- run:
6569
name: Test with tox
6670
command: "cd packages/python/plotly; tox -e py36-core"
71+
environment:
72+
SKIP_NPM: 1
6773
no_output_timeout: 20m
6874

6975
python-3.7-core:
@@ -77,10 +83,12 @@ jobs:
7783
- checkout
7884
- run:
7985
name: Install tox
80-
command: "sudo pip install tox jupyterlab~=3.0"
86+
command: "sudo pip install tox"
8187
- run:
8288
name: Test with tox
8389
command: "cd packages/python/plotly; tox -e py37-core"
90+
environment:
91+
SKIP_NPM: 1
8492
no_output_timeout: 20m
8593

8694
python-3.7-percy:
@@ -128,10 +136,12 @@ jobs:
128136
- checkout
129137
- run:
130138
name: Install tox
131-
command: "sudo pip install tox jupyterlab~=3.0"
139+
command: "sudo pip install tox"
132140
- run:
133141
name: Test with tox
134142
command: "cd packages/python/plotly; tox -e py27-optional"
143+
environment:
144+
SKIP_NPM: 1
135145
no_output_timeout: 20m
136146

137147
python-3.5-optional:
@@ -145,10 +155,12 @@ jobs:
145155
- checkout
146156
- run:
147157
name: Install tox
148-
command: "sudo pip install tox jupyterlab~=3.0"
158+
command: "sudo pip install tox"
149159
- run:
150160
name: Test with tox
151161
command: "cd packages/python/plotly; tox -e py35-optional"
162+
environment:
163+
SKIP_NPM: 1
152164
no_output_timeout: 20m
153165

154166
python-3.6-optional:
@@ -162,10 +174,12 @@ jobs:
162174
- checkout
163175
- run:
164176
name: Install tox
165-
command: "sudo pip install tox jupyterlab~=3.0"
177+
command: "sudo pip install tox"
166178
- run:
167179
name: Test with tox
168180
command: "cd packages/python/plotly; tox -e py36-optional"
181+
environment:
182+
SKIP_NPM: 1
169183
no_output_timeout: 20m
170184

171185
python-3.7-optional:
@@ -179,10 +193,12 @@ jobs:
179193
- checkout
180194
- run:
181195
name: Install tox
182-
command: "sudo pip install tox jupyterlab~=3.0"
196+
command: "sudo pip install tox"
183197
- run:
184198
name: Test with tox
185199
command: "cd packages/python/plotly; tox -e py37-optional"
200+
environment:
201+
SKIP_NPM: 1
186202
no_output_timeout: 20m
187203

188204
# Plot.ly
@@ -197,10 +213,12 @@ jobs:
197213
- checkout
198214
- run:
199215
name: Install tox
200-
command: "sudo pip install tox jupyterlab~=3.0"
216+
command: "sudo pip install tox"
201217
- run:
202218
name: Test with tox
203219
command: "cd packages/python/chart-studio; tox -e py27-plot_ly"
220+
environment:
221+
SKIP_NPM: 1
204222
no_output_timeout: 20m
205223

206224
python-3.5-plot_ly:
@@ -214,10 +232,12 @@ jobs:
214232
- checkout
215233
- run:
216234
name: Install tox
217-
command: "sudo pip install tox jupyterlab~=3.0"
235+
command: "sudo pip install tox"
218236
- run:
219237
name: Test with tox
220238
command: "cd packages/python/chart-studio; tox -e py35-plot_ly"
239+
environment:
240+
SKIP_NPM: 1
221241
no_output_timeout: 20m
222242

223243
python-3.7-plot_ly:
@@ -231,10 +251,12 @@ jobs:
231251
- checkout
232252
- run:
233253
name: Install tox
234-
command: "sudo pip install tox jupyterlab~=3.0"
254+
command: "sudo pip install tox"
235255
- run:
236256
name: Test with tox
237257
command: "cd packages/python/chart-studio; tox -e py37-plot_ly"
258+
environment:
259+
SKIP_NPM: 1
238260
no_output_timeout: 20m
239261

240262
python-2-7-orca:

packages/python/chart-studio/tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ envlist = py{27,34,37}-plot_ly
4545

4646
; These commands are general and will be run for *all* environments.
4747
[testenv]
48-
passenv=PLOTLY_TOX_*
48+
passenv=PLOTLY_TOX_* SKIP_NPM
4949
whitelist_externals=
5050
mkdir
5151
deps=

packages/python/plotly/setup.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,17 @@
2929
)
3030

3131
labstatic = "plotlywidget/labextension/static"
32+
if not os.path.exists(labstatic):
33+
# Ensure the folder exists when we will look for files in it
34+
os.makedirs(labstatic)
35+
36+
if "--skip-npm" in sys.argv or os.environ.get("SKIP_NPM") is not None:
37+
print("Skipping npm install as requested.")
38+
skip_npm = True
39+
if "--skip-npm" in sys.argv:
40+
sys.argv.remove("--skip-npm")
41+
else:
42+
skip_npm = False
3243

3344
# Load plotly.js version from js/package.json
3445
def plotly_js_version():
@@ -133,6 +144,10 @@ def should_run_npm_install(self):
133144
return self.has_npm()
134145

135146
def run(self):
147+
if skip_npm:
148+
log.info("Skipping npm-installation")
149+
return
150+
136151
has_npm = self.has_npm()
137152
if not has_npm:
138153
log.error(

packages/python/plotly/tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ envlist = py{27,34,35,36,37}-{core,optional},py{27,34,37}
4545

4646
; These commands are general and will be run for *all* environments.
4747
[testenv]
48-
passenv=PLOTLY_TOX_*
48+
passenv=PLOTLY_TOX_* SKIP_NPM
4949
whitelist_externals=
5050
mkdir
5151
deps=

0 commit comments

Comments
 (0)