kopia lustrzana https://github.com/deathbeds/ipydrawio
rodzic
0a80d241cb
commit
a23e305860
|
@ -22,7 +22,6 @@ channels:
|
|||
dependencies:
|
||||
- python >=3.9
|
||||
# demo toys
|
||||
- bqplot
|
||||
- graphviz2drawio
|
||||
- jupyter-lsp-python-lsp-server
|
||||
- jupyterlab-link-share
|
||||
|
@ -37,11 +36,16 @@ dependencies:
|
|||
- segno
|
||||
- shapely
|
||||
- tabulate
|
||||
- sphinx-autobuild
|
||||
### FEDERATED EXTENSIONS ###
|
||||
- bqplot
|
||||
- jupyterlab_widgets
|
||||
- jupyterlab-tour
|
||||
- wxyz_datagrid
|
||||
- wxyz_json_schema_form
|
||||
- wxyz_lab
|
||||
- wxyz_svg
|
||||
- sphinx-autobuild
|
||||
### FEDERATED EXTENSIONS ###
|
||||
############################################################################
|
||||
### ipydrawio-docs-deps ###
|
||||
|
||||
|
@ -51,8 +55,6 @@ dependencies:
|
|||
- sphinx
|
||||
- sphinx-jsonschema
|
||||
- sphinxext-rediraffe
|
||||
# for lite
|
||||
- jupyterlab-tour
|
||||
# TODO: resolve upstream
|
||||
- sqlalchemy <1.4
|
||||
- pip:
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
__pycache__
|
||||
_output
|
||||
.cache/
|
||||
.coverage*
|
||||
.eslintcache
|
||||
.ipynb_checkpoints
|
||||
|
|
|
@ -1,14 +1,7 @@
|
|||
{
|
||||
"jupyter-config-data": {
|
||||
"appName": "IPyDrawioLite",
|
||||
"disabledExtensions": [
|
||||
"@deathbeds/ipydrawio-pdf",
|
||||
"@jupyterlab-classic/lab-extension",
|
||||
"@jupyterlab/server-proxy",
|
||||
"@krassowski/jupyterlab-lsp",
|
||||
"jupyterlab-server-proxy",
|
||||
"nbdime-jupyterlab"
|
||||
],
|
||||
"collaborative": true,
|
||||
"faviconUrl": "./favicon.ico"
|
||||
},
|
||||
"jupyter-lite-schema-version": 0
|
||||
|
|
|
@ -2,9 +2,20 @@
|
|||
"LiteBuildConfig": {
|
||||
"apps": ["lab"],
|
||||
"contents": ["."],
|
||||
"federated_extensions": [
|
||||
"../py_packages/ipydrawio/dist/ipydrawio-1.1.1-py3-none-any.whl",
|
||||
"https://github.com/conda-forge/releases/releases/download/noarch/bqplot-0.12.30-pyhd8ed1ab_0.tar.bz2/bqplot-0.12.30-pyhd8ed1ab_0.tar.bz2",
|
||||
"https://github.com/conda-forge/releases/releases/download/noarch/jupyterlab-tour-3.1.2-pyhd8ed1ab_0.tar.bz2/jupyterlab-tour-3.1.2-pyhd8ed1ab_0.tar.bz2",
|
||||
"https://github.com/conda-forge/releases/releases/download/noarch/jupyterlab_widgets-1.0.0-pyhd8ed1ab_1.tar.bz2/jupyterlab_widgets-1.0.0-pyhd8ed1ab_1.tar.bz2",
|
||||
"https://github.com/conda-forge/releases/releases/download/noarch/wxyz_datagrid-0.5.1-pyhd8ed1ab_0.tar.bz2/wxyz_datagrid-0.5.1-pyhd8ed1ab_0.tar.bz2",
|
||||
"https://github.com/conda-forge/releases/releases/download/noarch/wxyz_json_schema_form-0.5.1-pyhd8ed1ab_0.tar.bz2/wxyz_json_schema_form-0.5.1-pyhd8ed1ab_0.tar.bz2",
|
||||
"https://github.com/conda-forge/releases/releases/download/noarch/wxyz_lab-0.5.1-pyhd8ed1ab_0.tar.bz2/wxyz_lab-0.5.1-pyhd8ed1ab_0.tar.bz2",
|
||||
"https://github.com/conda-forge/releases/releases/download/noarch/wxyz_svg-0.5.1-pyhd8ed1ab_0.tar.bz2/wxyz_svg-0.5.1-pyhd8ed1ab_0.tar.bz2"
|
||||
],
|
||||
"ignore_contents": [
|
||||
"(lab/|_output|.gitignore|doit.db|\\.json$|jupyter_config|log$|\\.cache)"
|
||||
],
|
||||
"ignore_sys_prefix": true,
|
||||
"lite_dir": ".",
|
||||
"output_archive": "../build/demo/ipydrawio-lite-1.1.1.tgz",
|
||||
"output_dir": "../build/demo"
|
||||
|
|
|
@ -6,10 +6,16 @@
|
|||
data-toggle="tooltip"
|
||||
data-placement="right"
|
||||
title="Try IPyDrawio in your browser. Right now."
|
||||
id="demo-room-button"
|
||||
>
|
||||
<i class="fas fa-lightbulb"></i>
|
||||
Try <strong>IPyDrawio</strong> Now
|
||||
Try <strong>IPyDrawio</strong> Now <span id="demo-room-label"></span>
|
||||
</a>
|
||||
<details>
|
||||
<summary><i class="fas fa-users"></i>Collaboration...</summary>
|
||||
<input type="text" placeholder="room name" id="demo-room-name"></input><br/>
|
||||
<em>everyone who uses this room name will be able to edit all files</em>
|
||||
</details>
|
||||
<br/>
|
||||
or <a
|
||||
href="{{ pathto(demo_tarball, True) }}"
|
||||
|
@ -22,5 +28,15 @@
|
|||
</a>
|
||||
<hr/>
|
||||
<em>Powered by <a href="https://jupyterlite.rtfd.io" target="_blank">JupyterLite</a></em>
|
||||
<script>$(function() {$('[data-toggle="tooltip"]').tooltip();});</script>
|
||||
<script>$(function() {
|
||||
$('[data-toggle="tooltip"]').tooltip();
|
||||
$("#demo-room-name").on('input', () => {
|
||||
const room = $("#demo-room-name").val().trim();
|
||||
$("#demo-room-button").attr(
|
||||
"href",
|
||||
`{{ pathto('demo/index') }}` + (room ? `?room=${room}` : '')
|
||||
);
|
||||
$("#demo-room-label").text(room ? ` with ${room}` : '');
|
||||
});
|
||||
});</script>
|
||||
</div>
|
||||
|
|
|
@ -29,8 +29,6 @@ dependencies:
|
|||
- sphinx
|
||||
- sphinx-jsonschema
|
||||
- sphinxext-rediraffe
|
||||
# for lite
|
||||
- jupyterlab-tour
|
||||
# TODO: resolve upstream
|
||||
- sqlalchemy <1.4
|
||||
- pip:
|
||||
|
|
21
dodo.py
21
dodo.py
|
@ -86,6 +86,9 @@ def task_dist():
|
|||
|
||||
def task_env():
|
||||
"""sync environments"""
|
||||
if P.RTD:
|
||||
return
|
||||
|
||||
for env, inherits in P.ENV_INHERITS.items():
|
||||
yield dict(
|
||||
name=f"""{env.parent.name}:{':'.join([inh.parent.name for inh in inherits])}""",
|
||||
|
@ -677,6 +680,24 @@ def task_demo():
|
|||
print("jupyterlite not found, this might be okay", flush=True)
|
||||
return
|
||||
|
||||
yield dict(
|
||||
name="extensions",
|
||||
doc="update jupyter-lite.json from the conda env",
|
||||
file_dep=[P.ENV_BINDER, P.PY_WHEEL[P.IPD.name]],
|
||||
targets=[P.DEMO_CONFIG],
|
||||
actions=[
|
||||
(
|
||||
P._sync_lite_config,
|
||||
[
|
||||
P.ENV_BINDER,
|
||||
P.DEMO_CONFIG,
|
||||
P.FED_EXT_MARKER,
|
||||
[P.PY_WHEEL[P.IPD.name]],
|
||||
],
|
||||
)
|
||||
],
|
||||
)
|
||||
|
||||
demo_dest = []
|
||||
demo_tasks = []
|
||||
final_dest = []
|
||||
|
|
|
@ -91,6 +91,8 @@ BUILDING_IN_CI = bool(json.loads(os.environ.get("BUILDING_IN_CI", "0")))
|
|||
TESTING_IN_CI = bool(json.loads(os.environ.get("TESTING_IN_CI", "0")))
|
||||
CI_ARTIFACT = os.environ.get("CI_ARTIFACT", "wheel")
|
||||
CI = bool(json.loads(os.environ.get("CI", "0")))
|
||||
RTD = os.environ.get("READTHEDOCS", "build")
|
||||
|
||||
|
||||
# test arg pass-throughs
|
||||
ATEST_ARGS = json.loads(os.environ.get("ATEST_ARGS", "[]"))
|
||||
|
@ -331,6 +333,9 @@ SERVER_EXT = {
|
|||
}
|
||||
|
||||
# demo
|
||||
RE_CONDA_FORGE_URL = r"/conda-forge/(.*/)?(noarch|linux-64|win-64|osx-64)/([^/]+)$"
|
||||
CONDA_FORGE_RELEASE = "https://github.com/conda-forge/releases/releases/download"
|
||||
FED_EXT_MARKER = "### FEDERATED EXTENSIONS ###"
|
||||
DEMO = ROOT / "demo"
|
||||
DEMO_CONFIG = DEMO / "jupyter_lite_config.json"
|
||||
DEMO_APPS = ["lab"]
|
||||
|
@ -806,6 +811,35 @@ def _build_lite():
|
|||
return False
|
||||
|
||||
|
||||
def _sync_lite_config(from_env, to_json, marker, extras):
|
||||
"""use conda list to derive tarball names"""
|
||||
raw_lock = subprocess.check_output(["conda", "list", "--explicit"])
|
||||
ext_packages = [
|
||||
p.strip().split(" ")[0]
|
||||
for p in from_env.read_text(encoding="utf-8").split(marker)[1].split(" - ")
|
||||
if p.strip()
|
||||
]
|
||||
|
||||
tarball_urls = ["../" + str(extra.relative_to(ROOT).as_posix()) for extra in extras]
|
||||
for raw_url in sorted(raw_lock.decode("utf-8").splitlines()):
|
||||
try:
|
||||
label, subdir, pkg = re.findall(RE_CONDA_FORGE_URL, raw_url)[0]
|
||||
except IndexError:
|
||||
continue
|
||||
|
||||
if label:
|
||||
# TODO: haven't looked into this
|
||||
continue
|
||||
|
||||
for ext in ext_packages:
|
||||
if pkg.startswith(ext):
|
||||
tarball_urls += ["/".join([CONDA_FORGE_RELEASE, subdir, pkg, pkg])]
|
||||
|
||||
config = json.loads(to_json.read_text(encoding="utf-8"))
|
||||
config["LiteBuildConfig"]["federated_extensions"] = sorted(tarball_urls)
|
||||
to_json.write_text(json.dumps(config, indent=2, sort_keys=True))
|
||||
|
||||
|
||||
# Late environment hacks
|
||||
os.environ.update(
|
||||
CONDARC=str(CONDARC),
|
||||
|
|
Ładowanie…
Reference in New Issue