-
Notifications
You must be signed in to change notification settings - Fork 120
#241 Add macOS-specific fixes and tests for Kaleido compatibility #289
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#241 Add macOS-specific fixes and tests for Kaleido compatibility #289
Conversation
Introduce macOS-specific arguments for Kaleido to address issue #323. Add new tests to validate image generation (e.g., PNG, JPEG, SVG, PDF) on macOS, ensuring proper functionality. This improves cross-platform support and resolves inconsistencies in the Kaleido backend. issue: plotly#241
Cleaned up unnecessary blank lines and adjusted minor formatting issues to improve code readability and maintain consistency. No functional changes were made.
Introduced a macOS-specific `create_test_surface` function in `plotly_kaleido` and adjusted test-related imports in `plotly`. Ensures compatibility with macOS while keeping non-macOS logic intact.
Reorganized and added conditional imports to improve clarity and maintain consistent functionality across platforms. This ensures the required dependencies are properly included, particularly handling the macOS-specific conditions.
Reorganized imports in the tests module to improve clarity and maintain consistency. Non-standard library imports are now grouped separately, following a logical and readable structure.
Hi @joaquinbejar , Thank you for the PR! Interesting find!
I have only one commet regarding the PR. I see that you have added new unittests. Any particular reason why you chose to do that and not reuse the existing ones? Do you mind if I merge your tests with the previous ones ( I see you have added some nice extra asserts)? |
HI @andrei-ng Sure, that makes sense! I added the new tests because the failure reliably showed up with a Surface trace, while the existing tests use only Scatter. I wanted to prove the fix on the exact setup that was breaking. Feel totally free to merge my extra assertions into the existing test file (or replace it entirely) — I just separated them to keep the repro crystal-clear. Thanks for the review! |
OK, understood. Thank you for clarifying! I will remove the old unittests in favour of yours and merge it afterwards. |
- keep only the kaleido unittests added in PR #289 in favor of previous ones Signed-off-by: Andrei Gherghescu <8067229+andrei-ng@users.noreply.github.com>
- keep only the kaleido unittests added in PR #289 in favor of previous ones Signed-off-by: Andrei Gherghescu <8067229+andrei-ng@users.noreply.github.com>
- keep only the kaleido unittests added in PR #289 in favor of previous ones Signed-off-by: Andrei Gherghescu <8067229+andrei-ng@users.noreply.github.com>
Hi 👋,
This PR fixes #241 by omitting
--disable-gpu
on macOS + arm64.spec.json:
so we never get any image data. The fix is still to omit
--disable-gpu
, but I wanted to be precise in the description.What the patch changes
--disable-gpu
flag is removed on macOS; everything else remains untouched.write_image
now succeeds and the tests pass.Link to upstream discussion
plotly/Kaleido#323
Let me know if you’d prefer the macOS check to be
target_arch = "aarch64"
only (i.e. keep the flag for Intel Macs). Happy to adjust!— Joaquín