Skip to content

Commit b7c9fb5

Browse files
committed
Refactor: add py_path global to point to HERE/js
1 parent 5611987 commit b7c9fb5

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

setup.py

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@
2222

2323
HERE = Path(__file__).parent.resolve()
2424
name = 'pythreejs'
25-
lab_path = (HERE / name / "labextension")
25+
py_path = (HERE / name)
26+
js_path = (HERE / "js")
27+
lab_path = (py_path / "labextension")
2628

2729
version = get_version(HERE / name / '_version.py')
2830

@@ -33,25 +35,25 @@
3335
("share/jupyter/labextensions/jupyter-threejs", str(lab_path), "**"),
3436
("share/jupyter/labextensions/jupyter-threejs", str(HERE), "install.json"),
3537
# Support JupyterLab 2.x
36-
('share/jupyter/lab/extensions', str(HERE/'js'/'lab-dist'), 'jupyter-threejs-*.tgz'),
38+
('share/jupyter/lab/extensions', str(js_path/'lab-dist'), 'jupyter-threejs-*.tgz'),
3739
# Support Jupyter Notebook
3840
('etc/jupyter/nbconfig', str(HERE/'jupyter-config'), '**/*.json'),
39-
('share/jupyter/nbextensions/jupyter-threejs', str(HERE/name/'static'), '**/*.js'),
40-
('share/jupyter/nbextensions/jupyter-threejs', str(HERE/name/'static'), '**/*.js.map')
41+
('share/jupyter/nbextensions/jupyter-threejs', str(py_path/'static'), '**/*.js'),
42+
('share/jupyter/nbextensions/jupyter-threejs', str(py_path/'static'), '**/*.js.map')
4143
],
4244
)
4345
cmdclass['js'] = combine_commands(
4446
install_npm(
45-
path=str(HERE/'js'),
46-
build_dir=str(HERE/'name'/'static'),
47-
source_dir=str(HERE/'js'),
47+
path=str(js_path),
48+
build_dir=str(py_path/'static'),
49+
source_dir=str(js_path),
4850
build_cmd='build:all'
4951
),
5052
ensure_targets([
51-
str(HERE/name/'static'/'extension.js'),
52-
str(HERE/name/'static'/'index.js'),
53-
str(HERE/'js'/'src'/'core'/'BufferAttribute.autogen.js'),
54-
str(HERE/name/'core'/'BufferAttribute_autogen.py'),
53+
str(py_path/'static'/'extension.js'),
54+
str(py_path/'static'/'index.js'),
55+
str(js_path/'src'/'core'/'BufferAttribute.autogen.js'),
56+
str(py_path/'core'/'BufferAttribute_autogen.py'),
5557
]),
5658
)
5759

0 commit comments

Comments
 (0)