Skip to content

Commit acd0163

Browse files
committed
Working version without jupyter-packaging
Signed-off-by: martinRenou <[email protected]>
1 parent 64ed3de commit acd0163

File tree

2 files changed

+20
-9
lines changed

2 files changed

+20
-9
lines changed

pyproject.toml

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

setup.py

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,30 @@
1+
from os import chdir
12
import re
23
import sys
34
from pathlib import Path
5+
from glob import iglob
46

57
import setuptools
68

7-
from jupyter_packaging import create_cmdclass
89

10+
LABEXTENSIONS_DIR = Path('py_src') / 'jupyter_lsp' / 'labextensions'
11+
LABEXTENSIONS_INSTALL_DIR = Path('share') / 'jupyter' / 'labextensions'
912

10-
data_files_spec = [
11-
('share/jupyter/labextensions', 'py_src/jupyter_lsp/labextensions', '**'),
12-
('etc/jupyter/jupyter_notebook_config.d', 'py_src/jupyter_lsp/etc', 'jupyter-lsp-serverextension.json')
13-
]
13+
14+
15+
def get_data_files():
16+
chdir(str(LABEXTENSIONS_DIR))
17+
18+
extension_files = [
19+
(str(LABEXTENSIONS_INSTALL_DIR / Path(filename).parent), [str(LABEXTENSIONS_DIR / filename)])
20+
for filename in iglob('**/*.*', recursive=True)
21+
]
22+
23+
chdir('../../../')
24+
25+
extension_files.append(("etc/jupyter/jupyter_notebook_config.d", ["py_src/jupyter_lsp/etc/jupyter-lsp-serverextension.json"]))
26+
27+
return extension_files
1428

1529

1630
setuptools.setup(
@@ -19,5 +33,5 @@
1933
(Path(__file__).parent / "py_src" / "jupyter_lsp" / "_version.py").read_text(),
2034
)[0],
2135
setup_requires=["pytest-runner"] if "test" in sys.argv else [],
22-
cmd_class=create_cmdclass(data_files_spec=data_files_spec),
36+
data_files=get_data_files(),
2337
)

0 commit comments

Comments
 (0)