Skip to content

Commit cb87437

Browse files
authored
Andrew/temp rework (#264)
* Rework temp logic for isolation workaround * Upgrade choreographer for is_isolated support * Add changelog
1 parent f94885a commit cb87437

File tree

4 files changed

+54
-30
lines changed

4 files changed

+54
-30
lines changed

src/py/CHANGELOG.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
v1.0.0rc7
2+
- Use new choero is_isolated() to improve platform support
13
v1.0.0rc6
24
- All force_cdn to not use plotly install's js
35
v1.0.0rc5

src/py/kaleido/kaleido.py

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -116,18 +116,6 @@ def __init__(self, *args, **kwargs): # noqa: D417 no args/kwargs in description
116116
self._width = None
117117
_logger.debug(f"Timeout: {self._timeout}")
118118

119-
if page and isinstance(page, str) and Path(page).is_file():
120-
self._index = page
121-
elif page and hasattr(page, "is_file") and page.is_file():
122-
self._index = page.as_uri()
123-
else:
124-
self.tmp_dir = TmpDirectory(path=Path(__file__).resolve().parent / "vendor")
125-
index = self.tmp_dir.path / "index.html"
126-
self._index = index.as_uri()
127-
if not page:
128-
page = PageGenerator()
129-
page.generate_index(index)
130-
131119
try:
132120
super().__init__(*args, **kwargs)
133121
except ChromeNotFoundError:
@@ -139,6 +127,24 @@ def __init__(self, *args, **kwargs): # noqa: D417 no args/kwargs in description
139127
"functions in kaleido.",
140128
) from ChromeNotFoundError
141129

130+
if page and isinstance(page, str) and Path(page).is_file():
131+
self._index = page
132+
elif page and hasattr(page, "is_file") and page.is_file():
133+
self._index = page.as_uri()
134+
else:
135+
if self.is_isolated():
136+
path = None
137+
sneak = False
138+
else:
139+
path = Path(__file__).resolve().parent / "vendor"
140+
sneak = True
141+
self.tmp_dir = TmpDirectory(path=path, sneak=sneak)
142+
index = self.tmp_dir.path / "index.html"
143+
self._index = index.as_uri()
144+
if not page:
145+
page = PageGenerator()
146+
page.generate_index(index)
147+
142148
async def _conform_tabs(self, tabs=None) -> None:
143149
if not tabs:
144150
tabs = list(self.tabs.values())

src/py/pyproject.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ maintainers = [
2626
{name = "Andrew Pikul", email = "[email protected]"},
2727
]
2828
dependencies = [
29-
"choreographer>=1.0.3",
29+
"choreographer>=1.0.5",
3030
"logistro>=1.0.8",
3131
"orjson>=3.10.15",
3232
]
@@ -57,9 +57,9 @@ dev = [
5757
#]
5858

5959
[tool.uv.sources]
60-
#mkquixote = { path = "../../../mkquixote", editable = true }
61-
#choreographer = { path = "../../../devtools_protocol", editable = true }
62-
#logistro = { path = "../../../logistro", editable = true }
60+
mkquixote = { path = "../../../mkquixote", editable = true }
61+
choreographer = { path = "../../../devtools_protocol", editable = true }
62+
logistro = { path = "../../../logistro", editable = true }
6363

6464
[tool.ruff.lint]
6565
select = ["ALL"]

src/py/uv.lock

Lines changed: 30 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)