Skip to content

Commit e4d375e

Browse files
committed
Migrate to hatch
1 parent 93a5895 commit e4d375e

4 files changed

Lines changed: 106 additions & 107 deletions

File tree

MANIFEST.in

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

bqplot_gl/_version.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,4 @@
44
# Copyright (c) The bqplot Development Team.
55
# Distributed under the terms of the Modified BSD License.
66

7-
version_info = (0, 1, 0)
8-
__version__ = ".".join(map(str, version_info))
7+
__version__ = "0.1.0"

pyproject.toml

Lines changed: 103 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,104 @@
11
[build-system]
2-
requires = ["jupyter_packaging~=0.7.9", "jupyterlab==4.*", "setuptools>=40.8.0", "wheel"]
3-
build-backend = "setuptools.build_meta"
2+
requires = [
3+
"hatchling",
4+
"jupyterlab==4.*",
5+
]
6+
build-backend = "hatchling.build"
7+
8+
[project]
9+
name = "bqplot-gl"
10+
description = "bqplot plugin providing marks powered by WebGL"
11+
readme = "README.md"
12+
authors = [
13+
{ name = "The BQplot Development Team" },
14+
]
15+
keywords = [
16+
"IPython",
17+
"Jupyter",
18+
"Widgets",
19+
"Graphics",
20+
"Plotting",
21+
"d3",
22+
"WebGL",
23+
]
24+
classifiers = [
25+
"Framework :: Jupyter",
26+
"Intended Audience :: Developers",
27+
"Intended Audience :: Science/Research",
28+
"License :: OSI Approved :: Apache Software License",
29+
"Programming Language :: Python",
30+
"Programming Language :: Python :: 3",
31+
"Programming Language :: Python :: 3.7",
32+
"Programming Language :: Python :: 3.8",
33+
"Programming Language :: Python :: 3.9",
34+
"Programming Language :: Python :: 3.10",
35+
"Programming Language :: Python :: 3.11",
36+
]
37+
dependencies = [
38+
"bqplot>=0.13.0a0,<0.14",
39+
]
40+
version = "0.1.0"
41+
42+
[project.license]
43+
file = "LICENSE"
44+
45+
[project.urls]
46+
Homepage = "https://github.com/bqplot/bqplot-gl"
47+
48+
[tool.hatch.build]
49+
artifacts = [
50+
"bqplot_gl/nbextension/static/index.*",
51+
"bqplot_gl/labextension",
52+
]
53+
54+
[tool.hatch.build.targets.wheel.shared-data]
55+
"bqplot_gl/nbextension/static" = "share/jupyter/nbextensions/bqplot-gl"
56+
"bqplot_gl/labextension" = "share/jupyter/labextensions/bqplot-gl"
57+
"bqplot-gl.json" = "etc/jupyter/nbconfig/notebook.d/bqplot-gl.json"
58+
59+
[tool.hatch.build.targets.sdist]
60+
exclude = [
61+
".github",
62+
]
63+
64+
[tool.hatch.build.hooks.jupyter-builder]
65+
ensured-targets = [
66+
"bqplot_gl/nbextension/static/index.js",
67+
"bqplot_gl/labextension/package.json",
68+
]
69+
dependencies = [
70+
"hatch-jupyter-builder>=0.8.1",
71+
]
72+
build-function = "hatch_jupyter_builder.npm_builder"
73+
74+
[tool.hatch.build.hooks.jupyter-builder.build-kwargs]
75+
path = "."
76+
build_cmd = "build:prod"
77+
npm = [
78+
"jlpm",
79+
]
80+
81+
[tool.tbump]
82+
field = [
83+
{ name = "channel", default = "" },
84+
{ name = "release", default = "" },
85+
]
86+
87+
[tool.tbump.version]
88+
current = "0.1.0"
89+
regex = "(?P<major>\\d+)\\.(?P<minor>\\d+)\\.(?P<patch>\\d+)((?P<channel>a|b|rc|.dev)(?P<release>\\d+))?"
90+
91+
[tool.tbump.git]
92+
message_template = "Bump to {new_version}"
93+
tag_template = "v{new_version}"
94+
95+
[[tool.tbump.file]]
96+
src = "pyproject.toml"
97+
version_template = "version = \"{major}.{minor}.{patch}{channel}{release}\""
98+
99+
[[tool.tbump.file]]
100+
src = "bqplot_gl/_version.py"
101+
102+
[[tool.tbump.file]]
103+
src = "package.json"
104+
version_template = "\"version\": \"{major}.{minor}.{patch}{channel}{release}\""

setup.py

Lines changed: 2 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,2 @@
1-
#!/usr/bin/env python
2-
# coding: utf-8
3-
4-
# Copyright (c) Jupyter Development Team.
5-
# Distributed under the terms of the Modified BSD License.
6-
7-
import os
8-
from os.path import join as pjoin
9-
from setuptools import setup
10-
11-
12-
from jupyter_packaging import (
13-
create_cmdclass,
14-
install_npm,
15-
ensure_targets,
16-
combine_commands,
17-
get_version,
18-
)
19-
20-
21-
HERE = os.path.dirname(os.path.abspath(__file__))
22-
23-
name = 'bqplot-gl'
24-
25-
# Get the version
26-
version = get_version(pjoin('bqplot_gl', '_version.py'))
27-
28-
# Representative files that should exist after a successful build
29-
jstargets = [
30-
pjoin(HERE, 'bqplot_gl', 'nbextension', 'index.js'),
31-
pjoin(HERE, 'lib', 'plugin.js'),
32-
]
33-
34-
35-
package_data_spec = {
36-
name: [
37-
'nbextension/**js*',
38-
'labextension/**'
39-
]
40-
}
41-
42-
43-
data_files_spec = [
44-
('share/jupyter/nbextensions/bqplot-gl', 'bqplot_gl/nbextension', '**'),
45-
('share/jupyter/labextensions/bqplot-gl', 'bqplot_gl/labextension', '**'),
46-
('share/jupyter/labextensions/bqplot-gl', '.', 'install.json'),
47-
('etc/jupyter/nbconfig/notebook.d', '.', 'bqplot-gl.json'),
48-
]
49-
50-
51-
cmdclass = create_cmdclass(
52-
'jsdeps', package_data_spec=package_data_spec,
53-
data_files_spec=data_files_spec
54-
)
55-
cmdclass['jsdeps'] = combine_commands(
56-
install_npm(HERE, build_cmd='build:prod', npm=['jlpm']),
57-
ensure_targets(jstargets),
58-
)
59-
60-
setup(version=version, cmdclass=cmdclass)
1+
# setup.py shim for use with applications that require it.
2+
__import__("setuptools").setup()

0 commit comments

Comments
 (0)