代码拉取完成,页面将自动刷新
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
# Custom build target that removes .js.map files for published
# dist files.
import glob
import json
import os
import subprocess
from hatch_jupyter_builder import npm_builder
from packaging.version import Version
def builder(target_name, version, *args, **kwargs):
# Allow building from sdist without node.
if target_name == "wheel" and not os.path.exists("dev_mode"):
return
npm_builder(target_name, version, *args, **kwargs)
if version == "editable":
return
files = glob.glob("jupyterlab/static/*.js.map")
for path in files:
os.remove(path)
target = glob.glob("jupyterlab/static/package.json")[0]
with open(target) as fid:
npm_version = json.load(fid)["jupyterlab"]["version"]
py_version = subprocess.check_output(["hatchling", "version"]) # noqa S603 S607
py_version = py_version.decode("utf-8").strip()
if Version(npm_version) != Version(py_version):
msg = "Version mismatch, please run `npm run prepare:python-release`"
msg += f"; NPM {npm_version} / Python {py_version}"
raise ValueError(msg)
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。