Skip to content

Commit 4f8f682

Browse files
committed
lab 3 update
1 parent 13490ad commit 4f8f682

File tree

8 files changed

+256
-396
lines changed

8 files changed

+256
-396
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ node_modules/
55
.ipynb_checkpoints
66
*.tsbuildinfo
77

8+
jupyterlab_interactive_dashboard_editor/labextension
9+
810
*/labextension/*.tgz
911
# Created by https://www.gitignore.io/api/python
1012
# Edit at https://www.gitignore.io/?templates=python

MANIFEST.in

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,6 @@
11
include LICENSE
22
include README.md
33
include pyproject.toml
4+
include install.json
45

5-
include jupyter-config/jupyterlab_interactive_dashboard_editor.json
6-
7-
include package.json
8-
include ts*.json
9-
include jupyterlab_interactive_dashboard_editor/labextension/*.tgz
10-
11-
# Javascript files
12-
graft src
13-
graft style
14-
prune **/node_modules
15-
prune lib
16-
17-
# Patterns to exclude from any directory
18-
global-exclude *~
19-
global-exclude *.pyc
20-
global-exclude *.pyo
21-
global-exclude .git
22-
global-exclude .ipynb_checkpoints
6+
graft jupyterlab_interactive_dashboard_editor/labextension

install.json

Lines changed: 0 additions & 5 deletions
This file was deleted.

jupyterlab-interactive-dashboard-editor/__init__.py renamed to jupyterlab_interactive_dashboard_editor/__init__.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,3 @@ def _jupyter_labextension_paths():
1414
'src': 'labextension',
1515
'dest': data['name']
1616
}]
17-
18-
19-

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"scripts": {
2929
"build": "jlpm run build:lib",
3030
"build:all": "jlpm run build:labextension",
31-
"build:labextension": "cd jupyterlab_interactive_dashboard_editor && rimraf labextension && mkdirp labextension && cd labextension && npm pack ../..",
31+
"build:labextension": "jlpm run clean:all && jlpm run build && jupyter labextension build .",
3232
"build:lib": "tsc",
3333
"clean": "jlpm run clean:lib",
3434
"clean:all": "jlpm run clean:lib && jlpm run clean:labextension",
@@ -75,8 +75,8 @@
7575
"style/index.js"
7676
],
7777
"jupyterlab": {
78-
"extension": true,
79-
"outputDir": "jupyterlab-interactive-dashboard-editor/labextension"
78+
"extension": "lib",
79+
"outputDir": "jupyterlab_interactive_dashboard_editor/labextension"
8080
},
8181
"husky": {
8282
"hooks": {
@@ -87,4 +87,4 @@
8787
"*.{js,jsx,ts,tsx}": "eslint --cache --fix"
8888
},
8989
"styleModule": "style/index.js"
90-
}
90+
}

setup.py

Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,59 +2,61 @@
22
jupyterlab-interactive-dashboard-editor setup
33
"""
44
import json
5-
import os
5+
from os import path
66

77
from jupyter_packaging import (
88
create_cmdclass, install_npm, ensure_targets,
99
combine_commands, skip_if_exists
1010
)
11+
1112
import setuptools
1213

13-
HERE = os.path.abspath(os.path.dirname(__file__))
14+
HERE = path.abspath(path.dirname(__file__))
1415

1516
# The name of the project
16-
name="jupyterlab-interactive-dashboard-editor"
17+
name = "jupyterlab-interactive-dashboard-editor"
18+
module = "jupyterlab_interactive_dashboard_editor"
19+
labext_name = "jupyterlab-interactive-dashboard-editor"
1720

1821
# Get our version
19-
with open(os.path.join(HERE, 'package.json')) as f:
22+
with open(path.join(HERE, 'package.json')) as f:
2023
version = json.load(f)['version']
2124

22-
lab_path = os.path.join(HERE, name, "labextension")
25+
lab_path = path.join(HERE, module, "labextension")
2326

2427
# Representative files that should exist after a successful build
2528
jstargets = [
26-
os.path.join(lab_path, "package.json"),
29+
path.join(lab_path, "package.json"),
2730
]
2831

2932
package_data_spec = {
30-
name: [
31-
"*"
33+
module: [
34+
"labextension/*"
3235
]
3336
}
3437

35-
labext_name = "jupyterlab-interactive-dashboard-editor"
3638

3739
data_files_spec = [
38-
("share/jupyter/labextensions/%s" % labext_name, lab_path, "**"),
39-
("share/jupyter/labextensions/%s" % labext_name, HERE, "install.json"),
40+
("share/jupyter/labextensions/%s" % labext_name, lab_path, "**")
4041
]
4142

42-
cmdclass = create_cmdclass("jsdeps",
43+
44+
cmdclass = create_cmdclass("js",
4345
package_data_spec=package_data_spec,
4446
data_files_spec=data_files_spec
4547
)
4648

47-
js_command = combine_commands(
48-
install_npm(HERE, build_cmd="build:prod", npm=["jlpm"]),
49+
cmdclass['js'] = combine_commands(
50+
install_npm(
51+
path=HERE,
52+
npm=["jlpm"],
53+
build_cmd="build:labextension",
54+
build_dir=path.join(HERE, 'dist'),
55+
source_dir=path.join(HERE, 'src')
56+
),
4957
ensure_targets(jstargets),
5058
)
5159

52-
is_repo = os.path.exists(os.path.join(HERE, ".git"))
53-
if is_repo:
54-
cmdclass["jsdeps"] = js_command
55-
else:
56-
cmdclass["jsdeps"] = skip_if_exists(jstargets, js_command)
57-
5860
with open("README.md", "r") as fh:
5961
long_description = fh.read()
6062

@@ -64,9 +66,9 @@
6466
url="https://github.com/jupytercalpoly/jupyterlab-interactive-dashboard-editor.git",
6567
author="jupytercalpoly",
6668
description="Interactively create and customize dashboards in JupyterLab",
67-
long_description= long_description,
69+
long_description=long_description,
6870
long_description_content_type="text/markdown",
69-
cmdclass= cmdclass,
71+
cmdclass=cmdclass,
7072
packages=setuptools.find_packages(),
7173
install_requires=[
7274
"jupyterlab>=3.0.0rc13,==3.*",
@@ -88,6 +90,5 @@
8890
],
8991
)
9092

91-
9293
if __name__ == "__main__":
9394
setuptools.setup(**setup_args)

0 commit comments

Comments
 (0)