diff --git a/MANIFEST.in b/MANIFEST.in index 2d26971..f4540c2 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -3,4 +3,3 @@ graft jupyter-config include LICENSE include pyproject.toml -include reactpy_jupyter.pth diff --git a/reactpy_jupyter/__init__.py b/reactpy_jupyter/__init__.py index f12b9be..ccd37d8 100644 --- a/reactpy_jupyter/__init__.py +++ b/reactpy_jupyter/__init__.py @@ -10,7 +10,7 @@ from .monkey_patch import execute_patch from .widget_component import from_widget -__version__ = "0.9.1" # DO NOT MODIFY +__version__ = "0.9.2" # DO NOT MODIFY __all__ = ( "from_widget", diff --git a/setup.py b/setup.py index 66dc744..b682d58 100644 --- a/setup.py +++ b/setup.py @@ -161,6 +161,17 @@ def build_javascript_first(cmd: Command): log.info("Successfully installed Javascript") +def build_with_pth_file(cmd: Command): + build_lib = getattr(cmd, "build_lib", None) or getattr(cmd, "dist_dir", None) + if build_lib is None: + raise ValueError("Cannot find build_lib or dist_dir") + + pth_filename = f"{NAME}.pth" + source_pth_file = ROOT_DIR / pth_filename + target_pth_file = Path(build_lib, pth_filename) + cmd.copy_file(str(source_pth_file), str(target_pth_file)) + + def add_to_cmd(cls: Command, functions: list[Callable[[Command], None]]) -> Command: class Command(cls): def run(self): @@ -175,6 +186,7 @@ def run(self): add_to_cmd, functions=[ build_javascript_first, + build_with_pth_file, ], )