Skip to content

Commit

Permalink
Fix build issues
Browse files Browse the repository at this point in the history
  • Loading branch information
krishnan-r committed Nov 22, 2021
1 parent 2b7e74e commit a12b854
Showing 1 changed file with 11 additions and 16 deletions.
27 changes: 11 additions & 16 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,35 +1,31 @@
import json
from pathlib import Path

from jupyter_packaging import wrap_installers, npm_builder, get_data_files
from setuptools import find_packages, setup


HERE = Path(__file__).parent.resolve()

lab_path = HERE / "sparkmonitor" / "labextension"

ensured_targets = [
str(lab_path / "package.json"),
str(HERE / "sparkmonitor" / "static/extension.js"),
str(HERE / "sparkmonitor" / "listener_2.11.jar"),
str(HERE / "sparkmonitor" / "listener_2.12.jar")
]

data_file_spec = [
(f"share/jupyter/labextensions/sparkmonitor", str(lab_path), "**"),
(f"share/jupyter/labextensions/sparkmonitor", str(HERE), "install.json"),
]


builder = npm_builder(build_cmd="build:prod", build_dir=lab_path, source_dir="src")

cmdclass = wrap_installers(post_develop=builder, ensured_targets=ensured_targets)

long_description = (HERE / "README.md").read_text()

pkg_json = json.loads((HERE / "package.json").read_bytes())

try:
from jupyter_packaging import wrap_installers, npm_builder, get_data_files
builder = npm_builder(build_cmd="build:prod", build_dir=lab_path, source_dir="src")
cmdclass = wrap_installers(pre_dist=builder, ensured_targets=ensured_targets)
data_files=get_data_files(data_file_spec)
except ImportError:
cmdclass={}
data_files=[]

setup(
name=pkg_json["name"],
version=pkg_json["version"],
Expand All @@ -47,10 +43,9 @@
license=pkg_json["license"],
zip_safe=False,
python_requires=">=3.6",
data_files=get_data_files(data_file_spec),
data_files=data_files,
install_requires=[
"jupyterlab~=3.0",
"jupyter_packaging~=0.9,<2",
"jupyterlab~=3.0"
],
platforms="Linux, Mac OS X, Windows",
keywords=["Jupyter", "JupyterLab", "JupyterLab3"],
Expand Down

0 comments on commit a12b854

Please sign in to comment.