Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reorganize package #2

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
from __future__ import print_function

import os
import pipes
import shutil
import subprocess
import sys
import traceback

from distutils import log
from distutils.command.build import build # type: ignore
from distutils.command.sdist import sdist # type: ignore
Expand All @@ -31,8 +33,6 @@ def list2cmdline(cmd_list):
ROOT_DIR = Path(__file__).parent
SRC_DIR = ROOT_DIR / "src"
PKG_DIR = SRC_DIR / NAME
JS_DIR = SRC_DIR / "idom-bokeh-extension"


# -----------------------------------------------------------------------------
# Package Definition
Expand Down Expand Up @@ -126,11 +126,13 @@ def list2cmdline(cmd_list):
def build_javascript_first(cls, rebuild=False):
class Command(cls):
def run(self):
build_bokeh_extension(JS_DIR, rebuild=rebuild)
shutil.move(
str(JS_DIR / "dist" / f"{JS_DIR.name}.min.js"),
str(PKG_DIR / "bundle.js"),
)
build_bokeh_extension(PKG_DIR, rebuild=rebuild)
npm = "npm" if sys.platform != "win32" else "npm.bat"
os.chdir("src/idom_bokeh")
try:
self.spawn([npm, "run", "rollup"])
finally:
os.chdir("../..")
super().run()

return Command
Expand Down
1 change: 0 additions & 1 deletion src/idom-bokeh-extension/.bokeh

This file was deleted.

22 changes: 0 additions & 22 deletions src/idom-bokeh-extension/README.md

This file was deleted.

13 changes: 10 additions & 3 deletions src/idom_bokeh/_model.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
from bokeh.core.properties import Any, Dict, Either, String, Null, Tuple
from bokeh.events import ModelEvent
from bokeh.models import HTMLBox


class IDOMEvent(ModelEvent):

event_name = 'idom_event'

def __init__(self, model, data=None):
self.data = data
super().__init__(model=model)


class IDOM(HTMLBox):

__implementation__ = "bundle.js"
importSourceUrl = String()

event = Tuple(Any, Any)

msg = Either(Dict(String, Any), Null)
File renamed without changes.
Loading