Skip to content

Commit c44fc88

Browse files
committed
Fix jupyterlab nightly versions
Signed-off-by: Andrew Stein <steinlink@gmail.com>
1 parent 43bd62c commit c44fc88

3 files changed

Lines changed: 11 additions & 11 deletions

File tree

packages/perspective-jupyterlab/build.mjs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -136,11 +136,7 @@ async function build_all() {
136136
});
137137

138138
const pkg = JSON.parse(fs.readFileSync("../../package.json").toString());
139-
const version = pkg.version.replace(/-(rc|alpha|beta)\.\d+/, (x) =>
140-
x.replace("-", "").replace(".", "")
141-
);
142-
143-
const labext_dest = `../../rust/perspective-python/perspective_python-${version}.data/data/share/jupyter/labextensions/@finos/perspective-jupyterlab`;
139+
const labext_dest = `../../rust/perspective-python/perspective_python-${pkg.version}.data/data/share/jupyter/labextensions/@finos/perspective-jupyterlab`;
144140
await cpy(["dist/cjs/**/*"], labext_dest);
145141
}
146142

rust/perspective-python/perspective/widget/__init__.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,11 @@
2222
from traitlets import Unicode, observe
2323
from .viewer import PerspectiveViewer
2424

25-
__version__ = re.sub(
26-
"(rc|alpha|beta)", "-\\1.", importlib.metadata.version("perspective-python")
27-
)
25+
__version__ = re.sub(".dev[0-9]+", "", importlib.metadata.version("perspective-python"))
2826

2927
__all__ = ["PerspectiveWidget"]
3028

29+
3130
class PerspectiveWidget(DOMWidget, PerspectiveViewer):
3231
""":class`~perspective.PerspectiveWidget` allows for Perspective to be used
3332
in the form of a Jupyter IPython widget.
@@ -160,6 +159,7 @@ def __init__(
160159
loading = self.load(data, **self._options)
161160
if inspect.isawaitable(loading):
162161
import asyncio
162+
163163
asyncio.create_task(loading)
164164

165165
def load(self, data, **options):
@@ -212,16 +212,16 @@ def handle_message(self, widget, content, buffers):
212212
logging.debug("view {} connected", client_id)
213213

214214
def send_response(msg):
215-
self.send(
216-
{"type": "binary_msg", "client_id": client_id}, [msg]
217-
)
215+
self.send({"type": "binary_msg", "client_id": client_id}, [msg])
216+
218217
self._sessions[client_id] = self.new_proxy_session(send_response)
219218
elif content["type"] == "binary_msg":
220219
[binary_msg] = buffers
221220
client_id = content["client_id"]
222221
session = self._sessions[client_id]
223222
if session is not None:
224223
import asyncio
224+
225225
asyncio.create_task(session.handle_request_async(binary_msg))
226226
else:
227227
logging.error("No session for client_id {}".format(client_id))

tools/perspective-scripts/version.mjs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,10 @@ async function update_package_jsons() {
192192
fs.writeFileSync("./package.json", pkg_json);
193193
const packages = {};
194194
for (const ws of pkg.workspaces) {
195+
if (ws === "packages/perspective-jupyterlab" && IS_NIGHTLY) {
196+
continue;
197+
}
198+
195199
for (const path of glob.sync(`${ws}/package.json`, {
196200
sync: true,
197201
})) {

0 commit comments

Comments
 (0)