ipydrawio/scripts/project.py

1092 wiersze
30 KiB
Python
Czysty Zwykły widok Historia

2023-04-09 16:46:27 +00:00
"""important project paths.
Split up packages (#1) * add drawio * more tweaking of editor load * more work on packaging * linting, remove trace of mxgraph submodule * clean up empty file rendering * add some missing images * don't reinitialize url after every show * some css sugar * belt and suspenders ui theme * some more params * add export * working on logo * more logo work * full in-place round-tripping of svg, png, html * use icons on documents * clean up some untitled files * first pass at schema * start settings integration * more work on settings * fix ref * work on url params * some more tweaks to load behavior * move submodule * clean up some packaging stuff * jlpm * resolve yarn * fix iframe url * bump to newest drawio release * brinf back the stencils * html doesn't really work * add more images * move more things from code into config defaults * rework settings some more * fix new view, still working on click-to-activate * fix capitalization on compressXml * give up on formatting xml * more work on round-trip, styling * linting * more missing images * more config reloading * drawio v13.1.8 * bump drawio files * update notebook * upgrade typescript * more submodule shenanigans, binder env * regenerate again, was missing stencils * try adding server proxy * update path * fix schema * pin node * hoist jupyter_notebook_config.json * some more work on export * more x * add some more demo tools * use apt, some status * apt deps, get back icons * some more apt work * more apt work * better programmatic example * more status work * more docs * add some more text * some more notes * some more status work, notes * add jinja example * more work on notebook * move notebook * add some deps * more deps for pandas, pdf * use local drawio assets * stop servers harder * Create Data-Driven Decks.ipynb * Update drawio_export_demo.py * Create template deck.dio * fix up some chores * some notebook tweaks * more work on demo * try another labextension spot * notebooks * store composite drawio in pdf * use file:// for drawio static * drawio v13.3.5 * remove even more unused code * bump drawio, remove more tornado junk * clean up xml pattern * add notebook, because why not * add ipynb example to decks * add png, svg to composite * add video chat for giggles * drawio v13.3.8 * add plugins * more work on plugin stuff * drawio v13.3.9 * drawio v13.4.7 * resolve yarn.lock * add sourcemaps * drawio v13.4.9 * start patching towards rtc * add plugin path to patches * add a mess of plugins * turn down the plugins * drawio v13.5.3 * re-solve static * get rid of all the high unicode in schema * use utf-8 encoding explicitly * Update package.json * Update _static.ts * drawio v13.5.4 * resolve static * drawio v13.5.8 * move notebooks * start moving things around * add dodo.py * more moving * more moving * more moving and naming * moving * move static * fix up static path * update more ids, locations * skeleton docs * start doing it * start linting in anger * passing eslint * add prebuild * yet more linting * back to ts building * packing * hoist tarball * clean up static generation * apply lint in anger * more work on static * remove videochat for now, more ignoring * tune up ci, binder * use smaller env for now * underspecify python in ci, don't url-encode [p]lugins * gah windows * some win debugging * do some roadmap work * work on roadmap while debugging * do per-platform shell commands * linting, url param * look harder for npm * start thinking about versions * version bumping, more windows work * remove patterns from schema * add all task * more encoding, linting * rebuild static with iife * try another import template * versions in changelog * more work on alernate asset loading * revert menu investigations * paths for windows
2020-08-08 13:45:27 +00:00
2023-04-09 16:46:27 +00:00
this should not import anything not in py36+ stdlib, or any local paths
Split up packages (#1) * add drawio * more tweaking of editor load * more work on packaging * linting, remove trace of mxgraph submodule * clean up empty file rendering * add some missing images * don't reinitialize url after every show * some css sugar * belt and suspenders ui theme * some more params * add export * working on logo * more logo work * full in-place round-tripping of svg, png, html * use icons on documents * clean up some untitled files * first pass at schema * start settings integration * more work on settings * fix ref * work on url params * some more tweaks to load behavior * move submodule * clean up some packaging stuff * jlpm * resolve yarn * fix iframe url * bump to newest drawio release * brinf back the stencils * html doesn't really work * add more images * move more things from code into config defaults * rework settings some more * fix new view, still working on click-to-activate * fix capitalization on compressXml * give up on formatting xml * more work on round-trip, styling * linting * more missing images * more config reloading * drawio v13.1.8 * bump drawio files * update notebook * upgrade typescript * more submodule shenanigans, binder env * regenerate again, was missing stencils * try adding server proxy * update path * fix schema * pin node * hoist jupyter_notebook_config.json * some more work on export * more x * add some more demo tools * use apt, some status * apt deps, get back icons * some more apt work * more apt work * better programmatic example * more status work * more docs * add some more text * some more notes * some more status work, notes * add jinja example * more work on notebook * move notebook * add some deps * more deps for pandas, pdf * use local drawio assets * stop servers harder * Create Data-Driven Decks.ipynb * Update drawio_export_demo.py * Create template deck.dio * fix up some chores * some notebook tweaks * more work on demo * try another labextension spot * notebooks * store composite drawio in pdf * use file:// for drawio static * drawio v13.3.5 * remove even more unused code * bump drawio, remove more tornado junk * clean up xml pattern * add notebook, because why not * add ipynb example to decks * add png, svg to composite * add video chat for giggles * drawio v13.3.8 * add plugins * more work on plugin stuff * drawio v13.3.9 * drawio v13.4.7 * resolve yarn.lock * add sourcemaps * drawio v13.4.9 * start patching towards rtc * add plugin path to patches * add a mess of plugins * turn down the plugins * drawio v13.5.3 * re-solve static * get rid of all the high unicode in schema * use utf-8 encoding explicitly * Update package.json * Update _static.ts * drawio v13.5.4 * resolve static * drawio v13.5.8 * move notebooks * start moving things around * add dodo.py * more moving * more moving * more moving and naming * moving * move static * fix up static path * update more ids, locations * skeleton docs * start doing it * start linting in anger * passing eslint * add prebuild * yet more linting * back to ts building * packing * hoist tarball * clean up static generation * apply lint in anger * more work on static * remove videochat for now, more ignoring * tune up ci, binder * use smaller env for now * underspecify python in ci, don't url-encode [p]lugins * gah windows * some win debugging * do some roadmap work * work on roadmap while debugging * do per-platform shell commands * linting, url param * look harder for npm * start thinking about versions * version bumping, more windows work * remove patterns from schema * add all task * more encoding, linting * rebuild static with iife * try another import template * versions in changelog * more work on alernate asset loading * revert menu investigations * paths for windows
2020-08-08 13:45:27 +00:00
"""
2023-04-09 16:46:27 +00:00
# Copyright 2023 ipydrawio contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
2021-07-06 13:40:08 +00:00
Split up packages (#1) * add drawio * more tweaking of editor load * more work on packaging * linting, remove trace of mxgraph submodule * clean up empty file rendering * add some missing images * don't reinitialize url after every show * some css sugar * belt and suspenders ui theme * some more params * add export * working on logo * more logo work * full in-place round-tripping of svg, png, html * use icons on documents * clean up some untitled files * first pass at schema * start settings integration * more work on settings * fix ref * work on url params * some more tweaks to load behavior * move submodule * clean up some packaging stuff * jlpm * resolve yarn * fix iframe url * bump to newest drawio release * brinf back the stencils * html doesn't really work * add more images * move more things from code into config defaults * rework settings some more * fix new view, still working on click-to-activate * fix capitalization on compressXml * give up on formatting xml * more work on round-trip, styling * linting * more missing images * more config reloading * drawio v13.1.8 * bump drawio files * update notebook * upgrade typescript * more submodule shenanigans, binder env * regenerate again, was missing stencils * try adding server proxy * update path * fix schema * pin node * hoist jupyter_notebook_config.json * some more work on export * more x * add some more demo tools * use apt, some status * apt deps, get back icons * some more apt work * more apt work * better programmatic example * more status work * more docs * add some more text * some more notes * some more status work, notes * add jinja example * more work on notebook * move notebook * add some deps * more deps for pandas, pdf * use local drawio assets * stop servers harder * Create Data-Driven Decks.ipynb * Update drawio_export_demo.py * Create template deck.dio * fix up some chores * some notebook tweaks * more work on demo * try another labextension spot * notebooks * store composite drawio in pdf * use file:// for drawio static * drawio v13.3.5 * remove even more unused code * bump drawio, remove more tornado junk * clean up xml pattern * add notebook, because why not * add ipynb example to decks * add png, svg to composite * add video chat for giggles * drawio v13.3.8 * add plugins * more work on plugin stuff * drawio v13.3.9 * drawio v13.4.7 * resolve yarn.lock * add sourcemaps * drawio v13.4.9 * start patching towards rtc * add plugin path to patches * add a mess of plugins * turn down the plugins * drawio v13.5.3 * re-solve static * get rid of all the high unicode in schema * use utf-8 encoding explicitly * Update package.json * Update _static.ts * drawio v13.5.4 * resolve static * drawio v13.5.8 * move notebooks * start moving things around * add dodo.py * more moving * more moving * more moving and naming * moving * move static * fix up static path * update more ids, locations * skeleton docs * start doing it * start linting in anger * passing eslint * add prebuild * yet more linting * back to ts building * packing * hoist tarball * clean up static generation * apply lint in anger * more work on static * remove videochat for now, more ignoring * tune up ci, binder * use smaller env for now * underspecify python in ci, don't url-encode [p]lugins * gah windows * some win debugging * do some roadmap work * work on roadmap while debugging * do per-platform shell commands * linting, url param * look harder for npm * start thinking about versions * version bumping, more windows work * remove patterns from schema * add all task * more encoding, linting * rebuild static with iife * try another import template * versions in changelog * more work on alernate asset loading * revert menu investigations * paths for windows
2020-08-08 13:45:27 +00:00
import json
import os
import platform
2021-07-06 13:40:08 +00:00
import pprint
import re
Split up packages (#1) * add drawio * more tweaking of editor load * more work on packaging * linting, remove trace of mxgraph submodule * clean up empty file rendering * add some missing images * don't reinitialize url after every show * some css sugar * belt and suspenders ui theme * some more params * add export * working on logo * more logo work * full in-place round-tripping of svg, png, html * use icons on documents * clean up some untitled files * first pass at schema * start settings integration * more work on settings * fix ref * work on url params * some more tweaks to load behavior * move submodule * clean up some packaging stuff * jlpm * resolve yarn * fix iframe url * bump to newest drawio release * brinf back the stencils * html doesn't really work * add more images * move more things from code into config defaults * rework settings some more * fix new view, still working on click-to-activate * fix capitalization on compressXml * give up on formatting xml * more work on round-trip, styling * linting * more missing images * more config reloading * drawio v13.1.8 * bump drawio files * update notebook * upgrade typescript * more submodule shenanigans, binder env * regenerate again, was missing stencils * try adding server proxy * update path * fix schema * pin node * hoist jupyter_notebook_config.json * some more work on export * more x * add some more demo tools * use apt, some status * apt deps, get back icons * some more apt work * more apt work * better programmatic example * more status work * more docs * add some more text * some more notes * some more status work, notes * add jinja example * more work on notebook * move notebook * add some deps * more deps for pandas, pdf * use local drawio assets * stop servers harder * Create Data-Driven Decks.ipynb * Update drawio_export_demo.py * Create template deck.dio * fix up some chores * some notebook tweaks * more work on demo * try another labextension spot * notebooks * store composite drawio in pdf * use file:// for drawio static * drawio v13.3.5 * remove even more unused code * bump drawio, remove more tornado junk * clean up xml pattern * add notebook, because why not * add ipynb example to decks * add png, svg to composite * add video chat for giggles * drawio v13.3.8 * add plugins * more work on plugin stuff * drawio v13.3.9 * drawio v13.4.7 * resolve yarn.lock * add sourcemaps * drawio v13.4.9 * start patching towards rtc * add plugin path to patches * add a mess of plugins * turn down the plugins * drawio v13.5.3 * re-solve static * get rid of all the high unicode in schema * use utf-8 encoding explicitly * Update package.json * Update _static.ts * drawio v13.5.4 * resolve static * drawio v13.5.8 * move notebooks * start moving things around * add dodo.py * more moving * more moving * more moving and naming * moving * move static * fix up static path * update more ids, locations * skeleton docs * start doing it * start linting in anger * passing eslint * add prebuild * yet more linting * back to ts building * packing * hoist tarball * clean up static generation * apply lint in anger * more work on static * remove videochat for now, more ignoring * tune up ci, binder * use smaller env for now * underspecify python in ci, don't url-encode [p]lugins * gah windows * some win debugging * do some roadmap work * work on roadmap while debugging * do per-platform shell commands * linting, url param * look harder for npm * start thinking about versions * version bumping, more windows work * remove patterns from schema * add all task * more encoding, linting * rebuild static with iife * try another import template * versions in changelog * more work on alernate asset loading * revert menu investigations * paths for windows
2020-08-08 13:45:27 +00:00
import shutil
import subprocess
Split up packages (#1) * add drawio * more tweaking of editor load * more work on packaging * linting, remove trace of mxgraph submodule * clean up empty file rendering * add some missing images * don't reinitialize url after every show * some css sugar * belt and suspenders ui theme * some more params * add export * working on logo * more logo work * full in-place round-tripping of svg, png, html * use icons on documents * clean up some untitled files * first pass at schema * start settings integration * more work on settings * fix ref * work on url params * some more tweaks to load behavior * move submodule * clean up some packaging stuff * jlpm * resolve yarn * fix iframe url * bump to newest drawio release * brinf back the stencils * html doesn't really work * add more images * move more things from code into config defaults * rework settings some more * fix new view, still working on click-to-activate * fix capitalization on compressXml * give up on formatting xml * more work on round-trip, styling * linting * more missing images * more config reloading * drawio v13.1.8 * bump drawio files * update notebook * upgrade typescript * more submodule shenanigans, binder env * regenerate again, was missing stencils * try adding server proxy * update path * fix schema * pin node * hoist jupyter_notebook_config.json * some more work on export * more x * add some more demo tools * use apt, some status * apt deps, get back icons * some more apt work * more apt work * better programmatic example * more status work * more docs * add some more text * some more notes * some more status work, notes * add jinja example * more work on notebook * move notebook * add some deps * more deps for pandas, pdf * use local drawio assets * stop servers harder * Create Data-Driven Decks.ipynb * Update drawio_export_demo.py * Create template deck.dio * fix up some chores * some notebook tweaks * more work on demo * try another labextension spot * notebooks * store composite drawio in pdf * use file:// for drawio static * drawio v13.3.5 * remove even more unused code * bump drawio, remove more tornado junk * clean up xml pattern * add notebook, because why not * add ipynb example to decks * add png, svg to composite * add video chat for giggles * drawio v13.3.8 * add plugins * more work on plugin stuff * drawio v13.3.9 * drawio v13.4.7 * resolve yarn.lock * add sourcemaps * drawio v13.4.9 * start patching towards rtc * add plugin path to patches * add a mess of plugins * turn down the plugins * drawio v13.5.3 * re-solve static * get rid of all the high unicode in schema * use utf-8 encoding explicitly * Update package.json * Update _static.ts * drawio v13.5.4 * resolve static * drawio v13.5.8 * move notebooks * start moving things around * add dodo.py * more moving * more moving * more moving and naming * moving * move static * fix up static path * update more ids, locations * skeleton docs * start doing it * start linting in anger * passing eslint * add prebuild * yet more linting * back to ts building * packing * hoist tarball * clean up static generation * apply lint in anger * more work on static * remove videochat for now, more ignoring * tune up ci, binder * use smaller env for now * underspecify python in ci, don't url-encode [p]lugins * gah windows * some win debugging * do some roadmap work * work on roadmap while debugging * do per-platform shell commands * linting, url param * look harder for npm * start thinking about versions * version bumping, more windows work * remove patterns from schema * add all task * more encoding, linting * rebuild static with iife * try another import template * versions in changelog * more work on alernate asset loading * revert menu investigations * paths for windows
2020-08-08 13:45:27 +00:00
import sys
from pathlib import Path
2021-07-06 13:40:08 +00:00
print_ = pprint.pprint
console = None
2022-11-05 20:39:26 +00:00
HAS_SSORT = False
try:
__import__("ssort")
HAS_SSORT = True
except Exception:
print("no big deal, but `ssort` is not available...")
HAS_SSORT = False
2021-07-06 13:40:08 +00:00
try:
import rich.console
import rich.markdown
console = rich.console.Console()
print_ = console.print
except ImportError:
pass
SOURCE_DATE_EPOCH = None
try:
SOURCE_DATE_EPOCH = (
subprocess.check_output(["git", "log", "-1", "--format=%ct"])
.decode("utf-8")
.strip()
)
except (ImportError, AttributeError, subprocess.CalledProcessError) as err:
print_(err)
pass
SKIPS = ["checkpoint", "pytest_cache", "patched-environment"]
def _clean(*paths_or_globs):
cleaned = []
for p_or_g in paths_or_globs:
paths = [p_or_g] if isinstance(p_or_g, Path) else [*p_or_g]
for p in paths:
str_p = str(p)
skipped = False
for skip in SKIPS:
if skip in str_p:
skipped = True
if not skipped:
cleaned += [p]
return cleaned
2021-11-27 19:55:31 +00:00
def delete_some(*paths_or_globs):
for p_or_g in paths_or_globs:
paths = [p_or_g] if isinstance(p_or_g, Path) else [*p_or_g]
for p in paths:
if p.is_dir():
shutil.rmtree(p)
elif p.exists():
p.unlink()
_SESSION = None
Split up packages (#1) * add drawio * more tweaking of editor load * more work on packaging * linting, remove trace of mxgraph submodule * clean up empty file rendering * add some missing images * don't reinitialize url after every show * some css sugar * belt and suspenders ui theme * some more params * add export * working on logo * more logo work * full in-place round-tripping of svg, png, html * use icons on documents * clean up some untitled files * first pass at schema * start settings integration * more work on settings * fix ref * work on url params * some more tweaks to load behavior * move submodule * clean up some packaging stuff * jlpm * resolve yarn * fix iframe url * bump to newest drawio release * brinf back the stencils * html doesn't really work * add more images * move more things from code into config defaults * rework settings some more * fix new view, still working on click-to-activate * fix capitalization on compressXml * give up on formatting xml * more work on round-trip, styling * linting * more missing images * more config reloading * drawio v13.1.8 * bump drawio files * update notebook * upgrade typescript * more submodule shenanigans, binder env * regenerate again, was missing stencils * try adding server proxy * update path * fix schema * pin node * hoist jupyter_notebook_config.json * some more work on export * more x * add some more demo tools * use apt, some status * apt deps, get back icons * some more apt work * more apt work * better programmatic example * more status work * more docs * add some more text * some more notes * some more status work, notes * add jinja example * more work on notebook * move notebook * add some deps * more deps for pandas, pdf * use local drawio assets * stop servers harder * Create Data-Driven Decks.ipynb * Update drawio_export_demo.py * Create template deck.dio * fix up some chores * some notebook tweaks * more work on demo * try another labextension spot * notebooks * store composite drawio in pdf * use file:// for drawio static * drawio v13.3.5 * remove even more unused code * bump drawio, remove more tornado junk * clean up xml pattern * add notebook, because why not * add ipynb example to decks * add png, svg to composite * add video chat for giggles * drawio v13.3.8 * add plugins * more work on plugin stuff * drawio v13.3.9 * drawio v13.4.7 * resolve yarn.lock * add sourcemaps * drawio v13.4.9 * start patching towards rtc * add plugin path to patches * add a mess of plugins * turn down the plugins * drawio v13.5.3 * re-solve static * get rid of all the high unicode in schema * use utf-8 encoding explicitly * Update package.json * Update _static.ts * drawio v13.5.4 * resolve static * drawio v13.5.8 * move notebooks * start moving things around * add dodo.py * more moving * more moving * more moving and naming * moving * move static * fix up static path * update more ids, locations * skeleton docs * start doing it * start linting in anger * passing eslint * add prebuild * yet more linting * back to ts building * packing * hoist tarball * clean up static generation * apply lint in anger * more work on static * remove videochat for now, more ignoring * tune up ci, binder * use smaller env for now * underspecify python in ci, don't url-encode [p]lugins * gah windows * some win debugging * do some roadmap work * work on roadmap while debugging * do per-platform shell commands * linting, url param * look harder for npm * start thinking about versions * version bumping, more windows work * remove patterns from schema * add all task * more encoding, linting * rebuild static with iife * try another import template * versions in changelog * more work on alernate asset loading * revert menu investigations * paths for windows
2020-08-08 13:45:27 +00:00
# platform
PLATFORM = os.environ.get("FAKE_PLATFORM", platform.system())
WIN = PLATFORM == "Windows"
OSX = PLATFORM == "Darwin"
UNIX = not WIN
PREFIX = Path(sys.prefix)
2023-04-09 16:46:27 +00:00
ENC = {"encoding": "utf-8"}
JSON_FMT = {"indent": 2, "sort_keys": True}
Split up packages (#1) * add drawio * more tweaking of editor load * more work on packaging * linting, remove trace of mxgraph submodule * clean up empty file rendering * add some missing images * don't reinitialize url after every show * some css sugar * belt and suspenders ui theme * some more params * add export * working on logo * more logo work * full in-place round-tripping of svg, png, html * use icons on documents * clean up some untitled files * first pass at schema * start settings integration * more work on settings * fix ref * work on url params * some more tweaks to load behavior * move submodule * clean up some packaging stuff * jlpm * resolve yarn * fix iframe url * bump to newest drawio release * brinf back the stencils * html doesn't really work * add more images * move more things from code into config defaults * rework settings some more * fix new view, still working on click-to-activate * fix capitalization on compressXml * give up on formatting xml * more work on round-trip, styling * linting * more missing images * more config reloading * drawio v13.1.8 * bump drawio files * update notebook * upgrade typescript * more submodule shenanigans, binder env * regenerate again, was missing stencils * try adding server proxy * update path * fix schema * pin node * hoist jupyter_notebook_config.json * some more work on export * more x * add some more demo tools * use apt, some status * apt deps, get back icons * some more apt work * more apt work * better programmatic example * more status work * more docs * add some more text * some more notes * some more status work, notes * add jinja example * more work on notebook * move notebook * add some deps * more deps for pandas, pdf * use local drawio assets * stop servers harder * Create Data-Driven Decks.ipynb * Update drawio_export_demo.py * Create template deck.dio * fix up some chores * some notebook tweaks * more work on demo * try another labextension spot * notebooks * store composite drawio in pdf * use file:// for drawio static * drawio v13.3.5 * remove even more unused code * bump drawio, remove more tornado junk * clean up xml pattern * add notebook, because why not * add ipynb example to decks * add png, svg to composite * add video chat for giggles * drawio v13.3.8 * add plugins * more work on plugin stuff * drawio v13.3.9 * drawio v13.4.7 * resolve yarn.lock * add sourcemaps * drawio v13.4.9 * start patching towards rtc * add plugin path to patches * add a mess of plugins * turn down the plugins * drawio v13.5.3 * re-solve static * get rid of all the high unicode in schema * use utf-8 encoding explicitly * Update package.json * Update _static.ts * drawio v13.5.4 * resolve static * drawio v13.5.8 * move notebooks * start moving things around * add dodo.py * more moving * more moving * more moving and naming * moving * move static * fix up static path * update more ids, locations * skeleton docs * start doing it * start linting in anger * passing eslint * add prebuild * yet more linting * back to ts building * packing * hoist tarball * clean up static generation * apply lint in anger * more work on static * remove videochat for now, more ignoring * tune up ci, binder * use smaller env for now * underspecify python in ci, don't url-encode [p]lugins * gah windows * some win debugging * do some roadmap work * work on roadmap while debugging * do per-platform shell commands * linting, url param * look harder for npm * start thinking about versions * version bumping, more windows work * remove patterns from schema * add all task * more encoding, linting * rebuild static with iife * try another import template * versions in changelog * more work on alernate asset loading * revert menu investigations * paths for windows
2020-08-08 13:45:27 +00:00
2021-01-26 04:41:26 +00:00
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")
2021-07-06 13:40:08 +00:00
CI = bool(json.loads(os.environ.get("CI", "0")))
2021-11-12 23:30:56 +00:00
RTD = bool(json.loads(os.environ.get("READTHEDOCS", "0").lower()))
2021-07-30 21:52:47 +00:00
# test arg pass-throughs
ATEST_ARGS = json.loads(os.environ.get("ATEST_ARGS", "[]"))
2022-11-05 20:39:26 +00:00
ATEST_ATTEMPT = json.loads(os.environ.get("ATEST_ATTEMPT", "0"))
ATEST_RETRIES = int(os.environ.get("ATEST_RETRIES") or "0")
PYTEST_ARGS = json.loads(os.environ.get("PYTEST_ARGS", "[]"))
2023-04-12 15:28:54 +00:00
PYTEST_CHECK_LINKS_ARGS = json.loads(
os.environ.get(
"PYTEST_CHECK_LINKS_ARGS",
"""[
"--check-links-ignore",
"http://",
"--check-links-ignore",
"https://"
]""",
),
)
ATEST_PROCS = int(os.environ.get("ATEST_PROCS", "4"))
2021-01-26 04:41:26 +00:00
Split up packages (#1) * add drawio * more tweaking of editor load * more work on packaging * linting, remove trace of mxgraph submodule * clean up empty file rendering * add some missing images * don't reinitialize url after every show * some css sugar * belt and suspenders ui theme * some more params * add export * working on logo * more logo work * full in-place round-tripping of svg, png, html * use icons on documents * clean up some untitled files * first pass at schema * start settings integration * more work on settings * fix ref * work on url params * some more tweaks to load behavior * move submodule * clean up some packaging stuff * jlpm * resolve yarn * fix iframe url * bump to newest drawio release * brinf back the stencils * html doesn't really work * add more images * move more things from code into config defaults * rework settings some more * fix new view, still working on click-to-activate * fix capitalization on compressXml * give up on formatting xml * more work on round-trip, styling * linting * more missing images * more config reloading * drawio v13.1.8 * bump drawio files * update notebook * upgrade typescript * more submodule shenanigans, binder env * regenerate again, was missing stencils * try adding server proxy * update path * fix schema * pin node * hoist jupyter_notebook_config.json * some more work on export * more x * add some more demo tools * use apt, some status * apt deps, get back icons * some more apt work * more apt work * better programmatic example * more status work * more docs * add some more text * some more notes * some more status work, notes * add jinja example * more work on notebook * move notebook * add some deps * more deps for pandas, pdf * use local drawio assets * stop servers harder * Create Data-Driven Decks.ipynb * Update drawio_export_demo.py * Create template deck.dio * fix up some chores * some notebook tweaks * more work on demo * try another labextension spot * notebooks * store composite drawio in pdf * use file:// for drawio static * drawio v13.3.5 * remove even more unused code * bump drawio, remove more tornado junk * clean up xml pattern * add notebook, because why not * add ipynb example to decks * add png, svg to composite * add video chat for giggles * drawio v13.3.8 * add plugins * more work on plugin stuff * drawio v13.3.9 * drawio v13.4.7 * resolve yarn.lock * add sourcemaps * drawio v13.4.9 * start patching towards rtc * add plugin path to patches * add a mess of plugins * turn down the plugins * drawio v13.5.3 * re-solve static * get rid of all the high unicode in schema * use utf-8 encoding explicitly * Update package.json * Update _static.ts * drawio v13.5.4 * resolve static * drawio v13.5.8 * move notebooks * start moving things around * add dodo.py * more moving * more moving * more moving and naming * moving * move static * fix up static path * update more ids, locations * skeleton docs * start doing it * start linting in anger * passing eslint * add prebuild * yet more linting * back to ts building * packing * hoist tarball * clean up static generation * apply lint in anger * more work on static * remove videochat for now, more ignoring * tune up ci, binder * use smaller env for now * underspecify python in ci, don't url-encode [p]lugins * gah windows * some win debugging * do some roadmap work * work on roadmap while debugging * do per-platform shell commands * linting, url param * look harder for npm * start thinking about versions * version bumping, more windows work * remove patterns from schema * add all task * more encoding, linting * rebuild static with iife * try another import template * versions in changelog * more work on alernate asset loading * revert menu investigations * paths for windows
2020-08-08 13:45:27 +00:00
# find root
SCRIPTS = Path(__file__).parent.resolve()
ROOT = SCRIPTS.parent
PY_MAJOR = "".join(map(str, sys.version_info[:2]))
Split up packages (#1) * add drawio * more tweaking of editor load * more work on packaging * linting, remove trace of mxgraph submodule * clean up empty file rendering * add some missing images * don't reinitialize url after every show * some css sugar * belt and suspenders ui theme * some more params * add export * working on logo * more logo work * full in-place round-tripping of svg, png, html * use icons on documents * clean up some untitled files * first pass at schema * start settings integration * more work on settings * fix ref * work on url params * some more tweaks to load behavior * move submodule * clean up some packaging stuff * jlpm * resolve yarn * fix iframe url * bump to newest drawio release * brinf back the stencils * html doesn't really work * add more images * move more things from code into config defaults * rework settings some more * fix new view, still working on click-to-activate * fix capitalization on compressXml * give up on formatting xml * more work on round-trip, styling * linting * more missing images * more config reloading * drawio v13.1.8 * bump drawio files * update notebook * upgrade typescript * more submodule shenanigans, binder env * regenerate again, was missing stencils * try adding server proxy * update path * fix schema * pin node * hoist jupyter_notebook_config.json * some more work on export * more x * add some more demo tools * use apt, some status * apt deps, get back icons * some more apt work * more apt work * better programmatic example * more status work * more docs * add some more text * some more notes * some more status work, notes * add jinja example * more work on notebook * move notebook * add some deps * more deps for pandas, pdf * use local drawio assets * stop servers harder * Create Data-Driven Decks.ipynb * Update drawio_export_demo.py * Create template deck.dio * fix up some chores * some notebook tweaks * more work on demo * try another labextension spot * notebooks * store composite drawio in pdf * use file:// for drawio static * drawio v13.3.5 * remove even more unused code * bump drawio, remove more tornado junk * clean up xml pattern * add notebook, because why not * add ipynb example to decks * add png, svg to composite * add video chat for giggles * drawio v13.3.8 * add plugins * more work on plugin stuff * drawio v13.3.9 * drawio v13.4.7 * resolve yarn.lock * add sourcemaps * drawio v13.4.9 * start patching towards rtc * add plugin path to patches * add a mess of plugins * turn down the plugins * drawio v13.5.3 * re-solve static * get rid of all the high unicode in schema * use utf-8 encoding explicitly * Update package.json * Update _static.ts * drawio v13.5.4 * resolve static * drawio v13.5.8 * move notebooks * start moving things around * add dodo.py * more moving * more moving * more moving and naming * moving * move static * fix up static path * update more ids, locations * skeleton docs * start doing it * start linting in anger * passing eslint * add prebuild * yet more linting * back to ts building * packing * hoist tarball * clean up static generation * apply lint in anger * more work on static * remove videochat for now, more ignoring * tune up ci, binder * use smaller env for now * underspecify python in ci, don't url-encode [p]lugins * gah windows * some win debugging * do some roadmap work * work on roadmap while debugging * do per-platform shell commands * linting, url param * look harder for npm * start thinking about versions * version bumping, more windows work * remove patterns from schema * add all task * more encoding, linting * rebuild static with iife * try another import template * versions in changelog * more work on alernate asset loading * revert menu investigations * paths for windows
2020-08-08 13:45:27 +00:00
2021-04-11 14:35:35 +00:00
# demo
BINDER = ROOT / ".binder"
OVERRIDES = BINDER / "overrides.json"
POSTBUILD_PY = BINDER / "postBuild"
ENV_BINDER = BINDER / "environment.yml"
2021-04-11 14:35:35 +00:00
Split up packages (#1) * add drawio * more tweaking of editor load * more work on packaging * linting, remove trace of mxgraph submodule * clean up empty file rendering * add some missing images * don't reinitialize url after every show * some css sugar * belt and suspenders ui theme * some more params * add export * working on logo * more logo work * full in-place round-tripping of svg, png, html * use icons on documents * clean up some untitled files * first pass at schema * start settings integration * more work on settings * fix ref * work on url params * some more tweaks to load behavior * move submodule * clean up some packaging stuff * jlpm * resolve yarn * fix iframe url * bump to newest drawio release * brinf back the stencils * html doesn't really work * add more images * move more things from code into config defaults * rework settings some more * fix new view, still working on click-to-activate * fix capitalization on compressXml * give up on formatting xml * more work on round-trip, styling * linting * more missing images * more config reloading * drawio v13.1.8 * bump drawio files * update notebook * upgrade typescript * more submodule shenanigans, binder env * regenerate again, was missing stencils * try adding server proxy * update path * fix schema * pin node * hoist jupyter_notebook_config.json * some more work on export * more x * add some more demo tools * use apt, some status * apt deps, get back icons * some more apt work * more apt work * better programmatic example * more status work * more docs * add some more text * some more notes * some more status work, notes * add jinja example * more work on notebook * move notebook * add some deps * more deps for pandas, pdf * use local drawio assets * stop servers harder * Create Data-Driven Decks.ipynb * Update drawio_export_demo.py * Create template deck.dio * fix up some chores * some notebook tweaks * more work on demo * try another labextension spot * notebooks * store composite drawio in pdf * use file:// for drawio static * drawio v13.3.5 * remove even more unused code * bump drawio, remove more tornado junk * clean up xml pattern * add notebook, because why not * add ipynb example to decks * add png, svg to composite * add video chat for giggles * drawio v13.3.8 * add plugins * more work on plugin stuff * drawio v13.3.9 * drawio v13.4.7 * resolve yarn.lock * add sourcemaps * drawio v13.4.9 * start patching towards rtc * add plugin path to patches * add a mess of plugins * turn down the plugins * drawio v13.5.3 * re-solve static * get rid of all the high unicode in schema * use utf-8 encoding explicitly * Update package.json * Update _static.ts * drawio v13.5.4 * resolve static * drawio v13.5.8 * move notebooks * start moving things around * add dodo.py * more moving * more moving * more moving and naming * moving * move static * fix up static path * update more ids, locations * skeleton docs * start doing it * start linting in anger * passing eslint * add prebuild * yet more linting * back to ts building * packing * hoist tarball * clean up static generation * apply lint in anger * more work on static * remove videochat for now, more ignoring * tune up ci, binder * use smaller env for now * underspecify python in ci, don't url-encode [p]lugins * gah windows * some win debugging * do some roadmap work * work on roadmap while debugging * do per-platform shell commands * linting, url param * look harder for npm * start thinking about versions * version bumping, more windows work * remove patterns from schema * add all task * more encoding, linting * rebuild static with iife * try another import template * versions in changelog * more work on alernate asset loading * revert menu investigations * paths for windows
2020-08-08 13:45:27 +00:00
# top-level stuff
NODE_MODULES = ROOT / "node_modules"
PACKAGE = ROOT / "package.json"
PACKAGES = ROOT / "packages"
YARN_INTEGRITY = NODE_MODULES / ".yarn-integrity"
YARN_LOCK = ROOT / "yarn.lock"
DODO = ROOT / "dodo.py"
BUILD = ROOT / "build"
2023-04-10 14:09:29 +00:00
REPORTS = BUILD / "reports"
OK = BUILD / "ok"
Split up packages (#1) * add drawio * more tweaking of editor load * more work on packaging * linting, remove trace of mxgraph submodule * clean up empty file rendering * add some missing images * don't reinitialize url after every show * some css sugar * belt and suspenders ui theme * some more params * add export * working on logo * more logo work * full in-place round-tripping of svg, png, html * use icons on documents * clean up some untitled files * first pass at schema * start settings integration * more work on settings * fix ref * work on url params * some more tweaks to load behavior * move submodule * clean up some packaging stuff * jlpm * resolve yarn * fix iframe url * bump to newest drawio release * brinf back the stencils * html doesn't really work * add more images * move more things from code into config defaults * rework settings some more * fix new view, still working on click-to-activate * fix capitalization on compressXml * give up on formatting xml * more work on round-trip, styling * linting * more missing images * more config reloading * drawio v13.1.8 * bump drawio files * update notebook * upgrade typescript * more submodule shenanigans, binder env * regenerate again, was missing stencils * try adding server proxy * update path * fix schema * pin node * hoist jupyter_notebook_config.json * some more work on export * more x * add some more demo tools * use apt, some status * apt deps, get back icons * some more apt work * more apt work * better programmatic example * more status work * more docs * add some more text * some more notes * some more status work, notes * add jinja example * more work on notebook * move notebook * add some deps * more deps for pandas, pdf * use local drawio assets * stop servers harder * Create Data-Driven Decks.ipynb * Update drawio_export_demo.py * Create template deck.dio * fix up some chores * some notebook tweaks * more work on demo * try another labextension spot * notebooks * store composite drawio in pdf * use file:// for drawio static * drawio v13.3.5 * remove even more unused code * bump drawio, remove more tornado junk * clean up xml pattern * add notebook, because why not * add ipynb example to decks * add png, svg to composite * add video chat for giggles * drawio v13.3.8 * add plugins * more work on plugin stuff * drawio v13.3.9 * drawio v13.4.7 * resolve yarn.lock * add sourcemaps * drawio v13.4.9 * start patching towards rtc * add plugin path to patches * add a mess of plugins * turn down the plugins * drawio v13.5.3 * re-solve static * get rid of all the high unicode in schema * use utf-8 encoding explicitly * Update package.json * Update _static.ts * drawio v13.5.4 * resolve static * drawio v13.5.8 * move notebooks * start moving things around * add dodo.py * more moving * more moving * more moving and naming * moving * move static * fix up static path * update more ids, locations * skeleton docs * start doing it * start linting in anger * passing eslint * add prebuild * yet more linting * back to ts building * packing * hoist tarball * clean up static generation * apply lint in anger * more work on static * remove videochat for now, more ignoring * tune up ci, binder * use smaller env for now * underspecify python in ci, don't url-encode [p]lugins * gah windows * some win debugging * do some roadmap work * work on roadmap while debugging * do per-platform shell commands * linting, url param * look harder for npm * start thinking about versions * version bumping, more windows work * remove patterns from schema * add all task * more encoding, linting * rebuild static with iife * try another import template * versions in changelog * more work on alernate asset loading * revert menu investigations * paths for windows
2020-08-08 13:45:27 +00:00
DIST = ROOT / "dist"
DOCS = ROOT / "docs"
2021-01-29 22:12:44 +00:00
README = ROOT / "README.md"
CHANGELOG = ROOT / "CHANGELOG.md"
2023-04-10 14:09:29 +00:00
CACHE = BUILD / ".cache"
Split up packages (#1) * add drawio * more tweaking of editor load * more work on packaging * linting, remove trace of mxgraph submodule * clean up empty file rendering * add some missing images * don't reinitialize url after every show * some css sugar * belt and suspenders ui theme * some more params * add export * working on logo * more logo work * full in-place round-tripping of svg, png, html * use icons on documents * clean up some untitled files * first pass at schema * start settings integration * more work on settings * fix ref * work on url params * some more tweaks to load behavior * move submodule * clean up some packaging stuff * jlpm * resolve yarn * fix iframe url * bump to newest drawio release * brinf back the stencils * html doesn't really work * add more images * move more things from code into config defaults * rework settings some more * fix new view, still working on click-to-activate * fix capitalization on compressXml * give up on formatting xml * more work on round-trip, styling * linting * more missing images * more config reloading * drawio v13.1.8 * bump drawio files * update notebook * upgrade typescript * more submodule shenanigans, binder env * regenerate again, was missing stencils * try adding server proxy * update path * fix schema * pin node * hoist jupyter_notebook_config.json * some more work on export * more x * add some more demo tools * use apt, some status * apt deps, get back icons * some more apt work * more apt work * better programmatic example * more status work * more docs * add some more text * some more notes * some more status work, notes * add jinja example * more work on notebook * move notebook * add some deps * more deps for pandas, pdf * use local drawio assets * stop servers harder * Create Data-Driven Decks.ipynb * Update drawio_export_demo.py * Create template deck.dio * fix up some chores * some notebook tweaks * more work on demo * try another labextension spot * notebooks * store composite drawio in pdf * use file:// for drawio static * drawio v13.3.5 * remove even more unused code * bump drawio, remove more tornado junk * clean up xml pattern * add notebook, because why not * add ipynb example to decks * add png, svg to composite * add video chat for giggles * drawio v13.3.8 * add plugins * more work on plugin stuff * drawio v13.3.9 * drawio v13.4.7 * resolve yarn.lock * add sourcemaps * drawio v13.4.9 * start patching towards rtc * add plugin path to patches * add a mess of plugins * turn down the plugins * drawio v13.5.3 * re-solve static * get rid of all the high unicode in schema * use utf-8 encoding explicitly * Update package.json * Update _static.ts * drawio v13.5.4 * resolve static * drawio v13.5.8 * move notebooks * start moving things around * add dodo.py * more moving * more moving * more moving and naming * moving * move static * fix up static path * update more ids, locations * skeleton docs * start doing it * start linting in anger * passing eslint * add prebuild * yet more linting * back to ts building * packing * hoist tarball * clean up static generation * apply lint in anger * more work on static * remove videochat for now, more ignoring * tune up ci, binder * use smaller env for now * underspecify python in ci, don't url-encode [p]lugins * gah windows * some win debugging * do some roadmap work * work on roadmap while debugging * do per-platform shell commands * linting, url param * look harder for npm * start thinking about versions * version bumping, more windows work * remove patterns from schema * add all task * more encoding, linting * rebuild static with iife * try another import template * versions in changelog * more work on alernate asset loading * revert menu investigations * paths for windows
2020-08-08 13:45:27 +00:00
# external URLs
# archive.org template
CACHE_EPOCH = 0
2023-04-10 14:09:29 +00:00
HTTP_CACHE = CACHE / ".requests-cache"
BLACK_CACHE_DIR = CACHE / ".black"
def A_O(archive_id, url, cache_bust=CACHE_EPOCH):
2023-04-09 16:46:27 +00:00
return f"https://web.archive.org/web/{archive_id}/{url}#{cache_bust}"
DIA_FAQ = "https://www.diagrams.net/doc/faq"
FETCHED = BUILD / "fetched"
DIA_URLS = {
FETCHED
/ "supported-url-parameters.html": (
A_O(20210425055302, f"{DIA_FAQ}/supported-url-parameters")
),
FETCHED / "embed-mode.html": (A_O(20200924053756, f"{DIA_FAQ}/embed-mode")),
FETCHED
/ "configure-diagram-editor.html": (
A_O(20210503071537, f"{DIA_FAQ}/configure-diagram-editor")
),
}
# ci
2021-07-06 13:40:08 +00:00
GH = ROOT / ".github"
2022-01-08 19:09:28 +00:00
CI_YML = GH / "workflows/ci.yml"
2021-07-06 13:40:08 +00:00
ENV_GH = GH / "environment.yml"
2021-11-12 23:30:56 +00:00
ENV_GH_CB = GH / "environment-conda-build.yml"
ENV_GH_CB_WIN = GH / "environment-conda-build-win.yml"
Split up packages (#1) * add drawio * more tweaking of editor load * more work on packaging * linting, remove trace of mxgraph submodule * clean up empty file rendering * add some missing images * don't reinitialize url after every show * some css sugar * belt and suspenders ui theme * some more params * add export * working on logo * more logo work * full in-place round-tripping of svg, png, html * use icons on documents * clean up some untitled files * first pass at schema * start settings integration * more work on settings * fix ref * work on url params * some more tweaks to load behavior * move submodule * clean up some packaging stuff * jlpm * resolve yarn * fix iframe url * bump to newest drawio release * brinf back the stencils * html doesn't really work * add more images * move more things from code into config defaults * rework settings some more * fix new view, still working on click-to-activate * fix capitalization on compressXml * give up on formatting xml * more work on round-trip, styling * linting * more missing images * more config reloading * drawio v13.1.8 * bump drawio files * update notebook * upgrade typescript * more submodule shenanigans, binder env * regenerate again, was missing stencils * try adding server proxy * update path * fix schema * pin node * hoist jupyter_notebook_config.json * some more work on export * more x * add some more demo tools * use apt, some status * apt deps, get back icons * some more apt work * more apt work * better programmatic example * more status work * more docs * add some more text * some more notes * some more status work, notes * add jinja example * more work on notebook * move notebook * add some deps * more deps for pandas, pdf * use local drawio assets * stop servers harder * Create Data-Driven Decks.ipynb * Update drawio_export_demo.py * Create template deck.dio * fix up some chores * some notebook tweaks * more work on demo * try another labextension spot * notebooks * store composite drawio in pdf * use file:// for drawio static * drawio v13.3.5 * remove even more unused code * bump drawio, remove more tornado junk * clean up xml pattern * add notebook, because why not * add ipynb example to decks * add png, svg to composite * add video chat for giggles * drawio v13.3.8 * add plugins * more work on plugin stuff * drawio v13.3.9 * drawio v13.4.7 * resolve yarn.lock * add sourcemaps * drawio v13.4.9 * start patching towards rtc * add plugin path to patches * add a mess of plugins * turn down the plugins * drawio v13.5.3 * re-solve static * get rid of all the high unicode in schema * use utf-8 encoding explicitly * Update package.json * Update _static.ts * drawio v13.5.4 * resolve static * drawio v13.5.8 * move notebooks * start moving things around * add dodo.py * more moving * more moving * more moving and naming * moving * move static * fix up static path * update more ids, locations * skeleton docs * start doing it * start linting in anger * passing eslint * add prebuild * yet more linting * back to ts building * packing * hoist tarball * clean up static generation * apply lint in anger * more work on static * remove videochat for now, more ignoring * tune up ci, binder * use smaller env for now * underspecify python in ci, don't url-encode [p]lugins * gah windows * some win debugging * do some roadmap work * work on roadmap while debugging * do per-platform shell commands * linting, url param * look harder for npm * start thinking about versions * version bumping, more windows work * remove patterns from schema * add all task * more encoding, linting * rebuild static with iife * try another import template * versions in changelog * more work on alernate asset loading * revert menu investigations * paths for windows
2020-08-08 13:45:27 +00:00
# tools
PY = ["python"]
PYM = [*PY, "-m"]
PIP = [*PYM, "pip"]
2022-08-31 13:06:41 +00:00
PIP_CHECK_IGNORE = "^(No broken|pylint|sphinx-rtd-theme) "
Split up packages (#1) * add drawio * more tweaking of editor load * more work on packaging * linting, remove trace of mxgraph submodule * clean up empty file rendering * add some missing images * don't reinitialize url after every show * some css sugar * belt and suspenders ui theme * some more params * add export * working on logo * more logo work * full in-place round-tripping of svg, png, html * use icons on documents * clean up some untitled files * first pass at schema * start settings integration * more work on settings * fix ref * work on url params * some more tweaks to load behavior * move submodule * clean up some packaging stuff * jlpm * resolve yarn * fix iframe url * bump to newest drawio release * brinf back the stencils * html doesn't really work * add more images * move more things from code into config defaults * rework settings some more * fix new view, still working on click-to-activate * fix capitalization on compressXml * give up on formatting xml * more work on round-trip, styling * linting * more missing images * more config reloading * drawio v13.1.8 * bump drawio files * update notebook * upgrade typescript * more submodule shenanigans, binder env * regenerate again, was missing stencils * try adding server proxy * update path * fix schema * pin node * hoist jupyter_notebook_config.json * some more work on export * more x * add some more demo tools * use apt, some status * apt deps, get back icons * some more apt work * more apt work * better programmatic example * more status work * more docs * add some more text * some more notes * some more status work, notes * add jinja example * more work on notebook * move notebook * add some deps * more deps for pandas, pdf * use local drawio assets * stop servers harder * Create Data-Driven Decks.ipynb * Update drawio_export_demo.py * Create template deck.dio * fix up some chores * some notebook tweaks * more work on demo * try another labextension spot * notebooks * store composite drawio in pdf * use file:// for drawio static * drawio v13.3.5 * remove even more unused code * bump drawio, remove more tornado junk * clean up xml pattern * add notebook, because why not * add ipynb example to decks * add png, svg to composite * add video chat for giggles * drawio v13.3.8 * add plugins * more work on plugin stuff * drawio v13.3.9 * drawio v13.4.7 * resolve yarn.lock * add sourcemaps * drawio v13.4.9 * start patching towards rtc * add plugin path to patches * add a mess of plugins * turn down the plugins * drawio v13.5.3 * re-solve static * get rid of all the high unicode in schema * use utf-8 encoding explicitly * Update package.json * Update _static.ts * drawio v13.5.4 * resolve static * drawio v13.5.8 * move notebooks * start moving things around * add dodo.py * more moving * more moving * more moving and naming * moving * move static * fix up static path * update more ids, locations * skeleton docs * start doing it * start linting in anger * passing eslint * add prebuild * yet more linting * back to ts building * packing * hoist tarball * clean up static generation * apply lint in anger * more work on static * remove videochat for now, more ignoring * tune up ci, binder * use smaller env for now * underspecify python in ci, don't url-encode [p]lugins * gah windows * some win debugging * do some roadmap work * work on roadmap while debugging * do per-platform shell commands * linting, url param * look harder for npm * start thinking about versions * version bumping, more windows work * remove patterns from schema * add all task * more encoding, linting * rebuild static with iife * try another import template * versions in changelog * more work on alernate asset loading * revert menu investigations * paths for windows
2020-08-08 13:45:27 +00:00
NPM = (
shutil.which("npm")
or shutil.which("npm.cmd")
or shutil.which("npm.exe")
or shutil.which("npm.bat")
)
JLPM = ["jlpm"]
2023-04-09 16:46:27 +00:00
JLPM_INSTALL = [*JLPM, "--prefer-offline", "--ignore-optional"]
Split up packages (#1) * add drawio * more tweaking of editor load * more work on packaging * linting, remove trace of mxgraph submodule * clean up empty file rendering * add some missing images * don't reinitialize url after every show * some css sugar * belt and suspenders ui theme * some more params * add export * working on logo * more logo work * full in-place round-tripping of svg, png, html * use icons on documents * clean up some untitled files * first pass at schema * start settings integration * more work on settings * fix ref * work on url params * some more tweaks to load behavior * move submodule * clean up some packaging stuff * jlpm * resolve yarn * fix iframe url * bump to newest drawio release * brinf back the stencils * html doesn't really work * add more images * move more things from code into config defaults * rework settings some more * fix new view, still working on click-to-activate * fix capitalization on compressXml * give up on formatting xml * more work on round-trip, styling * linting * more missing images * more config reloading * drawio v13.1.8 * bump drawio files * update notebook * upgrade typescript * more submodule shenanigans, binder env * regenerate again, was missing stencils * try adding server proxy * update path * fix schema * pin node * hoist jupyter_notebook_config.json * some more work on export * more x * add some more demo tools * use apt, some status * apt deps, get back icons * some more apt work * more apt work * better programmatic example * more status work * more docs * add some more text * some more notes * some more status work, notes * add jinja example * more work on notebook * move notebook * add some deps * more deps for pandas, pdf * use local drawio assets * stop servers harder * Create Data-Driven Decks.ipynb * Update drawio_export_demo.py * Create template deck.dio * fix up some chores * some notebook tweaks * more work on demo * try another labextension spot * notebooks * store composite drawio in pdf * use file:// for drawio static * drawio v13.3.5 * remove even more unused code * bump drawio, remove more tornado junk * clean up xml pattern * add notebook, because why not * add ipynb example to decks * add png, svg to composite * add video chat for giggles * drawio v13.3.8 * add plugins * more work on plugin stuff * drawio v13.3.9 * drawio v13.4.7 * resolve yarn.lock * add sourcemaps * drawio v13.4.9 * start patching towards rtc * add plugin path to patches * add a mess of plugins * turn down the plugins * drawio v13.5.3 * re-solve static * get rid of all the high unicode in schema * use utf-8 encoding explicitly * Update package.json * Update _static.ts * drawio v13.5.4 * resolve static * drawio v13.5.8 * move notebooks * start moving things around * add dodo.py * more moving * more moving * more moving and naming * moving * move static * fix up static path * update more ids, locations * skeleton docs * start doing it * start linting in anger * passing eslint * add prebuild * yet more linting * back to ts building * packing * hoist tarball * clean up static generation * apply lint in anger * more work on static * remove videochat for now, more ignoring * tune up ci, binder * use smaller env for now * underspecify python in ci, don't url-encode [p]lugins * gah windows * some win debugging * do some roadmap work * work on roadmap while debugging * do per-platform shell commands * linting, url param * look harder for npm * start thinking about versions * version bumping, more windows work * remove patterns from schema * add all task * more encoding, linting * rebuild static with iife * try another import template * versions in changelog * more work on alernate asset loading * revert menu investigations * paths for windows
2020-08-08 13:45:27 +00:00
LAB_EXT = ["jupyter", "labextension"]
LAB = ["jupyter", "lab"]
PRETTIER = [str(NODE_MODULES / ".bin" / "prettier")]
# tests
EXAMPLES = ROOT / "notebooks"
EXAMPLE_IPYNB = _clean(EXAMPLES.rglob("*.ipynb"))
Split up packages (#1) * add drawio * more tweaking of editor load * more work on packaging * linting, remove trace of mxgraph submodule * clean up empty file rendering * add some missing images * don't reinitialize url after every show * some css sugar * belt and suspenders ui theme * some more params * add export * working on logo * more logo work * full in-place round-tripping of svg, png, html * use icons on documents * clean up some untitled files * first pass at schema * start settings integration * more work on settings * fix ref * work on url params * some more tweaks to load behavior * move submodule * clean up some packaging stuff * jlpm * resolve yarn * fix iframe url * bump to newest drawio release * brinf back the stencils * html doesn't really work * add more images * move more things from code into config defaults * rework settings some more * fix new view, still working on click-to-activate * fix capitalization on compressXml * give up on formatting xml * more work on round-trip, styling * linting * more missing images * more config reloading * drawio v13.1.8 * bump drawio files * update notebook * upgrade typescript * more submodule shenanigans, binder env * regenerate again, was missing stencils * try adding server proxy * update path * fix schema * pin node * hoist jupyter_notebook_config.json * some more work on export * more x * add some more demo tools * use apt, some status * apt deps, get back icons * some more apt work * more apt work * better programmatic example * more status work * more docs * add some more text * some more notes * some more status work, notes * add jinja example * more work on notebook * move notebook * add some deps * more deps for pandas, pdf * use local drawio assets * stop servers harder * Create Data-Driven Decks.ipynb * Update drawio_export_demo.py * Create template deck.dio * fix up some chores * some notebook tweaks * more work on demo * try another labextension spot * notebooks * store composite drawio in pdf * use file:// for drawio static * drawio v13.3.5 * remove even more unused code * bump drawio, remove more tornado junk * clean up xml pattern * add notebook, because why not * add ipynb example to decks * add png, svg to composite * add video chat for giggles * drawio v13.3.8 * add plugins * more work on plugin stuff * drawio v13.3.9 * drawio v13.4.7 * resolve yarn.lock * add sourcemaps * drawio v13.4.9 * start patching towards rtc * add plugin path to patches * add a mess of plugins * turn down the plugins * drawio v13.5.3 * re-solve static * get rid of all the high unicode in schema * use utf-8 encoding explicitly * Update package.json * Update _static.ts * drawio v13.5.4 * resolve static * drawio v13.5.8 * move notebooks * start moving things around * add dodo.py * more moving * more moving * more moving and naming * moving * move static * fix up static path * update more ids, locations * skeleton docs * start doing it * start linting in anger * passing eslint * add prebuild * yet more linting * back to ts building * packing * hoist tarball * clean up static generation * apply lint in anger * more work on static * remove videochat for now, more ignoring * tune up ci, binder * use smaller env for now * underspecify python in ci, don't url-encode [p]lugins * gah windows * some win debugging * do some roadmap work * work on roadmap while debugging * do per-platform shell commands * linting, url param * look harder for npm * start thinking about versions * version bumping, more windows work * remove patterns from schema * add all task * more encoding, linting * rebuild static with iife * try another import template * versions in changelog * more work on alernate asset loading * revert menu investigations * paths for windows
2020-08-08 13:45:27 +00:00
DIST_NBHTML = DIST / "nbsmoke"
ATEST = ROOT / "atest"
ATEST_DIO = _clean(ATEST.rglob("*.dio"), ATEST.rglob("*.dio.svg"))
2023-04-10 14:09:29 +00:00
ATEST_OUT = REPORTS / "atest"
2021-01-26 04:41:26 +00:00
ATEST_OUT_XML = "output.xml"
ATEST_TEMPLATES = [*ATEST.rglob("*.robot.j2")]
Split up packages (#1) * add drawio * more tweaking of editor load * more work on packaging * linting, remove trace of mxgraph submodule * clean up empty file rendering * add some missing images * don't reinitialize url after every show * some css sugar * belt and suspenders ui theme * some more params * add export * working on logo * more logo work * full in-place round-tripping of svg, png, html * use icons on documents * clean up some untitled files * first pass at schema * start settings integration * more work on settings * fix ref * work on url params * some more tweaks to load behavior * move submodule * clean up some packaging stuff * jlpm * resolve yarn * fix iframe url * bump to newest drawio release * brinf back the stencils * html doesn't really work * add more images * move more things from code into config defaults * rework settings some more * fix new view, still working on click-to-activate * fix capitalization on compressXml * give up on formatting xml * more work on round-trip, styling * linting * more missing images * more config reloading * drawio v13.1.8 * bump drawio files * update notebook * upgrade typescript * more submodule shenanigans, binder env * regenerate again, was missing stencils * try adding server proxy * update path * fix schema * pin node * hoist jupyter_notebook_config.json * some more work on export * more x * add some more demo tools * use apt, some status * apt deps, get back icons * some more apt work * more apt work * better programmatic example * more status work * more docs * add some more text * some more notes * some more status work, notes * add jinja example * more work on notebook * move notebook * add some deps * more deps for pandas, pdf * use local drawio assets * stop servers harder * Create Data-Driven Decks.ipynb * Update drawio_export_demo.py * Create template deck.dio * fix up some chores * some notebook tweaks * more work on demo * try another labextension spot * notebooks * store composite drawio in pdf * use file:// for drawio static * drawio v13.3.5 * remove even more unused code * bump drawio, remove more tornado junk * clean up xml pattern * add notebook, because why not * add ipynb example to decks * add png, svg to composite * add video chat for giggles * drawio v13.3.8 * add plugins * more work on plugin stuff * drawio v13.3.9 * drawio v13.4.7 * resolve yarn.lock * add sourcemaps * drawio v13.4.9 * start patching towards rtc * add plugin path to patches * add a mess of plugins * turn down the plugins * drawio v13.5.3 * re-solve static * get rid of all the high unicode in schema * use utf-8 encoding explicitly * Update package.json * Update _static.ts * drawio v13.5.4 * resolve static * drawio v13.5.8 * move notebooks * start moving things around * add dodo.py * more moving * more moving * more moving and naming * moving * move static * fix up static path * update more ids, locations * skeleton docs * start doing it * start linting in anger * passing eslint * add prebuild * yet more linting * back to ts building * packing * hoist tarball * clean up static generation * apply lint in anger * more work on static * remove videochat for now, more ignoring * tune up ci, binder * use smaller env for now * underspecify python in ci, don't url-encode [p]lugins * gah windows * some win debugging * do some roadmap work * work on roadmap while debugging * do per-platform shell commands * linting, url param * look harder for npm * start thinking about versions * version bumping, more windows work * remove patterns from schema * add all task * more encoding, linting * rebuild static with iife * try another import template * versions in changelog * more work on alernate asset loading * revert menu investigations * paths for windows
2020-08-08 13:45:27 +00:00
# js packages
JS_NS = "deathbeds"
2023-04-09 16:46:27 +00:00
JS_META = PACKAGES / "_meta"
IPYDIO = PACKAGES / "ipydrawio"
2021-04-11 14:35:35 +00:00
TSCONFIGBASE = PACKAGES / "tsconfigbase.json"
TSCONFIG_TYPEDOC = PACKAGES / "tsconfig.typedoc.json"
TYPEDOC_JSON = PACKAGES / "typedoc.json"
TYPEDOC_CONF = [TSCONFIG_TYPEDOC, TYPEDOC_JSON]
NO_TYPEDOC = ["_meta", "ipydrawio-webpack"]
# so many js packages
JS_PKG_JSON = {p.parent.name: p for p in PACKAGES.glob("*/package.json")}
2021-11-27 19:55:31 +00:00
JS_PKG_DATA = {k: json.loads(v.read_text(**ENC)) for k, v in JS_PKG_JSON.items()}
JS_PKG_JSON_LABEXT = {
k: v
for k, v in JS_PKG_JSON.items()
if JS_PKG_DATA[k].get("jupyterlab", {}).get("extension")
}
JS_LABEXT_PY_HOST = {
k: JS_PKG_DATA[k]["jupyterlab"]["discovery"]["server"]["base"]["name"]
for k, v in JS_PKG_JSON.items()
if JS_PKG_DATA[k].get("jupyterlab", {}).get("discovery")
}
JS_PKG_NOT_META = {k: v for k, v in JS_PKG_JSON.items() if k.startswith("_")}
2021-06-22 17:25:48 +00:00
def _norm_js_version(pkg):
2023-04-09 16:46:27 +00:00
"""Undo some package weirdness."""
2021-06-22 17:25:48 +00:00
v = pkg["version"]
final = ""
# alphas, beta use dashes
for dashed in v.split("-"):
if final:
final += "-"
for dotted in dashed.split("."):
if final:
final += "."
if re.findall(r"^\d+$", dotted):
final += str(int(dotted))
else:
final += dotted
return final
JS_TARBALL = {
k: JS_PKG_JSON[k].parent
2021-06-22 17:25:48 +00:00
/ f"""{v["name"].replace('@', '').replace("/", "-")}-{_norm_js_version(v)}.tgz"""
for k, v in JS_PKG_DATA.items()
if k not in JS_PKG_NOT_META
}
JS_TSCONFIG = {
2021-04-12 17:47:32 +00:00
k: v.parent / "src/tsconfig.json"
for k, v in JS_PKG_JSON.items()
2021-04-12 17:47:32 +00:00
if (v.parent / "src/tsconfig.json").exists()
}
JS_TSSRC = {
k: sorted(
2021-04-12 17:47:32 +00:00
[
*(v.parent).rglob("*.ts"),
*(v.parent / "src").rglob("*.tsx"),
2023-04-09 16:46:27 +00:00
],
)
for k, v in JS_TSCONFIG.items()
}
2021-04-12 17:47:32 +00:00
JS_TSBUILDINFO = {
k: v.parent.parent / ".src.tsbuildinfo" for k, v in JS_TSCONFIG.items()
}
JS_STYLE = {
k: sorted((v.parent / "style").glob("*.css"))
for k, v in JS_PKG_JSON.items()
if (v.parent / "style").exists()
}
JS_PY_SCRIPTS = {
k: sorted((v.parent / "scripts").glob("*.py"))
for k, v in JS_PKG_JSON.items()
if (v.parent / "scripts").exists()
}
JS_SCHEMAS = {
k: sorted((v.parent / "schema").glob("*.json"))
for k, v in JS_PKG_JSON.items()
if (v.parent / "schema").exists()
}
2022-11-07 17:20:52 +00:00
# special things for ipydrawio-webpack and friends
IPDWP = JS_PKG_JSON["ipydrawio-webpack"].parent
IPDWP_APP = IPDWP / "dio/js/app.min.js"
IPDWP_PY = (IPDWP / "scripts").rglob("*.py")
DRAWIO = IPDWP / "drawio"
IPDWP_LIB = IPDWP / "lib"
IPDWP_IGNORE = IPDWP / ".npmignore"
ALL_IPDWP_JS = IPDWP_LIB.glob("*.js")
2022-11-07 17:20:52 +00:00
IPDM_JS = JS_PKG_JSON["ipydrawio-mathjax"].parent
IPDM_JS_LIB = IPDM_JS / "lib"
ALL_IPDM_JS = IPDM_JS_LIB.glob("*.js")
IPJT = JS_PKG_JSON["ipydrawio-jupyter-templates"].parent
IPJT_TMPL = IPJT / "tmpl"
IPJT_TMPL_DIO = _clean(
IPJT_TMPL.rglob("*.dio"),
IPJT_TMPL.rglob("*.dio.svg"),
)
PY_PACKAGES = ROOT / "py_packages"
PY_SETUP = {p.parent.name: p for p in sorted((ROOT / "py_packages").glob("*/setup.py"))}
PY_SRC = {k: sorted((v.parent / "src").rglob("*.py")) for k, v in PY_SETUP.items()}
PY_SETUP_CFG = {k: v.parent / "setup.cfg" for k, v in PY_SETUP.items()}
PY_VERSION = {
"ipydrawio": JS_PKG_DATA["ipydrawio"]["version"],
"ipydrawio-export": JS_PKG_DATA["ipydrawio-pdf"]["version"],
"ipydrawio-widgets": JS_PKG_DATA["ipydrawio"]["version"],
2022-11-07 17:20:52 +00:00
"ipydrawio-mathjax": JS_PKG_DATA["ipydrawio-mathjax"]["version"],
}
IPD = PY_SETUP["ipydrawio"].parent
IPDE = PY_SETUP["ipydrawio-export"].parent
IPDW = PY_SETUP["ipydrawio-widgets"].parent
2022-11-07 17:20:52 +00:00
IPDM = PY_SETUP["ipydrawio-mathjax"].parent
2021-11-27 19:55:31 +00:00
IPDE_VENDOR = IPDE / "src/ipydrawio_export/vendor"
IPDE_DIE2 = IPDE_VENDOR / "draw-image-export2"
IPDE_DIE2_PACKAGE_JSON = IPDE_DIE2 / "package.json"
IPDE_DIE2_YARN_LOCK = IPDE_DIE2 / "yarn.lock"
IPDW_SRC = IPDW / "src/ipydrawio_widgets"
IPDW_DEPS = {
JS_PKG_JSON["ipydrawio"]: IPDW_SRC / "js/package.json",
JS_PKG_JSON["ipydrawio"].parent / "schema/plugin.json": IPDW_SRC / "js/plugin.json",
}
2022-11-07 17:20:52 +00:00
IPDM_STARTUP = JS_PKG_JSON["ipydrawio-mathjax"].parent / "dio/math/es5/startup.js"
2022-11-07 17:20:52 +00:00
PY_HAS_EXT = {IPD: True, IPDE: True, IPDW: False, IPDM: True}
2022-11-05 20:39:26 +00:00
SERVER_EXT = {
k: sorted(v.parent.glob("src/*/serverextension.py"))[0]
for k, v in PY_SETUP.items()
if sorted(v.parent.glob("src/*/serverextension.py"))
}
JS_PKG_PACK = {
k: [[v.parent / "package.json", *v.parent.glob("schema/*.json")], [v]]
for k, v in JS_TARBALL.items()
}
[
JS_PKG_PACK[k][0].append(v)
for k, v in JS_TSBUILDINFO.items()
if not k.startswith("_")
]
2023-04-10 14:09:29 +00:00
OK_PYSETUP = {k: OK / f"pysetup.{k}.ok" for k, v in PY_SETUP.items()}
2022-11-05 20:39:26 +00:00
PY_SETUP_DEPS = {
IPD: lambda: [OK_PYSETUP["ipydrawio-widgets"]],
IPDE: lambda: [OK_PYSETUP["ipydrawio"]],
IPDW: lambda: [*IPDW_DEPS.values()],
2022-11-07 17:20:52 +00:00
IPDM: lambda: [OK_PYSETUP["ipydrawio"], IPDM_STARTUP],
}
PY_SDIST = {
2022-11-07 17:20:52 +00:00
name: PY_PACKAGES / name / f"dist/{name}-{PY_VERSION[name]}.tar.gz"
for name, version in PY_VERSION.items()
}
2022-11-07 17:20:52 +00:00
PY_WHEEL = {
2022-11-07 17:20:52 +00:00
name: PY_PACKAGES
/ name
/ f"""dist/{name.replace("-", "_")}-{PY_VERSION[name]}-py3-none-any.whl"""
for name, version in PY_VERSION.items()
}
2022-11-07 17:20:52 +00:00
PY_TEST_DEP = {}
2021-07-06 13:40:08 +00:00
# demo
2021-07-30 21:52:47 +00:00
RE_CONDA_FORGE_URL = r"/conda-forge/(.*/)?(noarch|linux-64|win-64|osx-64)/([^/]+)$"
2022-06-09 23:55:24 +00:00
CONDA_FORGE_RELEASE = "https://conda.anaconda.org/conda-forge"
2021-07-30 21:52:47 +00:00
FED_EXT_MARKER = "### FEDERATED EXTENSIONS ###"
2021-07-06 13:40:08 +00:00
DEMO = ROOT / "demo"
2021-11-27 19:55:31 +00:00
DEMO_FILES = DEMO / "files"
2021-07-24 16:36:07 +00:00
DEMO_CONFIG = DEMO / "jupyter_lite_config.json"
2021-11-27 19:55:31 +00:00
DEMO_REQS = DEMO / "requirements.txt"
2021-07-06 13:40:08 +00:00
DEMO_APPS = ["lab"]
DEMO_BUILD = BUILD / "demo"
DEMO_HASHES = DEMO_BUILD / "SHA256SUMS"
DEMO_CONTENTS_API = DEMO_BUILD / "api/contents/all.json"
2021-07-06 13:40:08 +00:00
DEMO_ARCHIVE = (
DEMO_BUILD / f"""ipydrawio-lite-{JS_PKG_DATA["ipydrawio"]["version"]}.tgz"""
)
BUILD_WHEELS = BUILD / "wheels"
2021-11-27 19:55:31 +00:00
DEMO_WHEELS = DEMO / "pypi"
NOARCH_WHL = "py3-none-any.whl"
IGNORED_WHEELS = ["widgetsnbextension", "nbformat", "ipykernel", "pyolite"]
2023-04-12 15:28:54 +00:00
# sync with jupyterlite-pyodide-kernel
PYODIDE_URL = "https://cdn.jsdelivr.net/pyodide/v0.23.0/full"
2021-11-27 19:55:31 +00:00
PYODIDE_PACKAGES = BUILD / "pyodide-packages.json"
# docs
2023-04-09 16:46:27 +00:00
SPHINX_ARGS = json.loads(os.environ.get("SPHINX_ARGS", """["-W"]"""))
DOCS_CONF = DOCS / "conf.py"
ENV_DOCS = DOCS / "environment.yml"
DOCS_BUILD = BUILD / "docs"
DOCS_BUILDINFO = DOCS_BUILD / ".buildinfo"
DOCS_MD = _clean(
[
p
for p in DOCS.rglob("*.md")
if not (p.parent.name == "ts" or p.parent.parent.name == "ts")
2023-04-09 16:46:27 +00:00
],
)
DOCS_DIO = _clean(DOCS.rglob("*.dio"), DOCS.rglob("*.dio.svg"))
DOCS_RST = _clean(DOCS.rglob("*.rst"))
DOCS_IPYNB = _clean(DOCS.rglob("*.ipynb"))
DOCS_SRC = _clean(DOCS_MD, DOCS_RST, DOCS_IPYNB)
DOCS_STATIC = DOCS / "_static"
2022-08-31 13:06:41 +00:00
ALL_DOCS_STATIC = [p for p in DOCS_STATIC.rglob("*") if not p.is_dir()]
DOCS_FAVICON_SVG = DOCS_STATIC / "icon.svg"
DOCS_FAVICON_ICO = DOCS_STATIC / "favicon.ico"
DOCS_TS = DOCS / "api/ts"
DOCS_TS_MYST_INDEX = DOCS_TS / "index.md"
DOCS_TS_MODULES = [
2022-11-05 20:39:26 +00:00
ROOT / "docs/api/ts/modules" / f"deathbeds_{p.parent.name.replace('-','_')}.md"
for p in JS_PKG_JSON.values()
if p.parent.name not in NO_TYPEDOC
]
DOCS_RAW_TYPEDOC = BUILD / "typedoc"
DOCS_RAW_TYPEDOC_README = DOCS_RAW_TYPEDOC / "README.md"
MD_FOOTER = """
```
2023-04-09 16:46:27 +00:00
Copyright 2023 ipydrawio contributors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
```
"""
# collections, mostly for linting
ALL_PY = [
*ATEST.rglob("*.py"),
2021-04-12 11:55:08 +00:00
*BINDER.glob("*.py"),
*IPDWP_PY,
2021-04-12 11:55:08 +00:00
*PY_SETUP.values(),
*SCRIPTS.glob("*.py"),
*sum(JS_PY_SCRIPTS.values(), []),
*sum(PY_SRC.values(), []),
DODO,
2021-04-12 11:55:08 +00:00
POSTBUILD_PY,
DOCS_CONF,
]
2021-07-06 13:40:08 +00:00
ALL_YML = _clean(
ROOT.glob("*.yml"),
GH.rglob("*.yml"),
BINDER.glob("*.yml"),
DOCS.rglob("*.yml"),
)
2022-11-05 20:39:26 +00:00
ALL_PACKAGE_JSON = [PACKAGE, *JS_PKG_JSON.values()]
Split up packages (#1) * add drawio * more tweaking of editor load * more work on packaging * linting, remove trace of mxgraph submodule * clean up empty file rendering * add some missing images * don't reinitialize url after every show * some css sugar * belt and suspenders ui theme * some more params * add export * working on logo * more logo work * full in-place round-tripping of svg, png, html * use icons on documents * clean up some untitled files * first pass at schema * start settings integration * more work on settings * fix ref * work on url params * some more tweaks to load behavior * move submodule * clean up some packaging stuff * jlpm * resolve yarn * fix iframe url * bump to newest drawio release * brinf back the stencils * html doesn't really work * add more images * move more things from code into config defaults * rework settings some more * fix new view, still working on click-to-activate * fix capitalization on compressXml * give up on formatting xml * more work on round-trip, styling * linting * more missing images * more config reloading * drawio v13.1.8 * bump drawio files * update notebook * upgrade typescript * more submodule shenanigans, binder env * regenerate again, was missing stencils * try adding server proxy * update path * fix schema * pin node * hoist jupyter_notebook_config.json * some more work on export * more x * add some more demo tools * use apt, some status * apt deps, get back icons * some more apt work * more apt work * better programmatic example * more status work * more docs * add some more text * some more notes * some more status work, notes * add jinja example * more work on notebook * move notebook * add some deps * more deps for pandas, pdf * use local drawio assets * stop servers harder * Create Data-Driven Decks.ipynb * Update drawio_export_demo.py * Create template deck.dio * fix up some chores * some notebook tweaks * more work on demo * try another labextension spot * notebooks * store composite drawio in pdf * use file:// for drawio static * drawio v13.3.5 * remove even more unused code * bump drawio, remove more tornado junk * clean up xml pattern * add notebook, because why not * add ipynb example to decks * add png, svg to composite * add video chat for giggles * drawio v13.3.8 * add plugins * more work on plugin stuff * drawio v13.3.9 * drawio v13.4.7 * resolve yarn.lock * add sourcemaps * drawio v13.4.9 * start patching towards rtc * add plugin path to patches * add a mess of plugins * turn down the plugins * drawio v13.5.3 * re-solve static * get rid of all the high unicode in schema * use utf-8 encoding explicitly * Update package.json * Update _static.ts * drawio v13.5.4 * resolve static * drawio v13.5.8 * move notebooks * start moving things around * add dodo.py * more moving * more moving * more moving and naming * moving * move static * fix up static path * update more ids, locations * skeleton docs * start doing it * start linting in anger * passing eslint * add prebuild * yet more linting * back to ts building * packing * hoist tarball * clean up static generation * apply lint in anger * more work on static * remove videochat for now, more ignoring * tune up ci, binder * use smaller env for now * underspecify python in ci, don't url-encode [p]lugins * gah windows * some win debugging * do some roadmap work * work on roadmap while debugging * do per-platform shell commands * linting, url param * look harder for npm * start thinking about versions * version bumping, more windows work * remove patterns from schema * add all task * more encoding, linting * rebuild static with iife * try another import template * versions in changelog * more work on alernate asset loading * revert menu investigations * paths for windows
2020-08-08 13:45:27 +00:00
ALL_JSON = [
*ROOT.glob("*.json"),
*PACKAGES.glob("*/*.json"),
*PACKAGES.glob("*/schema/*.json"),
*ATEST.glob("fixtures/*.json"),
2021-04-11 14:35:35 +00:00
*BINDER.glob("*.json"),
2021-11-27 19:55:31 +00:00
*[
p
for p in DEMO.rglob("*.json")
if "/_output/" not in str(p)
and "/.cache/" not in str(p)
and p not in [DEMO_CONFIG]
2021-11-27 19:55:31 +00:00
],
]
ALL_DIO = [*DOCS_DIO, *IPJT_TMPL_DIO, *ATEST_DIO]
2022-11-07 17:20:52 +00:00
ALL_MD = [*ROOT.glob("*.md"), *PACKAGES.glob("*/*.md"), *DOCS_MD, *GH.rglob("*.md")]
2023-04-09 16:46:27 +00:00
ALL_SETUP_CFG = [*PY_SETUP_CFG.values()]
2021-04-11 14:35:35 +00:00
ALL_JS = [PACKAGES / ".eslintrc.js"]
ALL_TS = sum(JS_TSSRC.values(), [])
2022-08-31 13:06:41 +00:00
ALL_SRC_CSS = [*sum(JS_STYLE.values(), [])]
ALL_CSS = [*ALL_SRC_CSS, *DOCS.rglob("*.css")]
ALL_ROBOT = [*ATEST.rglob("*.robot")]
2021-04-11 14:35:35 +00:00
ALL_PRETTIER = [*ALL_YML, *ALL_JSON, *ALL_MD, *ALL_TS, *ALL_CSS, *ALL_JS]
ALL_HEADERS = _clean(
ALL_SETUP_CFG,
ALL_PY,
ALL_TS,
ALL_CSS,
ALL_JS,
ALL_MD,
ALL_YML,
ALL_ROBOT,
)
ALL_DEMO_SOURCES = [
2021-07-06 13:40:08 +00:00
d
for d in ALL_DIO
if "test" not in str(d.relative_to(ROOT)).lower()
2021-07-06 13:40:08 +00:00
and ".doit" not in d.name
and " " not in d.name
and d.name not in ["A.dio"]
] + [*DOCS.glob("*.ipynb")]
ALL_DEMO_CONTENTS = {p: DEMO_FILES / p.name for p in sorted(ALL_DEMO_SOURCES)}
2021-07-06 13:40:08 +00:00
2021-04-11 14:35:35 +00:00
ESLINTRC = PACKAGES / ".eslintrc.js"
Split up packages (#1) * add drawio * more tweaking of editor load * more work on packaging * linting, remove trace of mxgraph submodule * clean up empty file rendering * add some missing images * don't reinitialize url after every show * some css sugar * belt and suspenders ui theme * some more params * add export * working on logo * more logo work * full in-place round-tripping of svg, png, html * use icons on documents * clean up some untitled files * first pass at schema * start settings integration * more work on settings * fix ref * work on url params * some more tweaks to load behavior * move submodule * clean up some packaging stuff * jlpm * resolve yarn * fix iframe url * bump to newest drawio release * brinf back the stencils * html doesn't really work * add more images * move more things from code into config defaults * rework settings some more * fix new view, still working on click-to-activate * fix capitalization on compressXml * give up on formatting xml * more work on round-trip, styling * linting * more missing images * more config reloading * drawio v13.1.8 * bump drawio files * update notebook * upgrade typescript * more submodule shenanigans, binder env * regenerate again, was missing stencils * try adding server proxy * update path * fix schema * pin node * hoist jupyter_notebook_config.json * some more work on export * more x * add some more demo tools * use apt, some status * apt deps, get back icons * some more apt work * more apt work * better programmatic example * more status work * more docs * add some more text * some more notes * some more status work, notes * add jinja example * more work on notebook * move notebook * add some deps * more deps for pandas, pdf * use local drawio assets * stop servers harder * Create Data-Driven Decks.ipynb * Update drawio_export_demo.py * Create template deck.dio * fix up some chores * some notebook tweaks * more work on demo * try another labextension spot * notebooks * store composite drawio in pdf * use file:// for drawio static * drawio v13.3.5 * remove even more unused code * bump drawio, remove more tornado junk * clean up xml pattern * add notebook, because why not * add ipynb example to decks * add png, svg to composite * add video chat for giggles * drawio v13.3.8 * add plugins * more work on plugin stuff * drawio v13.3.9 * drawio v13.4.7 * resolve yarn.lock * add sourcemaps * drawio v13.4.9 * start patching towards rtc * add plugin path to patches * add a mess of plugins * turn down the plugins * drawio v13.5.3 * re-solve static * get rid of all the high unicode in schema * use utf-8 encoding explicitly * Update package.json * Update _static.ts * drawio v13.5.4 * resolve static * drawio v13.5.8 * move notebooks * start moving things around * add dodo.py * more moving * more moving * more moving and naming * moving * move static * fix up static path * update more ids, locations * skeleton docs * start doing it * start linting in anger * passing eslint * add prebuild * yet more linting * back to ts building * packing * hoist tarball * clean up static generation * apply lint in anger * more work on static * remove videochat for now, more ignoring * tune up ci, binder * use smaller env for now * underspecify python in ci, don't url-encode [p]lugins * gah windows * some win debugging * do some roadmap work * work on roadmap while debugging * do per-platform shell commands * linting, url param * look harder for npm * start thinking about versions * version bumping, more windows work * remove patterns from schema * add all task * more encoding, linting * rebuild static with iife * try another import template * versions in changelog * more work on alernate asset loading * revert menu investigations * paths for windows
2020-08-08 13:45:27 +00:00
RFLINT_OPTS = sum(
[
["--ignore", c]
for c in [
"FileTooLong",
"LineTooLong",
"RequireKeywordDocumentation",
"RequireKeywordDocumentation",
"TooFewKeywordSteps",
"TooFewTestSteps",
"TooManyTestSteps",
]
],
[],
)
2022-11-07 17:20:52 +00:00
# drawio-derived
JS_PKG_PACK[IPDWP.name][0] += [
IPDWP_IGNORE,
IPDWP_APP,
*ALL_IPDWP_JS,
]
Split up packages (#1) * add drawio * more tweaking of editor load * more work on packaging * linting, remove trace of mxgraph submodule * clean up empty file rendering * add some missing images * don't reinitialize url after every show * some css sugar * belt and suspenders ui theme * some more params * add export * working on logo * more logo work * full in-place round-tripping of svg, png, html * use icons on documents * clean up some untitled files * first pass at schema * start settings integration * more work on settings * fix ref * work on url params * some more tweaks to load behavior * move submodule * clean up some packaging stuff * jlpm * resolve yarn * fix iframe url * bump to newest drawio release * brinf back the stencils * html doesn't really work * add more images * move more things from code into config defaults * rework settings some more * fix new view, still working on click-to-activate * fix capitalization on compressXml * give up on formatting xml * more work on round-trip, styling * linting * more missing images * more config reloading * drawio v13.1.8 * bump drawio files * update notebook * upgrade typescript * more submodule shenanigans, binder env * regenerate again, was missing stencils * try adding server proxy * update path * fix schema * pin node * hoist jupyter_notebook_config.json * some more work on export * more x * add some more demo tools * use apt, some status * apt deps, get back icons * some more apt work * more apt work * better programmatic example * more status work * more docs * add some more text * some more notes * some more status work, notes * add jinja example * more work on notebook * move notebook * add some deps * more deps for pandas, pdf * use local drawio assets * stop servers harder * Create Data-Driven Decks.ipynb * Update drawio_export_demo.py * Create template deck.dio * fix up some chores * some notebook tweaks * more work on demo * try another labextension spot * notebooks * store composite drawio in pdf * use file:// for drawio static * drawio v13.3.5 * remove even more unused code * bump drawio, remove more tornado junk * clean up xml pattern * add notebook, because why not * add ipynb example to decks * add png, svg to composite * add video chat for giggles * drawio v13.3.8 * add plugins * more work on plugin stuff * drawio v13.3.9 * drawio v13.4.7 * resolve yarn.lock * add sourcemaps * drawio v13.4.9 * start patching towards rtc * add plugin path to patches * add a mess of plugins * turn down the plugins * drawio v13.5.3 * re-solve static * get rid of all the high unicode in schema * use utf-8 encoding explicitly * Update package.json * Update _static.ts * drawio v13.5.4 * resolve static * drawio v13.5.8 * move notebooks * start moving things around * add dodo.py * more moving * more moving * more moving and naming * moving * move static * fix up static path * update more ids, locations * skeleton docs * start doing it * start linting in anger * passing eslint * add prebuild * yet more linting * back to ts building * packing * hoist tarball * clean up static generation * apply lint in anger * more work on static * remove videochat for now, more ignoring * tune up ci, binder * use smaller env for now * underspecify python in ci, don't url-encode [p]lugins * gah windows * some win debugging * do some roadmap work * work on roadmap while debugging * do per-platform shell commands * linting, url param * look harder for npm * start thinking about versions * version bumping, more windows work * remove patterns from schema * add all task * more encoding, linting * rebuild static with iife * try another import template * versions in changelog * more work on alernate asset loading * revert menu investigations * paths for windows
2020-08-08 13:45:27 +00:00
2022-11-07 17:20:52 +00:00
JS_PKG_PACK[IPDM.name][0] += [IPDWP_IGNORE, IPDWP_APP, *ALL_IPDM_JS, IPDM_STARTUP]
# provisioning stuff
IPYDRAWIO_DATA_DIR = Path(sys.prefix) / "share/jupyter/ipydrawio_export"
Split up packages (#1) * add drawio * more tweaking of editor load * more work on packaging * linting, remove trace of mxgraph submodule * clean up empty file rendering * add some missing images * don't reinitialize url after every show * some css sugar * belt and suspenders ui theme * some more params * add export * working on logo * more logo work * full in-place round-tripping of svg, png, html * use icons on documents * clean up some untitled files * first pass at schema * start settings integration * more work on settings * fix ref * work on url params * some more tweaks to load behavior * move submodule * clean up some packaging stuff * jlpm * resolve yarn * fix iframe url * bump to newest drawio release * brinf back the stencils * html doesn't really work * add more images * move more things from code into config defaults * rework settings some more * fix new view, still working on click-to-activate * fix capitalization on compressXml * give up on formatting xml * more work on round-trip, styling * linting * more missing images * more config reloading * drawio v13.1.8 * bump drawio files * update notebook * upgrade typescript * more submodule shenanigans, binder env * regenerate again, was missing stencils * try adding server proxy * update path * fix schema * pin node * hoist jupyter_notebook_config.json * some more work on export * more x * add some more demo tools * use apt, some status * apt deps, get back icons * some more apt work * more apt work * better programmatic example * more status work * more docs * add some more text * some more notes * some more status work, notes * add jinja example * more work on notebook * move notebook * add some deps * more deps for pandas, pdf * use local drawio assets * stop servers harder * Create Data-Driven Decks.ipynb * Update drawio_export_demo.py * Create template deck.dio * fix up some chores * some notebook tweaks * more work on demo * try another labextension spot * notebooks * store composite drawio in pdf * use file:// for drawio static * drawio v13.3.5 * remove even more unused code * bump drawio, remove more tornado junk * clean up xml pattern * add notebook, because why not * add ipynb example to decks * add png, svg to composite * add video chat for giggles * drawio v13.3.8 * add plugins * more work on plugin stuff * drawio v13.3.9 * drawio v13.4.7 * resolve yarn.lock * add sourcemaps * drawio v13.4.9 * start patching towards rtc * add plugin path to patches * add a mess of plugins * turn down the plugins * drawio v13.5.3 * re-solve static * get rid of all the high unicode in schema * use utf-8 encoding explicitly * Update package.json * Update _static.ts * drawio v13.5.4 * resolve static * drawio v13.5.8 * move notebooks * start moving things around * add dodo.py * more moving * more moving * more moving and naming * moving * move static * fix up static path * update more ids, locations * skeleton docs * start doing it * start linting in anger * passing eslint * add prebuild * yet more linting * back to ts building * packing * hoist tarball * clean up static generation * apply lint in anger * more work on static * remove videochat for now, more ignoring * tune up ci, binder * use smaller env for now * underspecify python in ci, don't url-encode [p]lugins * gah windows * some win debugging * do some roadmap work * work on roadmap while debugging * do per-platform shell commands * linting, url param * look harder for npm * start thinking about versions * version bumping, more windows work * remove patterns from schema * add all task * more encoding, linting * rebuild static with iife * try another import template * versions in changelog * more work on alernate asset loading * revert menu investigations * paths for windows
2020-08-08 13:45:27 +00:00
# built files
2023-04-10 14:09:29 +00:00
OK_PIP_CHECK = OK / "pip.check.ok"
OK_INTEGRITY = OK / "integrity.ok"
OK_SUBMODULES = OK / "submodules.ok"
OK_BLACK = OK / "black.ok"
OK_BLACK_JUPYTER = OK / "black.jupyter.ok"
OK_NBQA_RUFF = OK / "nbqa.ruff.ok"
OK_RUFF = OK / "ruff.ok"
OK_FLAKE8 = OK / "flake8.ok"
OK_SSORT = OK / "ssort.ok"
OK_LINT = OK / "lint.ok"
OK_ROBOTIDY = OK / "robot.tidy.ok"
OK_PRETTIER = OK / "prettier.ok"
OK_ESLINT = OK / "eslint.ok"
OK_JS_BUILD_PRE = OK / "js.build.pre.ok"
OK_JS_BUILD = OK / "js.build.ok"
OK_PYTEST = {k: OK / f"pytest.{k}.ok" for k, v in PY_SETUP.items()}
OK_SERVEREXT = {k: OK / f"serverext.{k}.ok" for k, v in SERVER_EXT.items()}
OK_PROVISION = OK / "provision.ok"
OK_ROBOT_DRYRUN = OK / "robot.dryrun.ok"
OK_ROBOCOP = OK / "robot.robocop.ok"
OK_DIOLINT = OK / "dio.lint.ok"
OK_ATEST = OK / "atest.ok"
OK_CONDA_TEST = OK / "conda-build.test.ok"
OK_LINK_CHECK = OK / "pytest-check-links.ok"
OK_EXT_BUILD = {k: OK / f"ext.build.{k}.ok" for k in JS_LABEXT_PY_HOST}
PY_TEST_DEP.setdefault("ipydrawio-export", []).append(OK_PROVISION)
Split up packages (#1) * add drawio * more tweaking of editor load * more work on packaging * linting, remove trace of mxgraph submodule * clean up empty file rendering * add some missing images * don't reinitialize url after every show * some css sugar * belt and suspenders ui theme * some more params * add export * working on logo * more logo work * full in-place round-tripping of svg, png, html * use icons on documents * clean up some untitled files * first pass at schema * start settings integration * more work on settings * fix ref * work on url params * some more tweaks to load behavior * move submodule * clean up some packaging stuff * jlpm * resolve yarn * fix iframe url * bump to newest drawio release * brinf back the stencils * html doesn't really work * add more images * move more things from code into config defaults * rework settings some more * fix new view, still working on click-to-activate * fix capitalization on compressXml * give up on formatting xml * more work on round-trip, styling * linting * more missing images * more config reloading * drawio v13.1.8 * bump drawio files * update notebook * upgrade typescript * more submodule shenanigans, binder env * regenerate again, was missing stencils * try adding server proxy * update path * fix schema * pin node * hoist jupyter_notebook_config.json * some more work on export * more x * add some more demo tools * use apt, some status * apt deps, get back icons * some more apt work * more apt work * better programmatic example * more status work * more docs * add some more text * some more notes * some more status work, notes * add jinja example * more work on notebook * move notebook * add some deps * more deps for pandas, pdf * use local drawio assets * stop servers harder * Create Data-Driven Decks.ipynb * Update drawio_export_demo.py * Create template deck.dio * fix up some chores * some notebook tweaks * more work on demo * try another labextension spot * notebooks * store composite drawio in pdf * use file:// for drawio static * drawio v13.3.5 * remove even more unused code * bump drawio, remove more tornado junk * clean up xml pattern * add notebook, because why not * add ipynb example to decks * add png, svg to composite * add video chat for giggles * drawio v13.3.8 * add plugins * more work on plugin stuff * drawio v13.3.9 * drawio v13.4.7 * resolve yarn.lock * add sourcemaps * drawio v13.4.9 * start patching towards rtc * add plugin path to patches * add a mess of plugins * turn down the plugins * drawio v13.5.3 * re-solve static * get rid of all the high unicode in schema * use utf-8 encoding explicitly * Update package.json * Update _static.ts * drawio v13.5.4 * resolve static * drawio v13.5.8 * move notebooks * start moving things around * add dodo.py * more moving * more moving * more moving and naming * moving * move static * fix up static path * update more ids, locations * skeleton docs * start doing it * start linting in anger * passing eslint * add prebuild * yet more linting * back to ts building * packing * hoist tarball * clean up static generation * apply lint in anger * more work on static * remove videochat for now, more ignoring * tune up ci, binder * use smaller env for now * underspecify python in ci, don't url-encode [p]lugins * gah windows * some win debugging * do some roadmap work * work on roadmap while debugging * do per-platform shell commands * linting, url param * look harder for npm * start thinking about versions * version bumping, more windows work * remove patterns from schema * add all task * more encoding, linting * rebuild static with iife * try another import template * versions in changelog * more work on alernate asset loading * revert menu investigations * paths for windows
2020-08-08 13:45:27 +00:00
HASH_DEPS = [*PY_SDIST.values(), *PY_WHEEL.values(), *JS_TARBALL.values()]
2021-01-26 04:41:26 +00:00
SHA256SUMS = DIST / "SHA256SUMS"
Split up packages (#1) * add drawio * more tweaking of editor load * more work on packaging * linting, remove trace of mxgraph submodule * clean up empty file rendering * add some missing images * don't reinitialize url after every show * some css sugar * belt and suspenders ui theme * some more params * add export * working on logo * more logo work * full in-place round-tripping of svg, png, html * use icons on documents * clean up some untitled files * first pass at schema * start settings integration * more work on settings * fix ref * work on url params * some more tweaks to load behavior * move submodule * clean up some packaging stuff * jlpm * resolve yarn * fix iframe url * bump to newest drawio release * brinf back the stencils * html doesn't really work * add more images * move more things from code into config defaults * rework settings some more * fix new view, still working on click-to-activate * fix capitalization on compressXml * give up on formatting xml * more work on round-trip, styling * linting * more missing images * more config reloading * drawio v13.1.8 * bump drawio files * update notebook * upgrade typescript * more submodule shenanigans, binder env * regenerate again, was missing stencils * try adding server proxy * update path * fix schema * pin node * hoist jupyter_notebook_config.json * some more work on export * more x * add some more demo tools * use apt, some status * apt deps, get back icons * some more apt work * more apt work * better programmatic example * more status work * more docs * add some more text * some more notes * some more status work, notes * add jinja example * more work on notebook * move notebook * add some deps * more deps for pandas, pdf * use local drawio assets * stop servers harder * Create Data-Driven Decks.ipynb * Update drawio_export_demo.py * Create template deck.dio * fix up some chores * some notebook tweaks * more work on demo * try another labextension spot * notebooks * store composite drawio in pdf * use file:// for drawio static * drawio v13.3.5 * remove even more unused code * bump drawio, remove more tornado junk * clean up xml pattern * add notebook, because why not * add ipynb example to decks * add png, svg to composite * add video chat for giggles * drawio v13.3.8 * add plugins * more work on plugin stuff * drawio v13.3.9 * drawio v13.4.7 * resolve yarn.lock * add sourcemaps * drawio v13.4.9 * start patching towards rtc * add plugin path to patches * add a mess of plugins * turn down the plugins * drawio v13.5.3 * re-solve static * get rid of all the high unicode in schema * use utf-8 encoding explicitly * Update package.json * Update _static.ts * drawio v13.5.4 * resolve static * drawio v13.5.8 * move notebooks * start moving things around * add dodo.py * more moving * more moving * more moving and naming * moving * move static * fix up static path * update more ids, locations * skeleton docs * start doing it * start linting in anger * passing eslint * add prebuild * yet more linting * back to ts building * packing * hoist tarball * clean up static generation * apply lint in anger * more work on static * remove videochat for now, more ignoring * tune up ci, binder * use smaller env for now * underspecify python in ci, don't url-encode [p]lugins * gah windows * some win debugging * do some roadmap work * work on roadmap while debugging * do per-platform shell commands * linting, url param * look harder for npm * start thinking about versions * version bumping, more windows work * remove patterns from schema * add all task * more encoding, linting * rebuild static with iife * try another import template * versions in changelog * more work on alernate asset loading * revert menu investigations * paths for windows
2020-08-08 13:45:27 +00:00
# built artifacts
EXAMPLE_HTML = [DIST_NBHTML / p.name.replace(".ipynb", ".html") for p in EXAMPLE_IPYNB]
CMD_LIST_EXTENSIONS = ["jupyter", "labextension", "list"]
CMD_LAB = ["jupyter", "lab", "--no-browser", "--debug"]
2021-04-12 11:55:08 +00:00
# conda building
RECIPE = GH / "conda.recipe/meta.yaml"
2021-04-12 11:55:08 +00:00
CONDA_BLD = BUILD / "conda-bld"
2021-07-06 13:40:08 +00:00
CONDARC = GH / ".condarc"
2021-04-12 11:55:08 +00:00
# could be mambabuild
CONDA_BUILDERER = os.environ.get("CONDA_BUILDERER", "build")
CONDA_BUILD_ARGS = [
"conda",
CONDA_BUILDERER,
"--override-channels",
"-c",
"conda-forge",
"-c",
"nodefaults",
]
2021-04-12 11:55:08 +00:00
CONDA_PKGS = {
pkg: CONDA_BLD / f"noarch/{pkg}-{ver}-py_0.tar.bz2"
for pkg, ver in PY_VERSION.items()
}
# env inheritance
2021-11-12 23:30:56 +00:00
ENV_INHERITS = {
ENV_BINDER: [ENV_GH, ENV_DOCS],
ENV_DOCS: [ENV_GH],
ENV_GH_CB_WIN: [ENV_GH_CB],
}
2021-01-26 04:41:26 +00:00
def get_atest_stem(attempt=1, extra_args=None, browser=None):
2023-04-09 16:46:27 +00:00
"""Get the directory in ATEST_OUT for this platform/apps."""
2021-01-26 04:41:26 +00:00
browser = browser or "headlessfirefox"
extra_args = extra_args or []
stem = f"{PLATFORM}_{PY_MAJOR}_{browser}_{attempt}"
if "--dryrun" in extra_args:
stem += "_dry_run"
return stem
def ensure_session():
global _SESSION
if _SESSION is None:
try:
import requests_cache
_SESSION = requests_cache.CachedSession(cache_name=str(HTTP_CACHE))
except ImportError:
import requests
_SESSION = requests.Session()
def fetch_one(url, path):
import doit
2023-04-09 16:46:27 +00:00
yield {
"uptodate": [doit.tools.config_changed({"url": url})],
"name": path.name,
"actions": [
(doit.tools.create_folder, [HTTP_CACHE]),
(doit.tools.create_folder, [path.parent]),
(ensure_session, []),
lambda: [path.write_bytes(_SESSION.get(url).content), None][-1],
],
2023-04-09 16:46:27 +00:00
"targets": [path],
}
def patch_one_env(source, target):
2021-11-27 19:55:31 +00:00
source_text = source.read_text(**ENC)
name = re.findall(r"name: (.*)", source_text)[0]
comment = f" ### {name}-deps ###"
2021-11-27 19:55:31 +00:00
old_target = target.read_text(**ENC).split(comment)
new_source = source_text.split(comment)
target.write_text(
"\n".join(
[
old_target[0].strip(),
comment,
new_source[1],
comment.rstrip(),
old_target[2],
2023-04-09 16:46:27 +00:00
],
),
**ENC,
)
def typedoc_conf():
typedoc = json.loads(TYPEDOC_JSON.read_text(**ENC))
original_entry_points = sorted(typedoc["entryPoints"])
new_entry_points = sorted(
[
str(
(
2022-11-05 20:39:26 +00:00
p.parent
if (p.parent / "src/index.ts").exists()
else p.parent / "lib/index.d.ts"
)
2022-11-05 20:39:26 +00:00
.relative_to(PACKAGES)
2023-04-09 16:46:27 +00:00
.as_posix(),
)
for p in JS_PKG_JSON.values()
if p.parent.name not in NO_TYPEDOC
2023-04-09 16:46:27 +00:00
],
)
if json.dumps(original_entry_points) != json.dumps(new_entry_points):
typedoc["entryPoints"] = new_entry_points
2021-11-27 19:55:31 +00:00
TYPEDOC_JSON.write_text(json.dumps(typedoc, **JSON_FMT), **ENC)
tsconfig = json.loads(TSCONFIG_TYPEDOC.read_text(**ENC))
original_references = tsconfig["references"]
new_references = sum(
[
[
{"path": f"./{p.parent.name}/src"},
{"path": f"./{p.parent.name}"},
]
for p in JS_PKG_JSON.values()
if p.parent.name not in NO_TYPEDOC
],
[],
)
if json.dumps(original_references) != json.dumps(new_references):
tsconfig["references"] = new_references
2021-11-27 19:55:31 +00:00
TSCONFIG_TYPEDOC.write_text(json.dumps(tsconfig, **JSON_FMT), **ENC)
def mystify():
2023-04-09 16:46:27 +00:00
"""Unwrap monorepo docs into per-module docs."""
if DOCS_TS.exists():
shutil.rmtree(DOCS_TS)
for doc in sorted(DOCS_RAW_TYPEDOC.rglob("*.md")):
if doc.parent == DOCS_RAW_TYPEDOC:
continue
if doc.name == "README.md":
continue
doc_text = doc.read_text(**ENC)
doc_lines = doc_text.splitlines()
# rewrite doc and write back out
out_doc = DOCS_TS / doc.relative_to(DOCS_RAW_TYPEDOC)
if not out_doc.parent.exists():
out_doc.parent.mkdir(parents=True)
out_text = "\n".join([*doc_lines[1:], ""]).replace("README.md", "index.md")
out_text = re.sub(
r"## Table of contents(.*?)\n## ",
"\n## ",
out_text,
flags=re.M | re.S,
)
out_text = out_text.replace("/src]", "]")
out_text = re.sub("/src$", "", out_text, flags=re.M)
out_text = re.sub(
r"^((Implementation of|Overrides|Inherited from):)",
"_\\1_",
out_text,
flags=re.M | re.S,
)
out_text = re.sub(
r"^Defined in: ([^\n]+)$",
"_Defined in:_ `\\1`",
out_text,
flags=re.M | re.S,
)
out_text += MD_FOOTER
out_doc.write_text(out_text, **ENC)
DOCS_TS_MYST_INDEX.write_text(
"\n".join(
[
"# `@deathbeds/ipydrawio`\n",
"```{toctree}",
":maxdepth: 1",
2022-11-05 20:39:26 +00:00
":caption: Modules",
":glob:",
"modules/*",
"```",
"```{toctree}",
":maxdepth: 1",
":caption: Interfaces",
":glob:",
"interfaces/*",
"```",
"```{toctree}",
":caption: Classes",
":maxdepth: 1",
":glob:",
"classes/*",
"```",
MD_FOOTER,
2023-04-09 16:46:27 +00:00
],
),
**ENC,
)
def pip_check():
proc = subprocess.Popen([*PIP, "check"], stdout=subprocess.PIPE)
proc.wait()
out = proc.stdout.read().decode("utf-8")
print(out)
lines = [
line
for line in out.splitlines()
if line.strip() and not re.findall(PIP_CHECK_IGNORE, line)
]
return not len(lines)
2021-07-06 13:40:08 +00:00
# utilities
def _echo_ok(msg):
def _echo():
print(msg, flush=True)
return True
return _echo
def _ok(task, ok):
task.setdefault("targets", []).append(ok)
task["actions"] = [
lambda: [ok.exists() and ok.unlink(), True][-1],
*task["actions"],
2023-04-10 14:09:29 +00:00
lambda: [
ok.parent.mkdir(exist_ok=True, parents=True),
ok.write_text("ok", **ENC),
True,
][-1],
2021-07-06 13:40:08 +00:00
]
return task
def _show(*args, **kwargs):
import rich.markdown
for arg in args:
print_(arg()) if callable(arg) else print_(arg)
for kw, kwarg in kwargs.items():
print_(rich.markdown.Markdown(f"# {kw}") if console else kw)
print_(kwarg()) if callable(kwarg) else print_(kwarg)
def _copy_one(src, dest):
if not src.exists():
return False
if not dest.parent.exists():
2022-11-07 17:20:52 +00:00
dest.parent.mkdir(parents=True, exist_ok=True)
2021-07-06 13:40:08 +00:00
if dest.exists():
if dest.is_dir():
shutil.rmtree(dest)
else:
dest.unlink()
if src.is_dir():
shutil.copytree(src, dest)
2023-04-09 16:46:27 +00:00
return None
2021-07-06 13:40:08 +00:00
else:
shutil.copy2(src, dest)
2023-04-09 16:46:27 +00:00
return None
2021-07-06 13:40:08 +00:00
def _lite(lite_actions, extra_args=[]):
2021-07-06 13:40:08 +00:00
lite = ["jupyter", "lite"]
args = ["--source-date-epoch", SOURCE_DATE_EPOCH]
2021-11-27 19:55:31 +00:00
try:
from jupyter_server_mathjax.app import STATIC_ASSETS_PATH as MATHJAX_DIR
except Exception:
MATHJAX_DIR = None
if MATHJAX_DIR:
args += ["--mathjax-dir", str(MATHJAX_DIR)]
for act in lite_actions:
act_args = list(map(str, [*lite, act, *args, *extra_args]))
2021-11-27 19:55:31 +00:00
if subprocess.call(act_args, cwd=DEMO) != 0:
print("FAILED", *act_args)
return False
2023-04-09 16:46:27 +00:00
return None
2021-07-06 13:40:08 +00:00
def _sync_lite_config(from_env, to_json, marker, extra_federated, extra_pyolite):
2023-04-09 16:46:27 +00:00
"""Use conda list to derive tarball names."""
2021-07-30 21:52:47 +00:00
raw_lock = subprocess.check_output(["conda", "list", "--explicit"])
ext_packages = [
p.strip().split(" ")[0]
2021-11-27 19:55:31 +00:00
for p in from_env.read_text(**ENC).split(marker)[1].split(" - ")
2021-07-30 21:52:47 +00:00
if p.strip()
]
federated_extensions = sorted(
2023-04-09 16:46:27 +00:00
["../" + str(extra.relative_to(ROOT).as_posix()) for extra in extra_federated],
)
piplite_urls = [
"../" + str(extra.relative_to(ROOT).as_posix()) for extra in extra_pyolite
]
2021-07-30 21:52:47 +00:00
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):
2022-06-09 23:55:24 +00:00
federated_extensions += ["/".join([CONDA_FORGE_RELEASE, subdir, pkg])]
2021-07-30 21:52:47 +00:00
2021-11-27 19:55:31 +00:00
config = json.loads(to_json.read_text(**ENC))
config["LiteBuildConfig"].update(
federated_extensions=federated_extensions,
2023-04-09 16:46:27 +00:00
)
config.setdefault("PipliteAddon", {}).update(
piplite_urls=piplite_urls,
)
to_json.write_text(json.dumps(config, **JSON_FMT), **ENC)
2021-11-15 13:37:44 +00:00
subprocess.call([*PRETTIER, "--write", to_json])
2021-07-30 21:52:47 +00:00
2021-11-27 19:55:31 +00:00
def fetch_pyodide_packages():
import urllib.request
2022-08-31 13:06:41 +00:00
url = f"{PYODIDE_URL}/repodata.json"
2021-11-27 19:55:31 +00:00
print("fetching pyodide packages from", url)
with urllib.request.urlopen(url) as response:
packages = json.loads(response.read().decode("utf-8"))
PYODIDE_PACKAGES.parent.mkdir(exist_ok=True, parents=True)
PYODIDE_PACKAGES.write_text(json.dumps(packages, **JSON_FMT), **ENC)
2021-11-27 19:55:31 +00:00
def fetch_wheels():
BUILD_WHEELS.mkdir(exist_ok=True, parents=True)
2021-11-27 19:55:31 +00:00
DEMO_WHEELS.mkdir(exist_ok=True, parents=True)
pyodide_pkgs = json.loads(PYODIDE_PACKAGES.read_text(encoding="utf-8"))
pyodide_norm_names = [k.lower().replace("-", "_") for k in pyodide_pkgs["packages"]]
2021-11-27 19:55:31 +00:00
subprocess.check_call(
["pip", "download", "-r", str(DEMO_REQS), "--prefer-binary"],
cwd=str(BUILD_WHEELS),
2021-11-27 19:55:31 +00:00
)
for pkg in sorted(BUILD_WHEELS.glob("*")):
norm_name = pkg.name.split("-")[0].lower()
2021-11-27 19:55:31 +00:00
if not pkg.name.endswith(NOARCH_WHL):
continue
if norm_name in pyodide_norm_names or norm_name in IGNORED_WHEELS:
continue
dest = DEMO_WHEELS / pkg.name
if dest.exists():
2023-04-09 16:46:27 +00:00
if pkg.stat().st_mtime > dest.stat().st_mtime:
dest.unlink()
else:
continue
shutil.copy2(pkg, dest)
2021-11-27 19:55:31 +00:00
def template_one(src, dest):
import jinja2
template = jinja2.Template(src.read_text(**ENC))
if not dest.parent.exists():
dest.parent.mkdir()
if dest.exists():
dest.unlink()
dest.write_text(template.render(P=globals()))
2022-08-31 13:06:41 +00:00
def build_one_flit(py_pkg):
2023-04-09 16:46:27 +00:00
"""Attempt to build one package with flit: on RTD, allow doing a build in /tmp."""
2022-08-31 13:06:41 +00:00
import tempfile
print(f"[{py_pkg.name}] trying in-tree build...", flush=True)
args = ["flit", "--debug", "build", "--setup-py"]
try:
subprocess.check_call(args, cwd=str(py_pkg))
except subprocess.CalledProcessError:
if not RTD:
print(f"[{py_pkg.name}] ... in-tree build failed, not on ReadTheDocs")
return False
print(
f"[{py_pkg.name}] ... in-tree build failed, trying build in tempdir...",
flush=True,
)
py_dist = py_pkg / "dist"
if py_dist.exists():
shutil.rmtree(py_dist)
with tempfile.TemporaryDirectory() as td:
tdp = Path(td)
py_tmp = tdp / py_pkg.name
shutil.copytree(py_pkg, py_tmp)
subprocess.call(args, cwd=str(py_tmp))
shutil.copytree(py_tmp / "dist", py_dist)
2023-04-09 16:46:27 +00:00
def _maybe_expand_globs(paths, parent):
for path in paths:
if "*" in path:
for globbed in sorted(parent.glob(path)):
if globbed.is_dir():
continue
yield globbed.resolve()
else:
yield (parent / path).resolve()
def _merge_one_task(task, partial_task, parent=None):
for field, info in partial_task.items():
if parent and field in ["file_dep", "targets"]:
info = sorted(_maybe_expand_globs(info, parent))
if field not in task:
task[field] = info
else:
task[field] += info
return task
def _make_one_js_task(script, data, pkg_json, **task_info):
from doit.tools import CmdAction
name = f"""js:{script}:{pkg_json.parent.name}"""
task = {
"name": name,
"actions": [CmdAction([*JLPM, script], cwd=pkg_json.parent, shell=False)],
"file_dep": [YARN_INTEGRITY, pkg_json],
}
_merge_one_task(task, data.get("scripts_doit", {}).get(script, {}), pkg_json.parent)
_merge_one_task(task, task_info)
yield task
def package_json_tasks(task_prefix: str, script: str, target: Path, **task_info):
"""Emulate lerna behavior."""
task_dep = []
for pkg, pkg_json in JS_PKG_JSON.items():
data = JS_PKG_DATA[pkg]
if script not in data.get("scripts", {}):
continue
for task in _make_one_js_task(script, data, pkg_json, **task_info):
task_dep += [f"""{task_prefix}:{task["name"]}"""]
yield task
if task_dep:
task = _ok(
{"name": f"js:{script}", "task_dep": task_dep, "actions": [lambda: True]},
target,
)
_merge_one_task(task, task_info)
yield task
# Late environment hacks
2021-04-12 11:55:08 +00:00
os.environ.update(
CONDARC=str(CONDARC),
PIP_DISABLE_PIP_VERSION_CHECK="1",
2023-04-09 16:46:27 +00:00
JUPYTER_PLATFORM_DIRS="1",
PYDEVD_DISABLE_FILE_VALIDATION="1",
IPYDRAWIO_DATA_DIR=str(IPYDRAWIO_DATA_DIR),
2023-04-10 14:09:29 +00:00
BLACK_CACHE_DIR=str(BLACK_CACHE_DIR),
2021-04-12 11:55:08 +00:00
)