Skip to content

Commit ce62e5f

Browse files
committed
Skip js if exists
1 parent d073ffe commit ce62e5f

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[build-system]
2-
requires = ["jupyter_packaging~=0.7.0", "jupyterlab>=3.0.0rc10,==3.*", "setuptools>=40.8.0", "wheel"]
2+
requires = ["jupyter_packaging~=0.7.7", "jupyterlab>=3.0.0rc10,==3.*", "setuptools>=40.8.0", "wheel"]
33
build-backend = "setuptools.build_meta"

setup.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
import os
2-
from glob import glob
32

43
import setuptools
54
from jupyter_packaging import combine_commands
65
from jupyter_packaging import create_cmdclass
76
from jupyter_packaging import ensure_targets
8-
from jupyter_packaging import get_version
97
from jupyter_packaging import install_npm
8+
from jupyter_packaging import skip_if_exists
109

1110
# The directory containing this file
1211
HERE = os.path.abspath(os.path.dirname(__file__))
@@ -55,11 +54,17 @@
5554
"jsdeps", package_data_spec=package_data_spec, data_files_spec=data_files_spec
5655
)
5756

58-
cmdclass["jsdeps"] = combine_commands(
57+
js_command = combine_commands(
5958
install_npm(src_path, build_cmd="build:prod", npm=["jlpm"]),
6059
ensure_targets(jstargets),
6160
)
6261

62+
is_repo = os.path.exists(os.path.join(HERE, ".git"))
63+
if is_repo:
64+
cmdclass["jsdeps"] = js_command
65+
else:
66+
cmdclass["jsdeps"] = skip_if_exists(jstargets, js_command)
67+
6368
with open("README.md", "r") as fh:
6469
long_description = fh.read()
6570

0 commit comments

Comments
 (0)