Skip to content

Commit 275422b

Browse files
cpsievertclaude
andcommitted
Fix kaleido version detection for CI compatibility
Check for kaleido v1 by looking for the v1-specific `write_fig_sync` function rather than checking for absence of `scopes`. This handles edge cases where kaleido v0.2.1 may have broken `scopes` attribute on certain Python versions (e.g., Python 3.14). Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent b1103b2 commit 275422b

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

R/kaleido.R

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,11 @@ kaleido <- function(...) {
9797
}
9898
)
9999

100-
res <- if (reticulate::py_has_attr(kaleido, "scopes")) {
101-
legacyKaleidoScope(kaleido)
102-
} else {
100+
# Check for kaleido v1 by looking for v1-specific function
101+
res <- if (reticulate::py_has_attr(kaleido, "write_fig_sync")) {
103102
newKaleidoScope(kaleido)
103+
} else {
104+
legacyKaleidoScope(kaleido)
104105
}
105106

106107
class(res) <- "kaleidoScope"

0 commit comments

Comments
 (0)