-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathsetup.py
More file actions
28 lines (24 loc) · 959 Bytes
/
setup.py
File metadata and controls
28 lines (24 loc) · 959 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/usr/bin/env python3
"""Custom setup.py to handle JupyterLab extension installation."""
import os
from pathlib import Path
from setuptools import setup
# Get all files in labextension directory recursively
labext_path = Path("instrmcp/extensions/jupyterlab/mcp_active_cell_bridge/labextension")
data_files = []
for root, dirs, files in os.walk(labext_path):
if files:
# Get relative path from labextension directory
rel_path = Path(root).relative_to(labext_path)
# Target installation directory
if rel_path == Path("."):
target = "share/jupyter/labextensions/mcp-active-cell-bridge"
else:
target = f"share/jupyter/labextensions/mcp-active-cell-bridge/{rel_path}"
# Add all files in this directory
file_paths = [os.path.join(root, f) for f in files]
data_files.append((target, file_paths))
# Run setup with dynamic data_files
setup(
data_files=data_files,
)