kopia lustrzana https://github.com/deathbeds/ipydrawio
rodzic
8031573d62
commit
cbb744031f
|
@ -34,6 +34,7 @@ dependencies:
|
||||||
- networkx
|
- networkx
|
||||||
- pygraphviz
|
- pygraphviz
|
||||||
- python-graphviz
|
- python-graphviz
|
||||||
|
- qrcode-artistic
|
||||||
- segno
|
- segno
|
||||||
- shapely
|
- shapely
|
||||||
- tabulate
|
- tabulate
|
||||||
|
@ -41,8 +42,6 @@ dependencies:
|
||||||
- wxyz_json_schema_form
|
- wxyz_json_schema_form
|
||||||
- wxyz_lab
|
- wxyz_lab
|
||||||
- wxyz_svg
|
- wxyz_svg
|
||||||
# TODO: get on conda-forge
|
|
||||||
# - qrcode-artistic
|
|
||||||
|
|
||||||
### ipydrawio-dev-deps ###
|
### ipydrawio-dev-deps ###
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,26 @@
|
||||||
|
# a sufficient environment for acceptance testing
|
||||||
|
|
||||||
|
# Copyright 2021 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.
|
||||||
|
|
||||||
|
name: ipydrawio-conda-build
|
||||||
|
|
||||||
|
channels:
|
||||||
|
- conda-forge
|
||||||
|
- nodefaults
|
||||||
|
|
||||||
|
dependencies:
|
||||||
|
- boa
|
||||||
|
- conda-build
|
||||||
|
- doit
|
|
@ -72,6 +72,7 @@ jobs:
|
||||||
${{ env.CACHE_EPOCH }}-${{ runner.os }}-pip-${{ hashFiles('.github/pip-build.txt') }}
|
${{ env.CACHE_EPOCH }}-${{ runner.os }}-pip-${{ hashFiles('.github/pip-build.txt') }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ env.CACHE_EPOCH }}-${{ runner.os }}-pip-
|
${{ env.CACHE_EPOCH }}-${{ runner.os }}-pip-
|
||||||
|
|
||||||
- name: cache (node)
|
- name: cache (node)
|
||||||
uses: actions/cache@v2
|
uses: actions/cache@v2
|
||||||
id: cache-node-modules
|
id: cache-node-modules
|
||||||
|
@ -127,6 +128,57 @@ jobs:
|
||||||
name: ipydrawio ${{ github.run_number }} dist
|
name: ipydrawio ${{ github.run_number }} dist
|
||||||
path: ./dist
|
path: ./dist
|
||||||
|
|
||||||
|
conda-build:
|
||||||
|
needs: [build]
|
||||||
|
runs-on: ${{ matrix.os }}-latest
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
os: ['ubuntu', 'macos', 'windows']
|
||||||
|
steps:
|
||||||
|
- name: configure line endings
|
||||||
|
run: |
|
||||||
|
git config --global core.autocrlf false
|
||||||
|
|
||||||
|
- name: checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: cache (conda)
|
||||||
|
uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: ~/conda_pkgs_dir
|
||||||
|
key: |
|
||||||
|
${{ env.CACHE_EPOCH }}-${{ runner.os }}-conda-build-${{ hashFiles('.github/environment-conda-build.yml') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ env.CACHE_EPOCH }}-${{ runner.os }}-conda-build-
|
||||||
|
|
||||||
|
- name: install (conda)
|
||||||
|
uses: conda-incubator/setup-miniconda@v2
|
||||||
|
with:
|
||||||
|
condarc-file: .github/.condarc
|
||||||
|
environment-file: .github/environment-conda-build.yml
|
||||||
|
miniforge-variant: Mambaforge
|
||||||
|
use-mamba: true
|
||||||
|
|
||||||
|
- name: download (dist)
|
||||||
|
uses: actions/download-artifact@v2
|
||||||
|
with:
|
||||||
|
name: ipydrawio ${{ github.run_number }} dist
|
||||||
|
path: ./dist
|
||||||
|
|
||||||
|
- name: build (conda)
|
||||||
|
shell: bash -l {0}
|
||||||
|
env:
|
||||||
|
CONDA_BUILDERER: mambabuild
|
||||||
|
run: |
|
||||||
|
doit -s conda
|
||||||
|
|
||||||
|
- name: upload (conda)
|
||||||
|
uses: actions/upload-artifact@v2
|
||||||
|
with:
|
||||||
|
name: ipydrawio ${{ github.run_number }} conda
|
||||||
|
path: ./build/conda-bld
|
||||||
|
|
||||||
test:
|
test:
|
||||||
needs: [build]
|
needs: [build]
|
||||||
name: ${{ matrix.os }} ${{ matrix.python-version }}
|
name: ${{ matrix.os }} ${{ matrix.python-version }}
|
||||||
|
@ -165,13 +217,13 @@ jobs:
|
||||||
with:
|
with:
|
||||||
condarc-file: .github/.condarc
|
condarc-file: .github/.condarc
|
||||||
miniforge-variant: Mambaforge
|
miniforge-variant: Mambaforge
|
||||||
miniforge-version: latest
|
|
||||||
python-version: ${{ matrix.python-version }}
|
python-version: ${{ matrix.python-version }}
|
||||||
environment-file: .github/environment.yml
|
environment-file: .github/environment.yml
|
||||||
use-only-tar-bz2: true
|
use-only-tar-bz2: true
|
||||||
use-mamba: true
|
use-mamba: true
|
||||||
|
|
||||||
- uses: actions/download-artifact@v2
|
- name: download (dist)
|
||||||
|
uses: actions/download-artifact@v2
|
||||||
with:
|
with:
|
||||||
name: ipydrawio ${{ github.run_number }} dist
|
name: ipydrawio ${{ github.run_number }} dist
|
||||||
path: ./dist
|
path: ./dist
|
||||||
|
|
|
@ -12,7 +12,6 @@ __pycache__
|
||||||
*.tgz
|
*.tgz
|
||||||
*.tsbuildinfo
|
*.tsbuildinfo
|
||||||
**/*DRAWIO_DEBUG*
|
**/*DRAWIO_DEBUG*
|
||||||
**/labextensions/**
|
|
||||||
atest/output/
|
atest/output/
|
||||||
build/
|
build/
|
||||||
dist/
|
dist/
|
||||||
|
@ -21,5 +20,7 @@ htmlcov/
|
||||||
node_modules/
|
node_modules/
|
||||||
py_packages/ipydrawio-export/ipydrawio-export-*
|
py_packages/ipydrawio-export/ipydrawio-export-*
|
||||||
py_packages/ipydrawio/ipydrawio-*
|
py_packages/ipydrawio/ipydrawio-*
|
||||||
|
py_packages/**/src/*/ext/
|
||||||
|
packages/ipydrawio-webpack/dio/
|
||||||
untitled*
|
untitled*
|
||||||
Untitled*
|
Untitled*
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
[submodule "src/drawio"]
|
[submodule "packages/ipydrawio-webpack/drawio"]
|
||||||
path = packages/ipydrawio-webpack/drawio
|
path = packages/ipydrawio-webpack/drawio
|
||||||
url = https://github.com/jgraph/drawio.git
|
url = https://github.com/jgraph/drawio.git
|
||||||
[submodule "py_packages/jupyter-drawio-export/src/jupyter_drawio_export/vendor/draw-image-export2"]
|
[submodule "py_packages/jupyter-drawio-export/src/jupyter_drawio_export/vendor/draw-image-export2"]
|
||||||
|
|
27
CHANGELOG.md
27
CHANGELOG.md
|
@ -2,6 +2,33 @@
|
||||||
|
|
||||||
## Unreleased
|
## Unreleased
|
||||||
|
|
||||||
|
### ipydrawio 1.0.1
|
||||||
|
|
||||||
|
- [#32] on-disk file paths are shorter to avoid Windows issues
|
||||||
|
- [#31] `install.json` is properly placed
|
||||||
|
|
||||||
|
### ipydrawio-export 1.0.1
|
||||||
|
|
||||||
|
- [#32] on-disk file paths are shorter to avoid Windows issues
|
||||||
|
- [#31] `install.json` is properly placed
|
||||||
|
|
||||||
|
### @deathbeds/ipydrawio 1.0.1
|
||||||
|
|
||||||
|
### @deathbeds/ipydrawio-notebook 1.0.1
|
||||||
|
|
||||||
|
### @deathbeds/ipydrawio-pdf 1.0.1
|
||||||
|
|
||||||
|
### @deathbeds/ipydrawio-webpack 14.5.901
|
||||||
|
|
||||||
|
- [#32] drawio assets are copied into a shorter path
|
||||||
|
- changing version scheme to allow for patch releases.
|
||||||
|
- going forward, the upstream patch release will be multiplied by 100
|
||||||
|
|
||||||
|
[#31]: https://github.com/deathbeds/ipydrawio/issues/31
|
||||||
|
[#32]: https://github.com/deathbeds/ipydrawio/issues/32
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
### ipydrawio 1.0.0
|
### ipydrawio 1.0.0
|
||||||
|
|
||||||
- ipywidgets support
|
- ipywidgets support
|
||||||
|
|
|
@ -66,19 +66,24 @@ doit dist
|
||||||
- [ ] validate on binder
|
- [ ] validate on binder
|
||||||
- [ ] wait for a successful build of `master`
|
- [ ] wait for a successful build of `master`
|
||||||
- [ ] download the `dist` archive and unpack somewhere (maybe a fresh `dist`)
|
- [ ] download the `dist` archive and unpack somewhere (maybe a fresh `dist`)
|
||||||
- [ ] actually upload
|
- [ ] create a new release through the GitHub UI
|
||||||
|
- [ ] paste in the relevant CHANGELOG entries
|
||||||
|
- [ ] upload the artifacts
|
||||||
|
- [ ] actually upload to npm.com, pypi.org
|
||||||
```bash
|
```bash
|
||||||
export VERSION=<the next version>
|
|
||||||
cd dist
|
cd dist
|
||||||
twine upload ipydrawio*
|
twine upload ipydrawio*
|
||||||
npm login
|
npm login
|
||||||
npm publish deathbeds-ipydrawio-$VERSION.tgz
|
npm publish deathbeds-ipydrawio-$VERSION.tgz
|
||||||
npm publish deathbeds-ipydrawio-notebook-$VERSION.tgz
|
npm publish deathbeds-ipydrawio-notebook-$VERSION.tgz
|
||||||
npm publish deathbeds-ipydrawio-pdf-$VERSION.tgz
|
npm publish deathbeds-ipydrawio-pdf-$VERSION.tgz
|
||||||
npm publish deathbeds-ipydrawio-webpack-$VERSION.tgz
|
npm publish deathbeds-ipydrawio-webpack-$OTHER_VERSION.tgz
|
||||||
npm logout
|
npm logout
|
||||||
```
|
```
|
||||||
- [ ] handle `conda-forge` feedstock tasks
|
- [ ] postmortem
|
||||||
|
- [ ] handle `conda-forge` feedstock tasks
|
||||||
|
- [ ] validate on binder via simplest-possible gists
|
||||||
|
- [ ] bump to next development version
|
||||||
|
|
||||||
```
|
```
|
||||||
Copyright 2021 ipydrawio contributors
|
Copyright 2021 ipydrawio contributors
|
||||||
|
|
|
@ -0,0 +1,128 @@
|
||||||
|
{% set name = "ipydrawio" %}
|
||||||
|
{% set version = "1.0.1" %}
|
||||||
|
|
||||||
|
{% set build_number = 0 %}
|
||||||
|
|
||||||
|
{% set url_base = RECIPE_DIR.replace("\\", "/") + "/../dist" %}
|
||||||
|
{% if not url_base.startswith("/") %}
|
||||||
|
{% set url_base = "/" + url_base %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
package:
|
||||||
|
name: {{ name }}-build
|
||||||
|
version: {{ version }}
|
||||||
|
|
||||||
|
source:
|
||||||
|
- folder: {{ name }}
|
||||||
|
url: file://{{ url_base }}/{{ name }}-{{ version }}.tar.gz
|
||||||
|
# url: https://pypi.io/packages/source/{{ name[0] }}/{{ name }}/{{ name }}-{{ version }}.tar.gz
|
||||||
|
# sha256:
|
||||||
|
|
||||||
|
- folder: {{ name }}-export
|
||||||
|
url: file://{{ url_base }}/{{ name }}-export-{{ version }}.tar.gz
|
||||||
|
# url: https://pypi.io/packages/source/{{ name[0] }}/{{ name }}-export/{{ name }}-export-{{ version }}.tar.gz
|
||||||
|
# sha256:
|
||||||
|
|
||||||
|
build:
|
||||||
|
number: {{ build_number }}
|
||||||
|
noarch: python
|
||||||
|
|
||||||
|
requirements:
|
||||||
|
host:
|
||||||
|
- pip
|
||||||
|
- python >=3.6
|
||||||
|
run:
|
||||||
|
- python >=3.6
|
||||||
|
|
||||||
|
test:
|
||||||
|
commands:
|
||||||
|
- echo "tests in outputs"
|
||||||
|
|
||||||
|
outputs:
|
||||||
|
- name: {{ name }}
|
||||||
|
version: {{ version }}
|
||||||
|
build:
|
||||||
|
number: {{ build_number }}
|
||||||
|
noarch: python
|
||||||
|
script:
|
||||||
|
- cd {{ name }} && {{ PYTHON }} -m pip install . -vv --no-deps
|
||||||
|
requirements:
|
||||||
|
host:
|
||||||
|
- pip
|
||||||
|
- python >=3.6
|
||||||
|
run:
|
||||||
|
- ipywidgets >=7.6
|
||||||
|
- jupyterlab ==3.*
|
||||||
|
- jupyterlab_widgets >=1
|
||||||
|
- lxml
|
||||||
|
- python >=3.6
|
||||||
|
test:
|
||||||
|
imports:
|
||||||
|
- {{ name }}
|
||||||
|
requires:
|
||||||
|
- pip
|
||||||
|
- pytest-cov
|
||||||
|
commands:
|
||||||
|
- pip check
|
||||||
|
- jupyter labextension list
|
||||||
|
- jupyter labextension list 1>labextensions 2>&1
|
||||||
|
- cat labextensions | grep "@deathbeds/{{ name }}.*OK" # [unix]
|
||||||
|
- pytest -vv --pyargs {{ name }} --cov={{ name }} --cov-fail-under=100 --cov-report=term-missing:skip-covered
|
||||||
|
about:
|
||||||
|
home: https://github.com/deathbeds/{{ name }}
|
||||||
|
summary: Draw.io Diagrams as Jupyter Widgets
|
||||||
|
license: Apache-2.0
|
||||||
|
license_file: {{ name }}/LICENSE.txt
|
||||||
|
|
||||||
|
- name: {{ name }}-export
|
||||||
|
version: {{ version }}
|
||||||
|
build:
|
||||||
|
number: {{ build_number }}
|
||||||
|
noarch: python
|
||||||
|
script:
|
||||||
|
- cd {{ name }}-export && {{ PYTHON }} -m pip install . -vv --no-deps
|
||||||
|
entry_points:
|
||||||
|
- jupyter-{{ name }}-export = {{ name }}_export.app:main
|
||||||
|
requirements:
|
||||||
|
host:
|
||||||
|
- pip
|
||||||
|
- python >=3.6
|
||||||
|
run:
|
||||||
|
- {{ name }} =={{ version }}.*
|
||||||
|
- python >=3.6
|
||||||
|
- pillow
|
||||||
|
- pypdf2
|
||||||
|
- requests_cache
|
||||||
|
- nodejs
|
||||||
|
test:
|
||||||
|
imports:
|
||||||
|
- {{ name }}_export
|
||||||
|
requires:
|
||||||
|
- pip
|
||||||
|
- pytest-cov
|
||||||
|
- pytest-tornasync
|
||||||
|
- pytest-console-scripts
|
||||||
|
commands:
|
||||||
|
- pip check
|
||||||
|
- jupyter labextension list
|
||||||
|
- jupyter labextension list 1>labextensions 2>&1
|
||||||
|
- cat labextensions | grep "@deathbeds/{{ name }}-pdf.*OK" # [unix]
|
||||||
|
- jupyter serverextension list
|
||||||
|
- jupyter serverextension list 1>serverextensions 2>&1
|
||||||
|
- cat serverextensions | grep "{{ name }}_export.*OK" # [unix]
|
||||||
|
- pytest -vv --pyargs {{ name }}_export --script-launch-mode=subprocess --cov={{ name }}_export --cov-fail-under=96 --cov-report=term-missing:skip-covered
|
||||||
|
about:
|
||||||
|
home: https://github.com/deathbeds/{{ name }}
|
||||||
|
summary: PDF export for IPyDrawio
|
||||||
|
license: Apache-2.0
|
||||||
|
license_file: {{ name }}-export/LICENSE.txt
|
||||||
|
|
||||||
|
about:
|
||||||
|
home: https://github.com/deathbeds/{{ name }}
|
||||||
|
summary: Draw.io Diagrams as Jupyter Widgets
|
||||||
|
license: Apache-2.0
|
||||||
|
license_file: {{ name }}/LICENSE.txt
|
||||||
|
|
||||||
|
extra:
|
||||||
|
recipe-maintainers:
|
||||||
|
- bollwyvl
|
63
dodo.py
63
dodo.py
|
@ -122,11 +122,10 @@ def task_setup():
|
||||||
for pkg, pkg_setup in P.PY_SETUP.items():
|
for pkg, pkg_setup in P.PY_SETUP.items():
|
||||||
# TODO: refactor
|
# TODO: refactor
|
||||||
ext_deps = [
|
ext_deps = [
|
||||||
pkg_setup.parent
|
(
|
||||||
/ "src"
|
P.JS_PKG_JSON[ext].parent
|
||||||
/ pkg.replace("-", "_")
|
/ P.JS_PKG_DATA[ext]["jupyterlab"]["outputDir"]
|
||||||
/ "labextensions"
|
).resolve()
|
||||||
/ P.JS_PKG_DATA[ext]["name"]
|
|
||||||
/ "package.json"
|
/ "package.json"
|
||||||
for ext, mod in P.JS_LABEXT_PY_HOST.items()
|
for ext, mod in P.JS_LABEXT_PY_HOST.items()
|
||||||
if mod == pkg_setup.parent.name
|
if mod == pkg_setup.parent.name
|
||||||
|
@ -377,9 +376,9 @@ if not P.TESTING_IN_CI:
|
||||||
if "jupyterlab" not in pkg_data:
|
if "jupyterlab" not in pkg_data:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
host = P.JS_LABEXT_PY_HOST[pkg]
|
out_dir = (
|
||||||
host_mod = host.replace("-", "_")
|
P.JS_PKG_JSON[pkg].parent / pkg_data["jupyterlab"]["outputDir"]
|
||||||
host_ext = P.PY_PACKAGES / host / "src" / host_mod / "labextensions"
|
).resolve()
|
||||||
|
|
||||||
yield _ok(
|
yield _ok(
|
||||||
dict(
|
dict(
|
||||||
|
@ -392,19 +391,17 @@ if not P.TESTING_IN_CI:
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
file_dep=targets,
|
file_dep=targets,
|
||||||
targets=[host_ext / f"""{pkg_data["name"]}/package.json"""],
|
targets=[out_dir / "package.json"],
|
||||||
),
|
),
|
||||||
P.OK_EXT_BUILD[pkg],
|
P.OK_EXT_BUILD[pkg],
|
||||||
)
|
)
|
||||||
|
|
||||||
for py_pkg, py_setup in P.PY_SETUP.items():
|
for py_pkg, py_setup in P.PY_SETUP.items():
|
||||||
py_mod = py_setup.parent.name.replace("-", "_")
|
|
||||||
ext_deps = [
|
ext_deps = [
|
||||||
py_setup.parent
|
(
|
||||||
/ "src"
|
P.JS_PKG_JSON[ext].parent
|
||||||
/ py_mod
|
/ P.JS_PKG_DATA[ext]["jupyterlab"]["outputDir"]
|
||||||
/ "labextensions"
|
).resolve()
|
||||||
/ P.JS_PKG_DATA[ext]["name"]
|
|
||||||
/ "package.json"
|
/ "package.json"
|
||||||
for ext, mod in P.JS_LABEXT_PY_HOST.items()
|
for ext, mod in P.JS_LABEXT_PY_HOST.items()
|
||||||
if mod == py_setup.parent.name
|
if mod == py_setup.parent.name
|
||||||
|
@ -475,6 +472,42 @@ if not P.TESTING_IN_CI:
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def task_conda():
|
||||||
|
args = [
|
||||||
|
"conda",
|
||||||
|
P.CONDA_BUILDERER,
|
||||||
|
"-c",
|
||||||
|
"conda-forge",
|
||||||
|
]
|
||||||
|
|
||||||
|
yield dict(
|
||||||
|
name="build",
|
||||||
|
file_dep=[
|
||||||
|
P.RECIPE,
|
||||||
|
*[P.DIST / p.name for p in P.PY_SDIST.values()],
|
||||||
|
],
|
||||||
|
actions=[
|
||||||
|
[
|
||||||
|
*args,
|
||||||
|
"--no-test",
|
||||||
|
"--output-folder",
|
||||||
|
P.CONDA_BLD,
|
||||||
|
P.RECIPE.parent,
|
||||||
|
]
|
||||||
|
],
|
||||||
|
targets=[*P.CONDA_PKGS.values()],
|
||||||
|
)
|
||||||
|
|
||||||
|
yield _ok(
|
||||||
|
dict(
|
||||||
|
name="test",
|
||||||
|
file_dep=[*P.CONDA_PKGS.values()],
|
||||||
|
actions=[[*args, "--test", *P.CONDA_PKGS.values()]],
|
||||||
|
),
|
||||||
|
P.OK_CONDA_TEST,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
if not P.TESTING_IN_CI:
|
if not P.TESTING_IN_CI:
|
||||||
|
|
||||||
def task_lab():
|
def task_lab():
|
||||||
|
|
|
@ -3,6 +3,7 @@ _meta/lib/**
|
||||||
ipydrawio-notebook/lib/**
|
ipydrawio-notebook/lib/**
|
||||||
ipydrawio-pdf/lib/**
|
ipydrawio-pdf/lib/**
|
||||||
ipydrawio-webpack/drawio/**
|
ipydrawio-webpack/drawio/**
|
||||||
|
ipydrawio-webpack/dio/**
|
||||||
ipydrawio/lib/**
|
ipydrawio/lib/**
|
||||||
**/node_modules/**
|
**/node_modules/**
|
||||||
**/drawio/**
|
**/drawio/**
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@deathbeds/ipydrawio-notebook",
|
"name": "@deathbeds/ipydrawio-notebook",
|
||||||
"version": "1.0.0",
|
"version": "1.0.1",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@jupyterlab/application": "3",
|
"@jupyterlab/application": "3",
|
||||||
"@jupyterlab/notebook": "3"
|
"@jupyterlab/notebook": "3"
|
||||||
|
@ -10,7 +10,7 @@
|
||||||
"typescript": "~4.2.4"
|
"typescript": "~4.2.4"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"@deathbeds/ipydrawio": "^1.0.0"
|
"@deathbeds/ipydrawio": "^1.0.1"
|
||||||
},
|
},
|
||||||
"files": [
|
"files": [
|
||||||
"{lib,schema,style,src}/**/*.{ts,tsx,eot,gif,html,jpg,js,js.map,json,png,svg,woff2,css}",
|
"{lib,schema,style,src}/**/*.{ts,tsx,eot,gif,html,jpg,js,js.map,json,png,svg,woff2,css}",
|
||||||
|
@ -18,7 +18,7 @@
|
||||||
],
|
],
|
||||||
"jupyterlab": {
|
"jupyterlab": {
|
||||||
"extension": "lib/plugin.js",
|
"extension": "lib/plugin.js",
|
||||||
"outputDir": "../../py_packages/ipydrawio/src/ipydrawio/labextensions/@deathbeds/ipydrawio-notebook",
|
"outputDir": "../../py_packages/ipydrawio/src/ipydrawio/ext/ipdnb",
|
||||||
"sharedPackages": {
|
"sharedPackages": {
|
||||||
"@deathbeds/ipydrawio": {
|
"@deathbeds/ipydrawio": {
|
||||||
"bundled": false,
|
"bundled": false,
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@deathbeds/ipydrawio-pdf",
|
"name": "@deathbeds/ipydrawio-pdf",
|
||||||
"version": "1.0.0",
|
"version": "1.0.1",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@jupyterlab/application": "3"
|
"@jupyterlab/application": "3"
|
||||||
},
|
},
|
||||||
|
@ -9,7 +9,7 @@
|
||||||
"typescript": "~4.2.4"
|
"typescript": "~4.2.4"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"@deathbeds/ipydrawio": "^1.0.0"
|
"@deathbeds/ipydrawio": "^1.0.1"
|
||||||
},
|
},
|
||||||
"files": [
|
"files": [
|
||||||
"{lib,schema,style,src}/**/*.{ts,tsx,eot,gif,html,jpg,js,js.map,json,png,svg,woff2,css}",
|
"{lib,schema,style,src}/**/*.{ts,tsx,eot,gif,html,jpg,js,js.map,json,png,svg,woff2,css}",
|
||||||
|
@ -17,7 +17,7 @@
|
||||||
],
|
],
|
||||||
"jupyterlab": {
|
"jupyterlab": {
|
||||||
"extension": "lib/plugin.js",
|
"extension": "lib/plugin.js",
|
||||||
"outputDir": "../../py_packages/ipydrawio-export/src/ipydrawio_export/labextensions/@deathbeds/ipydrawio-pdf",
|
"outputDir": "../../py_packages/ipydrawio-export/src/ipydrawio_export/ext/ipdpdf",
|
||||||
"sharedPackages": {
|
"sharedPackages": {
|
||||||
"@deathbeds/ipydrawio": {
|
"@deathbeds/ipydrawio": {
|
||||||
"bundled": false,
|
"bundled": false,
|
||||||
|
|
|
@ -1,22 +1,23 @@
|
||||||
*.tgz
|
*.tgz
|
||||||
**/.ipynb_checkpoints
|
**/.ipynb_checkpoints
|
||||||
drawio/.git*
|
dio/.git*
|
||||||
drawio/.travis.yml
|
dio/*.json
|
||||||
drawio/*.md
|
dio/*.md
|
||||||
drawio/ChangeLog
|
dio/*/.npmignore
|
||||||
drawio/etc/*
|
dio/*/*.json
|
||||||
drawio/*/*.orig
|
dio/*/*.orig
|
||||||
drawio/*/*.json
|
dio/connect/*
|
||||||
drawio/src/main/java/*
|
dio/dropbox*
|
||||||
drawio/src/main/webapp/connect/*
|
dio/electron*
|
||||||
drawio/src/main/webapp/js/diagramly/*
|
dio/git*.html
|
||||||
drawio/src/main/webapp/math/jax/output/HTML-CSS/*
|
dio/github*
|
||||||
drawio/src/main/webapp/onedrive*
|
dio/js/diagramly/*
|
||||||
drawio/src/main/webapp/github*
|
dio/math/.travis.yml
|
||||||
drawio/src/main/webapp/dropbox*
|
dio/math/jax/output/HTML-CSS/*
|
||||||
drawio/src/main/webapp/WEB-INF/*
|
dio/META-INF/*
|
||||||
drawio/src/main/webapp/META-INF/*
|
dio/onedrive*
|
||||||
drawio/src/main/webapp/yarn.lock
|
dio/onedrive*.html
|
||||||
drawio/src/main/webapp/math/.travis.yml
|
dio/WEB-INF/*
|
||||||
|
dio/yarn.lock
|
||||||
|
drawio/
|
||||||
scripts/*
|
scripts/*
|
||||||
drawio/*/.npmignore
|
|
||||||
|
|
Plik diff jest za duży
Load Diff
|
@ -4,5 +4,5 @@ import { URLExt, PageConfig } from '@jupyterlab/coreutils';
|
||||||
*/
|
*/
|
||||||
export const DRAWIO_URL = URLExt.join(
|
export const DRAWIO_URL = URLExt.join(
|
||||||
PageConfig.getBaseUrl(),
|
PageConfig.getBaseUrl(),
|
||||||
'lab/extensions/@deathbeds/ipydrawio-webpack/static/drawio/src/main/webapp/index.html'
|
'lab/extensions/@deathbeds/ipydrawio-webpack/static/dio/index.html'
|
||||||
);
|
);
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
"name": "@deathbeds/ipydrawio-webpack",
|
"name": "@deathbeds/ipydrawio-webpack",
|
||||||
"jupyterlab": {
|
"jupyterlab": {
|
||||||
"extension": "lib/plugin.js",
|
"extension": "lib/plugin.js",
|
||||||
"outputDir": "../../py_packages/ipydrawio/src/ipydrawio/labextensions/@deathbeds/ipydrawio-webpack",
|
"outputDir": "../../py_packages/ipydrawio/src/ipydrawio/ext/ipdwp",
|
||||||
"webpackConfig": "./webpack.config.js",
|
"webpackConfig": "./webpack.config.js",
|
||||||
"discovery": {
|
"discovery": {
|
||||||
"server": {
|
"server": {
|
||||||
|
@ -43,5 +43,5 @@
|
||||||
"build:pre": "python scripts/patch.py && python scripts/static.py"
|
"build:pre": "python scripts/patch.py && python scripts/static.py"
|
||||||
},
|
},
|
||||||
"types": "lib/index.d.ts",
|
"types": "lib/index.d.ts",
|
||||||
"version": "14.5.9"
|
"version": "14.5.901"
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,36 +14,38 @@
|
||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
import subprocess
|
import shutil
|
||||||
|
import sys
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
HERE = Path(__file__).parent
|
HERE = Path(__file__).parent
|
||||||
ROOT = HERE.parent
|
ROOT = HERE.parent
|
||||||
DRAWIO = ROOT / "drawio"
|
DRAWIO = ROOT / "drawio/src/main/webapp"
|
||||||
APP_MIN = DRAWIO / "src/main/webapp/js/app.min.js"
|
# a much shorter path
|
||||||
|
DIO = ROOT / "dio"
|
||||||
PATCHES = {
|
PATCHES = {
|
||||||
APP_MIN: [
|
"js/app.min.js": [
|
||||||
{
|
{
|
||||||
"name": "global ref so we can get at the App at runtime",
|
"name": "global ref so we can get at the App at runtime",
|
||||||
"before": "new App(new Editor",
|
"before": "new App(new Editor",
|
||||||
"after": "window.IPYDRAWIO_APP = new App(new Editor",
|
"after": "window.IPYDRAWIO_APP = new App(new Editor",
|
||||||
},
|
}
|
||||||
# {
|
|
||||||
# "name": "plugin path so this can be hosted on non-root",
|
|
||||||
# "before": """;window.PLUGINS_BASE_PATH=window.PLUGINS_BASE_PATH||"";""",
|
|
||||||
# "after": """;window.PLUGINS_BASE_PATH=window.PLUGINS_BASE_PATH||"";""",
|
|
||||||
# },
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
def copy():
|
||||||
|
if DIO.exists():
|
||||||
|
shutil.rmtree(DIO)
|
||||||
|
shutil.copytree(DRAWIO, DIO)
|
||||||
|
return 0
|
||||||
|
|
||||||
|
|
||||||
def patch():
|
def patch():
|
||||||
for path, patches in PATCHES.items():
|
for path, patches in PATCHES.items():
|
||||||
print("checkout", path)
|
src_path = DRAWIO / path
|
||||||
subprocess.check_call(
|
dest_path = DIO / path
|
||||||
["git", "checkout", str(path.relative_to(DRAWIO))], cwd=DRAWIO
|
txt = src_path.read_text(encoding="utf-8")
|
||||||
)
|
|
||||||
txt = path.read_text(encoding="utf-8")
|
|
||||||
|
|
||||||
for patch in patches:
|
for patch in patches:
|
||||||
print(" ", patch["name"])
|
print(" ", patch["name"])
|
||||||
|
@ -55,8 +57,9 @@ def patch():
|
||||||
else:
|
else:
|
||||||
print(" ...nothing to do")
|
print(" ...nothing to do")
|
||||||
|
|
||||||
path.write_text(txt, encoding="utf-8")
|
dest_path.write_text(txt, encoding="utf-8")
|
||||||
|
return 0
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
patch()
|
sys.exit(copy() + patch())
|
||||||
|
|
|
@ -20,14 +20,14 @@ from pprint import pprint
|
||||||
|
|
||||||
HERE = Path(__file__).parent
|
HERE = Path(__file__).parent
|
||||||
ROOT = HERE.parent.resolve()
|
ROOT = HERE.parent.resolve()
|
||||||
DRAWIO = ROOT / "drawio"
|
DIO = ROOT / "dio"
|
||||||
IGNORE = ROOT / ".npmignore"
|
IGNORE = ROOT / ".npmignore"
|
||||||
IGNORED = {
|
IGNORED = {
|
||||||
glob.strip(): 0
|
glob.strip(): 0
|
||||||
for glob in IGNORE.read_text().strip().splitlines()
|
for glob in IGNORE.read_text().strip().splitlines()
|
||||||
if glob.startswith("drawio/")
|
if glob.startswith("dio/")
|
||||||
}
|
}
|
||||||
STATIC = ROOT / "lib" / "_static.js"
|
STATIC = ROOT / "lib/_static.js"
|
||||||
HEADER = """
|
HEADER = """
|
||||||
/**
|
/**
|
||||||
All files that should be copied to the labextension folder, available as:
|
All files that should be copied to the labextension folder, available as:
|
||||||
|
@ -36,7 +36,7 @@ HEADER = """
|
||||||
*/
|
*/
|
||||||
"""
|
"""
|
||||||
TMPL = """
|
TMPL = """
|
||||||
import '!!file-loader?name=[path][name].[ext]&context=.!../drawio{}';
|
import '!!file-loader?name=[path][name].[ext]&context=.!../dio{}';
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
@ -52,15 +52,13 @@ def update_static():
|
||||||
print("ignoring\n", "\n".join(IGNORED))
|
print("ignoring\n", "\n".join(IGNORED))
|
||||||
lines = []
|
lines = []
|
||||||
|
|
||||||
for path in sorted(DRAWIO.rglob("*")):
|
for path in sorted(DIO.rglob("*")):
|
||||||
if path.is_dir():
|
if path.is_dir():
|
||||||
continue
|
continue
|
||||||
if is_ignored(path):
|
if is_ignored(path):
|
||||||
continue
|
continue
|
||||||
lines += [
|
lines += [
|
||||||
TMPL.format(
|
TMPL.format(str(path.as_posix()).replace(str(DIO.as_posix()), "")).strip()
|
||||||
str(path.as_posix()).replace(str(DRAWIO.as_posix()), "")
|
|
||||||
).strip()
|
|
||||||
]
|
]
|
||||||
|
|
||||||
assert lines
|
assert lines
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
"@jupyter-widgets/jupyterlab-manager": "3"
|
"@jupyter-widgets/jupyterlab-manager": "3"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"@deathbeds/ipydrawio-webpack": "^14.5.9",
|
"@deathbeds/ipydrawio-webpack": "^14.5.901",
|
||||||
"@jupyter-widgets/base": "4",
|
"@jupyter-widgets/base": "4",
|
||||||
"@jupyter-widgets/controls": "3",
|
"@jupyter-widgets/controls": "3",
|
||||||
"@jupyter-widgets/jupyterlab-manager": "3"
|
"@jupyter-widgets/jupyterlab-manager": "3"
|
||||||
|
@ -31,7 +31,7 @@
|
||||||
"extension": "lib/plugin.js",
|
"extension": "lib/plugin.js",
|
||||||
"mimeExtension": "lib/mime.js",
|
"mimeExtension": "lib/mime.js",
|
||||||
"schemaDir": "schema",
|
"schemaDir": "schema",
|
||||||
"outputDir": "../../py_packages/ipydrawio/src/ipydrawio/labextensions/@deathbeds/ipydrawio",
|
"outputDir": "../../py_packages/ipydrawio/src/ipydrawio/ext/ipd",
|
||||||
"sharedPackages": {
|
"sharedPackages": {
|
||||||
"@deathbeds/ipydrawio-webpack": {
|
"@deathbeds/ipydrawio-webpack": {
|
||||||
"bundled": false,
|
"bundled": false,
|
||||||
|
@ -67,5 +67,5 @@
|
||||||
"url": "https://github.com/deathbeds/ipydrawio.git"
|
"url": "https://github.com/deathbeds/ipydrawio.git"
|
||||||
},
|
},
|
||||||
"types": "lib/index.d.ts",
|
"types": "lib/index.d.ts",
|
||||||
"version": "1.0.0"
|
"version": "1.0.1"
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,7 +24,7 @@ import { DocumentRegistry } from '@jupyterlab/docregistry';
|
||||||
import { ReadonlyPartialJSONObject } from '@lumino/coreutils';
|
import { ReadonlyPartialJSONObject } from '@lumino/coreutils';
|
||||||
|
|
||||||
export const NS = '@deathbeds/ipydrawio';
|
export const NS = '@deathbeds/ipydrawio';
|
||||||
export const VERSION = '1.0.0';
|
export const VERSION = '1.0.1';
|
||||||
export const PLUGIN_ID = `${NS}:plugin`;
|
export const PLUGIN_ID = `${NS}:plugin`;
|
||||||
|
|
||||||
import { Diagram } from './editor';
|
import { Diagram } from './editor';
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
include README.md LICENSE.txt install.json
|
include README.md LICENSE.txt
|
||||||
recursive-exclude src/ipydrawio_export/vendor/draw-image-export2 node_modules
|
recursive-exclude src/ipydrawio_export/vendor/draw-image-export2 node_modules
|
||||||
recursive-include src/ipydrawio_export/etc *.json
|
recursive-include src/ipydrawio_export/etc *.json
|
||||||
recursive-include src/ipydrawio_export/labextensions *.*
|
recursive-include src/ipydrawio_export/ext *.*
|
||||||
recursive-include src/ipydrawio_export/tests/fixtures *.*
|
recursive-include src/ipydrawio_export/tests/fixtures *.*
|
||||||
recursive-include src/ipydrawio_export/vendor/draw-image-export2 *.json *.js README.md LICENSE yarn.lock
|
recursive-include src/ipydrawio_export/vendor/draw-image-export2 *.json *.js README.md LICENSE yarn.lock
|
||||||
|
|
|
@ -18,42 +18,41 @@ import json
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
HERE = Path(__file__).parent
|
HERE = Path(__file__).parent
|
||||||
EXT = HERE / "src/ipydrawio_export/labextensions"
|
EXT = HERE / "src/ipydrawio_export/ext"
|
||||||
|
|
||||||
PDF = EXT / "@deathbeds/ipydrawio-pdf"
|
PDF = EXT / "ipdpdf"
|
||||||
|
|
||||||
SHARE = "share/jupyter/labextensions"
|
SHARE = "share/jupyter/labextensions"
|
||||||
|
|
||||||
__js__ = json.loads((PDF / "package.json").read_text(encoding="utf-8"))
|
__js__ = json.loads((PDF / "package.json").read_text(encoding="utf-8"))
|
||||||
|
|
||||||
EXT_FILES = {}
|
FILES = []
|
||||||
|
|
||||||
for ext_path in [EXT] + [d for d in EXT.rglob("*") if d.is_dir()]:
|
for package_json in EXT.glob("*/package.json"):
|
||||||
if ext_path == EXT:
|
pkg = json.loads(package_json.read_text(encoding="utf-8"))
|
||||||
target = str(SHARE)
|
|
||||||
else:
|
|
||||||
target = f"{SHARE}/{ext_path.relative_to(EXT)}"
|
|
||||||
EXT_FILES[target] = [
|
|
||||||
str(p.relative_to(HERE).as_posix())
|
|
||||||
for p in ext_path.glob("*")
|
|
||||||
if not p.is_dir()
|
|
||||||
]
|
|
||||||
|
|
||||||
ALL_FILES = sum(EXT_FILES.values(), [])
|
FILES += [(f"""{SHARE}/{pkg["name"]}""", ["src/ipydrawio_export/etc/install.json"])]
|
||||||
|
|
||||||
EXT_FILES[str(SHARE)] += ["install.json"]
|
for path in package_json.parent.rglob("*"):
|
||||||
|
if path.is_dir():
|
||||||
|
continue
|
||||||
|
parent = path.parent.relative_to(package_json.parent).as_posix()
|
||||||
|
FILES += [
|
||||||
|
(
|
||||||
|
f"""{SHARE}/{pkg["name"]}/{parent}""",
|
||||||
|
[str(path.relative_to(HERE).as_posix())],
|
||||||
|
)
|
||||||
|
]
|
||||||
|
|
||||||
for app in ["server", "notebook"]:
|
for app in ["server", "notebook"]:
|
||||||
EXT_FILES[f"etc/jupyter/jupyter_{app}_config.d"] = [
|
FILES += [
|
||||||
f"src/ipydrawio_export/etc/jupyter_{app}_config.d/ipydrawio-export.json"
|
(
|
||||||
|
f"etc/jupyter/jupyter_{app}_config.d",
|
||||||
|
[f"src/ipydrawio_export/etc/jupyter_{app}_config.d/ipydrawio-export.json"],
|
||||||
|
)
|
||||||
]
|
]
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
import setuptools
|
import setuptools
|
||||||
|
|
||||||
setuptools.setup(
|
setuptools.setup(version=__js__["version"], data_files=FILES)
|
||||||
version=__js__["version"],
|
|
||||||
data_files=[
|
|
||||||
*[(k, v) for k, v in EXT_FILES.items()],
|
|
||||||
],
|
|
||||||
)
|
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
|
import json
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
from ._version import __js__, __version__
|
from ._version import __js__, __version__
|
||||||
|
@ -24,14 +25,15 @@ from .serverextension import load_jupyter_server_extension
|
||||||
def _jupyter_labextension_paths():
|
def _jupyter_labextension_paths():
|
||||||
"""static paths to link for interactive installation"""
|
"""static paths to link for interactive installation"""
|
||||||
here = Path(__file__).parent
|
here = Path(__file__).parent
|
||||||
|
exts = []
|
||||||
return [
|
for pkg in here.glob("ext/*/package.json"):
|
||||||
dict(
|
exts += [
|
||||||
src=f"{pkg.parent.relative_to(here).as_posix()}",
|
dict(
|
||||||
dest=f"{pkg.parent.parent.name}/{pkg.parent.name}",
|
src=str(pkg.parent.relative_to(here).as_posix()),
|
||||||
)
|
dest=json.loads(pkg.read_text(encoding="utf-8"))["name"],
|
||||||
for pkg in (here / "labextensions").glob("*/*/package.json")
|
)
|
||||||
]
|
]
|
||||||
|
return exts
|
||||||
|
|
||||||
|
|
||||||
def _jupyter_server_extension_paths():
|
def _jupyter_server_extension_paths():
|
||||||
|
|
|
@ -20,11 +20,7 @@ from pathlib import Path
|
||||||
|
|
||||||
HERE = Path(__file__).parent
|
HERE = Path(__file__).parent
|
||||||
|
|
||||||
__js__ = json.loads(
|
__js__ = json.loads((HERE / "ext/ipdpdf/package.json").read_text(encoding="utf-8"))
|
||||||
(HERE / "labextensions/@deathbeds/ipydrawio-pdf/package.json").read_text(
|
|
||||||
encoding="utf-8"
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
__version__ = __js__["version"]
|
__version__ = __js__["version"]
|
||||||
|
|
||||||
|
|
|
@ -18,9 +18,7 @@
|
||||||
PNG_DRAWIO_INFO = "mxfile"
|
PNG_DRAWIO_INFO = "mxfile"
|
||||||
|
|
||||||
# TODO: hoist this to `package.json` and consume directly
|
# TODO: hoist this to `package.json` and consume directly
|
||||||
DRAWIO_APP = (
|
DRAWIO_APP = "../labextensions/@deathbeds/ipydrawio-webpack/static/dio"
|
||||||
"../labextensions/@deathbeds/ipydrawio-webpack/static/drawio/src/main/webapp"
|
|
||||||
)
|
|
||||||
|
|
||||||
# key set in notebook#/metadata/
|
# key set in notebook#/metadata/
|
||||||
IPYNB_METADATA = "@deathbeds/ipydrawio"
|
IPYNB_METADATA = "@deathbeds/ipydrawio"
|
||||||
|
|
|
@ -1,2 +1,3 @@
|
||||||
include README.md LICENSE.txt install.json
|
include README.md LICENSE.txt
|
||||||
recursive-include src/ipydrawio/labextensions *.*
|
recursive-include src/ipydrawio/ext *.*
|
||||||
|
recursive-include src/ipydrawio_export/etc *.json
|
||||||
|
|
|
@ -14,44 +14,39 @@
|
||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
import re
|
|
||||||
from pathlib import Path
|
|
||||||
import json
|
import json
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
HERE = Path(__file__).parent
|
HERE = Path(__file__).parent
|
||||||
|
|
||||||
|
EXT = HERE / "src/ipydrawio/ext"
|
||||||
EXT = HERE / "src/ipydrawio/labextensions"
|
CORE = EXT / "ipd"
|
||||||
CORE = EXT / "@deathbeds/ipydrawio"
|
|
||||||
|
|
||||||
SHARE = "share/jupyter/labextensions"
|
SHARE = "share/jupyter/labextensions"
|
||||||
|
|
||||||
__js__ = json.loads((CORE / "package.json").read_text(encoding="utf-8"))
|
__js__ = json.loads((CORE / "package.json").read_text(encoding="utf-8"))
|
||||||
|
|
||||||
EXT_FILES = {}
|
FILES = []
|
||||||
|
|
||||||
for ext_path in [EXT] + [d for d in EXT.rglob("*") if d.is_dir()]:
|
for package_json in EXT.glob("*/package.json"):
|
||||||
if ext_path == EXT:
|
pkg = json.loads(package_json.read_text(encoding="utf-8"))
|
||||||
target = str(SHARE)
|
|
||||||
else:
|
|
||||||
target = f"{SHARE}/{ext_path.relative_to(EXT)}"
|
|
||||||
EXT_FILES[target] = [
|
|
||||||
str(p.relative_to(HERE).as_posix())
|
|
||||||
for p in ext_path.glob("*")
|
|
||||||
if not p.is_dir()
|
|
||||||
]
|
|
||||||
|
|
||||||
ALL_FILES = sum(EXT_FILES.values(), [])
|
FILES += [(f"""{SHARE}/{pkg["name"]}""", ["src/ipydrawio/etc/install.json"])]
|
||||||
|
|
||||||
EXT_FILES[str(SHARE)] += ["install.json"]
|
for path in package_json.parent.rglob("*"):
|
||||||
|
if path.is_dir():
|
||||||
|
continue
|
||||||
|
|
||||||
|
parent = path.parent.relative_to(package_json.parent).as_posix()
|
||||||
|
FILES += [
|
||||||
|
(
|
||||||
|
f"""{SHARE}/{pkg["name"]}/{parent}""",
|
||||||
|
[str(path.relative_to(HERE).as_posix())],
|
||||||
|
)
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
import setuptools
|
import setuptools
|
||||||
|
|
||||||
setuptools.setup(
|
setuptools.setup(version=__js__["version"], data_files=FILES)
|
||||||
version=__js__["version"],
|
|
||||||
data_files=[
|
|
||||||
*[(k, v) for k, v in EXT_FILES.items()],
|
|
||||||
],
|
|
||||||
)
|
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
|
import json
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
from ._version import __js__, __version__
|
from ._version import __js__, __version__
|
||||||
|
@ -23,13 +24,15 @@ from .widget_diagram import Diagram
|
||||||
def _jupyter_labextension_paths():
|
def _jupyter_labextension_paths():
|
||||||
here = Path(__file__).parent
|
here = Path(__file__).parent
|
||||||
|
|
||||||
return [
|
exts = []
|
||||||
dict(
|
for pkg in here.glob("ext/*/package.json"):
|
||||||
src=f"{pkg.parent.relative_to(here).as_posix()}",
|
exts += [
|
||||||
dest=f"{pkg.parent.parent.name}/{pkg.parent.name}",
|
dict(
|
||||||
)
|
src=str(pkg.parent.relative_to(here).as_posix()),
|
||||||
for pkg in (here / "labextensions").glob("*/*/package.json")
|
dest=json.loads(pkg.read_text(encoding="utf-8"))["name"],
|
||||||
]
|
)
|
||||||
|
]
|
||||||
|
return exts
|
||||||
|
|
||||||
|
|
||||||
__all__ = [
|
__all__ = [
|
||||||
|
|
|
@ -20,11 +20,7 @@ from pathlib import Path
|
||||||
|
|
||||||
HERE = Path(__file__).parent
|
HERE = Path(__file__).parent
|
||||||
|
|
||||||
__js__ = json.loads(
|
__js__ = json.loads((HERE / "ext/ipd/package.json").read_text(encoding="utf-8"))
|
||||||
(HERE / "labextensions/@deathbeds/ipydrawio/package.json").read_text(
|
|
||||||
encoding="utf-8"
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
__version__ = __js__["version"]
|
__version__ = __js__["version"]
|
||||||
|
|
||||||
|
|
|
@ -160,7 +160,7 @@ JS_PY_SCRIPTS = {
|
||||||
|
|
||||||
# special things for ipydrawio-webpack
|
# special things for ipydrawio-webpack
|
||||||
IPDW = JS_PKG_JSON["ipydrawio-webpack"].parent
|
IPDW = JS_PKG_JSON["ipydrawio-webpack"].parent
|
||||||
IPDW_APP = IPDW / "drawio/src/main/webapp/js/app.min.js"
|
IPDW_APP = IPDW / "dio/js/app.min.js"
|
||||||
IPDW_PY = (IPDW / "scripts").rglob("*.py")
|
IPDW_PY = (IPDW / "scripts").rglob("*.py")
|
||||||
DRAWIO = IPDW / "drawio"
|
DRAWIO = IPDW / "drawio"
|
||||||
IPDW_LIB = IPDW / "lib"
|
IPDW_LIB = IPDW / "lib"
|
||||||
|
@ -205,19 +205,16 @@ SERVER_EXT = {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
def NOT_LABEXTENSIONS(paths):
|
|
||||||
return [p for p in paths if "labextensions" not in str(p)]
|
|
||||||
|
|
||||||
|
|
||||||
ALL_PY = [
|
ALL_PY = [
|
||||||
*ATEST.rglob("*.py"),
|
*ATEST.rglob("*.py"),
|
||||||
|
*BINDER.glob("*.py"),
|
||||||
*IPDW_PY,
|
*IPDW_PY,
|
||||||
|
*PY_SETUP.values(),
|
||||||
*SCRIPTS.glob("*.py"),
|
*SCRIPTS.glob("*.py"),
|
||||||
*sum(JS_PY_SCRIPTS.values(), []),
|
*sum(JS_PY_SCRIPTS.values(), []),
|
||||||
*sum(PY_SRC.values(), []),
|
*sum(PY_SRC.values(), []),
|
||||||
*BINDER.glob("*.py"),
|
|
||||||
POSTBUILD_PY,
|
|
||||||
DODO,
|
DODO,
|
||||||
|
POSTBUILD_PY,
|
||||||
]
|
]
|
||||||
ALL_YML = [*ROOT.glob("*.yml"), *CI.rglob("*.yml"), *BINDER.glob("*.yml")]
|
ALL_YML = [*ROOT.glob("*.yml"), *CI.rglob("*.yml"), *BINDER.glob("*.yml")]
|
||||||
ALL_JSON = [
|
ALL_JSON = [
|
||||||
|
@ -230,7 +227,6 @@ ALL_JSON = [
|
||||||
ALL_MD = [
|
ALL_MD = [
|
||||||
*ROOT.glob("*.md"),
|
*ROOT.glob("*.md"),
|
||||||
*PACKAGES.glob("*/*.md"),
|
*PACKAGES.glob("*/*.md"),
|
||||||
*NOT_LABEXTENSIONS(PY_PACKAGES.glob("*/*.md")),
|
|
||||||
]
|
]
|
||||||
ALL_SETUP_CFG = [SETUP_CFG, *PY_SETUP_CFG.values()]
|
ALL_SETUP_CFG = [SETUP_CFG, *PY_SETUP_CFG.values()]
|
||||||
ALL_JS = [PACKAGES / ".eslintrc.js"]
|
ALL_JS = [PACKAGES / ".eslintrc.js"]
|
||||||
|
@ -301,6 +297,7 @@ OK_PROVISION = BUILD / "provision.ok"
|
||||||
OK_ROBOT_DRYRUN = BUILD / "robot.dryrun.ok"
|
OK_ROBOT_DRYRUN = BUILD / "robot.dryrun.ok"
|
||||||
OK_RFLINT = BUILD / "robot.rflint.ok"
|
OK_RFLINT = BUILD / "robot.rflint.ok"
|
||||||
OK_ATEST = BUILD / "atest.ok"
|
OK_ATEST = BUILD / "atest.ok"
|
||||||
|
OK_CONDA_TEST = BUILD / "conda-build.test.ok"
|
||||||
|
|
||||||
OK_EXT_BUILD = {k: BUILD / f"ext.build.{k}.ok" for k in JS_LABEXT_PY_HOST}
|
OK_EXT_BUILD = {k: BUILD / f"ext.build.{k}.ok" for k in JS_LABEXT_PY_HOST}
|
||||||
|
|
||||||
|
@ -316,6 +313,16 @@ CMD_LIST_EXTENSIONS = ["jupyter", "labextension", "list"]
|
||||||
|
|
||||||
CMD_LAB = ["jupyter", "lab", "--no-browser", "--debug"]
|
CMD_LAB = ["jupyter", "lab", "--no-browser", "--debug"]
|
||||||
|
|
||||||
|
# conda building
|
||||||
|
RECIPE = ROOT / "conda.recipe/meta.yaml"
|
||||||
|
CONDA_BLD = BUILD / "conda-bld"
|
||||||
|
# could be mambabuild
|
||||||
|
CONDA_BUILDERER = os.environ.get("CONDA_BUILDERER", "build")
|
||||||
|
CONDA_PKGS = {
|
||||||
|
pkg: CONDA_BLD / f"noarch/{pkg}-{ver}-py_0.tar.bz2"
|
||||||
|
for pkg, ver in PY_VERSION.items()
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
def get_atest_stem(attempt=1, extra_args=None, browser=None):
|
def get_atest_stem(attempt=1, extra_args=None, browser=None):
|
||||||
"""get the directory in ATEST_OUT for this platform/apps"""
|
"""get the directory in ATEST_OUT for this platform/apps"""
|
||||||
|
@ -330,4 +337,6 @@ def get_atest_stem(attempt=1, extra_args=None, browser=None):
|
||||||
return stem
|
return stem
|
||||||
|
|
||||||
|
|
||||||
os.environ.update(IPYDRAWIO_DATA_DIR=str(IPYDRAWIO_DATA_DIR))
|
os.environ.update(
|
||||||
|
IPYDRAWIO_DATA_DIR=str(IPYDRAWIO_DATA_DIR), PIP_DISABLE_PIP_VERSION_CHECK="1"
|
||||||
|
)
|
||||||
|
|
|
@ -72,23 +72,23 @@
|
||||||
tslib "~1.13.0"
|
tslib "~1.13.0"
|
||||||
|
|
||||||
"@deathbeds/ipydrawio-notebook@file:packages/ipydrawio-notebook":
|
"@deathbeds/ipydrawio-notebook@file:packages/ipydrawio-notebook":
|
||||||
version "1.0.0"
|
version "1.0.1"
|
||||||
dependencies:
|
dependencies:
|
||||||
"@jupyterlab/application" "3"
|
"@jupyterlab/application" "3"
|
||||||
"@jupyterlab/notebook" "3"
|
"@jupyterlab/notebook" "3"
|
||||||
|
|
||||||
"@deathbeds/ipydrawio-pdf@file:packages/ipydrawio-pdf":
|
"@deathbeds/ipydrawio-pdf@file:packages/ipydrawio-pdf":
|
||||||
version "1.0.0"
|
version "1.0.1"
|
||||||
dependencies:
|
dependencies:
|
||||||
"@jupyterlab/application" "3"
|
"@jupyterlab/application" "3"
|
||||||
|
|
||||||
"@deathbeds/ipydrawio-webpack@file:packages/ipydrawio-webpack":
|
"@deathbeds/ipydrawio-webpack@file:packages/ipydrawio-webpack":
|
||||||
version "14.5.9"
|
version "14.5.901"
|
||||||
dependencies:
|
dependencies:
|
||||||
"@jupyterlab/application" "3"
|
"@jupyterlab/application" "3"
|
||||||
|
|
||||||
"@deathbeds/ipydrawio@file:packages/ipydrawio":
|
"@deathbeds/ipydrawio@file:packages/ipydrawio":
|
||||||
version "1.0.0"
|
version "1.0.1"
|
||||||
dependencies:
|
dependencies:
|
||||||
"@jupyterlab/application" "3"
|
"@jupyterlab/application" "3"
|
||||||
"@jupyterlab/launcher" "3"
|
"@jupyterlab/launcher" "3"
|
||||||
|
|
Ładowanie…
Reference in New Issue