Skip to content

Commit ecf3080

Browse files
committed
More modern packaging
1 parent 27811a0 commit ecf3080

File tree

5 files changed

+70
-97
lines changed

5 files changed

+70
-97
lines changed

dev-install.sh

+2-5
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,6 @@ pip install -v -e "./python/ipywidgets[test]"
4747
if test "$skip_jupyter_lab" != yes; then
4848
echo -n "jupyterlab_ipywidgets"
4949
pip install jupyter_packaging
50-
51-
pushd ./python/jupyterlab_widgets
52-
pip install .
53-
jupyter labextension develop . --overwrite
54-
popd
50+
pip install -ve ./python/jupyterlab_widgets
51+
jupyter labextension develop ./python/jupyterlab_widgets --overwrite
5552
fi

python/jupyterlab_widgets/jupyterlab_widgets/__init__.py

+11-6
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,16 @@
55

66

77
def _jupyter_labextension_paths():
8-
return [
9-
{
10-
'src': 'labextension',
11-
'dest': '@jupyter-widgets/jupyterlab-manager'
12-
}
13-
]
8+
import sys
9+
from pathlib import Path
10+
11+
labext_name = '@jupyter-widgets/jupyterlab-manager'
12+
here = Path(__file__).parent.resolve()
13+
src_prefix = here.parent / 'labextension'
14+
15+
if not src_prefix.exists():
16+
src_prefix = Path(sys.prefix) / f'share/jupyter/labextensions/{labext_name}'
17+
18+
return [{'src': str(src_prefix), 'dest': labext_name}]
1419

1520
__all__ = ['_jupyter_labextension_paths', '__version__']
+57-12
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,62 @@
1-
[build-system]
2-
requires = ["jupyter_packaging~=0.10,<2", "jupyterlab~=4.0"]
3-
build-backend = "jupyter_packaging.build_api"
4-
5-
[tool.jupyter-packaging.options]
6-
skip-if-exists = ["labextension/package.json"]
7-
ensured-targets = ["labextension/package.json"]
1+
[project]
2+
name = "jupyterlab_widgets"
3+
description = "Jupyter interactive widgets for JupyterLab"
4+
readme = { file = "README.md", content-type = "text/markdown" }
5+
requires-python = ">=3.7"
6+
license = { file = "LICENSE" }
7+
authors = [
8+
{ name = "Jupyter Development Team", email = "jupyter@googlegroups.com" }
9+
]
10+
keywords = [
11+
"Interactive", "Interpreter", "Shell", "Web", "notebook",
12+
"widgets", "Jupyter", "JupyterLab", "JupyterLab3"
13+
]
14+
classifiers = [
15+
"Intended Audience :: Developers",
16+
"Intended Audience :: System Administrators",
17+
"Intended Audience :: Science/Research",
18+
"License :: OSI Approved :: BSD License",
19+
"Programming Language :: Python",
20+
"Programming Language :: Python :: 3",
21+
"Programming Language :: Python :: 3.7",
22+
"Programming Language :: Python :: 3.8",
23+
"Programming Language :: Python :: 3.9",
24+
"Programming Language :: Python :: 3.10",
25+
"Programming Language :: Python :: 3.11",
26+
"Programming Language :: Python :: 3.12",
27+
"Programming Language :: Python :: 3.13",
28+
"Programming Language :: Python :: 3 :: Only",
29+
"Framework :: Jupyter",
30+
"Framework :: Jupyter :: JupyterLab",
31+
"Framework :: Jupyter :: JupyterLab :: 3",
32+
"Framework :: Jupyter :: JupyterLab :: Extensions",
33+
"Framework :: Jupyter :: JupyterLab :: Extensions :: Prebuilt"
34+
]
35+
urls = { Homepage = "https://github.com/jupyter-widgets/ipywidgets" }
36+
dynamic = ["version"]
837

9-
[tool.jupyter-packaging.builder]
10-
factory = "jupyter_packaging.npm_builder"
38+
[tool.hatch.version]
39+
path = "jupyterlab_widgets/_version.py"
1140

12-
[tool.jupyter-packaging.build-args]
13-
build_cmd = "build:prod"
14-
npm = ["jlpm"]
41+
[build-system]
42+
requires = ["hatchling>=1.5.0", "jupyterlab~=4.0"]
43+
build-backend = "hatchling.build"
1544

1645
[tool.check-manifest]
1746
ignore = ["labextension/**", "yarn.lock", ".*", "package-lock.json"]
47+
48+
[tool.hatch.build.hooks.jupyter-builder]
49+
ensured-targets = [
50+
"labextension/package.json",
51+
]
52+
dependencies = [
53+
"hatch-jupyter-builder>=0.8.1",
54+
]
55+
build-function = "hatch_jupyter_builder.npm_builder"
56+
57+
[tool.hatch.build.hooks.jupyter-builder.build-kwargs]
58+
path = "."
59+
build_cmd = "install:extension"
60+
npm = [
61+
"jlpm",
62+
]

python/jupyterlab_widgets/setup.cfg

-37
This file was deleted.

python/jupyterlab_widgets/setup.py

-37
This file was deleted.

0 commit comments

Comments
 (0)