Skip to content

Commit a12b854

Browse files
committed
Fix build issues
1 parent 2b7e74e commit a12b854

File tree

1 file changed

+11
-16
lines changed

1 file changed

+11
-16
lines changed

setup.py

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,31 @@
11
import json
22
from pathlib import Path
3-
4-
from jupyter_packaging import wrap_installers, npm_builder, get_data_files
53
from setuptools import find_packages, setup
64

7-
85
HERE = Path(__file__).parent.resolve()
9-
106
lab_path = HERE / "sparkmonitor" / "labextension"
11-
127
ensured_targets = [
138
str(lab_path / "package.json"),
149
str(HERE / "sparkmonitor" / "static/extension.js"),
1510
str(HERE / "sparkmonitor" / "listener_2.11.jar"),
1611
str(HERE / "sparkmonitor" / "listener_2.12.jar")
1712
]
18-
1913
data_file_spec = [
2014
(f"share/jupyter/labextensions/sparkmonitor", str(lab_path), "**"),
2115
(f"share/jupyter/labextensions/sparkmonitor", str(HERE), "install.json"),
2216
]
23-
24-
25-
builder = npm_builder(build_cmd="build:prod", build_dir=lab_path, source_dir="src")
26-
27-
cmdclass = wrap_installers(post_develop=builder, ensured_targets=ensured_targets)
28-
2917
long_description = (HERE / "README.md").read_text()
30-
3118
pkg_json = json.loads((HERE / "package.json").read_bytes())
3219

20+
try:
21+
from jupyter_packaging import wrap_installers, npm_builder, get_data_files
22+
builder = npm_builder(build_cmd="build:prod", build_dir=lab_path, source_dir="src")
23+
cmdclass = wrap_installers(pre_dist=builder, ensured_targets=ensured_targets)
24+
data_files=get_data_files(data_file_spec)
25+
except ImportError:
26+
cmdclass={}
27+
data_files=[]
28+
3329
setup(
3430
name=pkg_json["name"],
3531
version=pkg_json["version"],
@@ -47,10 +43,9 @@
4743
license=pkg_json["license"],
4844
zip_safe=False,
4945
python_requires=">=3.6",
50-
data_files=get_data_files(data_file_spec),
46+
data_files=data_files,
5147
install_requires=[
52-
"jupyterlab~=3.0",
53-
"jupyter_packaging~=0.9,<2",
48+
"jupyterlab~=3.0"
5449
],
5550
platforms="Linux, Mac OS X, Windows",
5651
keywords=["Jupyter", "JupyterLab", "JupyterLab3"],

0 commit comments

Comments
 (0)