Skip to content

Commit 4c2cd13

Browse files
committed
fix .pth file inclusion
1 parent a5d9c28 commit 4c2cd13

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

MANIFEST.in

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,3 @@ graft jupyter-config
33

44
include LICENSE
55
include pyproject.toml
6-
include reactpy_jupyter.pth

reactpy_jupyter/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from .monkey_patch import execute_patch
1111
from .widget_component import from_widget
1212

13-
__version__ = "0.9.1" # DO NOT MODIFY
13+
__version__ = "0.9.2" # DO NOT MODIFY
1414

1515
__all__ = (
1616
"from_widget",

setup.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,17 @@ def build_javascript_first(cmd: Command):
161161
log.info("Successfully installed Javascript")
162162

163163

164+
def build_with_pth_file(cmd: Command):
165+
build_lib = getattr(cmd, "build_lib", None) or getattr(cmd, "dist_dir", None)
166+
if build_lib is None:
167+
raise ValueError("Cannot find build_lib or dist_dir")
168+
169+
pth_filename = f"{NAME}.pth"
170+
source_pth_file = ROOT_DIR / pth_filename
171+
target_pth_file = Path(build_lib, pth_filename)
172+
cmd.copy_file(str(source_pth_file), str(target_pth_file))
173+
174+
164175
def add_to_cmd(cls: Command, functions: list[Callable[[Command], None]]) -> Command:
165176
class Command(cls):
166177
def run(self):
@@ -175,6 +186,7 @@ def run(self):
175186
add_to_cmd,
176187
functions=[
177188
build_javascript_first,
189+
build_with_pth_file,
178190
],
179191
)
180192

0 commit comments

Comments
 (0)