File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change 6
6
from jupyter_packaging import (
7
7
create_cmdclass , install_npm , ensure_targets ,
8
8
combine_commands , ensure_python , get_version ,
9
+ skip_if_exists
9
10
)
10
11
import setuptools
11
12
49
50
# if the static assets already exist, do not invoke npm so we can make a wheel
50
51
# from the sdist package, since the npm build really only works from this
51
52
# repo.
52
- jsbuild = []
53
- if all ( os . path . exists ( f ) for f in jstargets ):
54
- jsbuild . append ( install_npm ( HERE , build_cmd = "build:prod" , npm = [ "jlpm" ]))
55
- jsbuild . append ( ensure_targets ( jstargets ) )
53
+ js_command = combine_commands (
54
+ install_npm ( HERE , build_cmd = "build:prod" , npm = [ "jlpm" ]),
55
+ ensure_targets ( jstargets ),
56
+ )
56
57
57
- cmdclass ["jsdeps" ] = combine_commands (* jsbuild )
58
+ is_repo = os .path .exists (os .path .join (HERE , os .pardir , ".git" ))
59
+ if is_repo :
60
+ cmdclass ["jsdeps" ] = js_command
61
+ else :
62
+ cmdclass ["jsdeps" ] = skip_if_exists (jstargets , js_command )
58
63
59
64
with open ("README.md" , "r" ) as fh :
60
65
long_description = fh .read ()
You can’t perform that action at this time.
0 commit comments