diff --git a/MANIFEST.in b/MANIFEST.in index f4540c2..2d26971 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -3,3 +3,4 @@ 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 a36234d..60ea3a6 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.4" # DO NOT MODIFY +__version__ = "0.9.5" # DO NOT MODIFY __all__ = ( "from_widget", diff --git a/setup.py b/setup.py index d3538a6..b682d58 100644 --- a/setup.py +++ b/setup.py @@ -162,9 +162,14 @@ def build_javascript_first(cmd: Command): 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 - cmd.copy_file(str(source_pth_file), 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: