feat: enhance platform support and error handling in WeasyPrint initi… - #79
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Enhances the Weasyprint.Wrapped initialization and execution flow to be safer across platforms and more resilient, aligning with Issue #78’s goals around argument handling, initialization robustness, and platform support.
Changes:
- Added guarded, more explicit initialization with better error messaging and runtime-binary validation.
- Reworked CLI argument construction to use structured argument building instead of interpolated strings.
- Improved integration tests to assert PDF “shape” and avoid writing expected artifacts during test runs; added a missing-asset init test.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
src/Weasyprint.Wrapped/Printer.cs |
Adds init locking + improved init errors; structured argument building; explicit OS handling and runtime executable discovery helpers. |
src/Weasyprint.Wrapped/Exceptions/InitializeException.cs |
Adds message + inner-exception constructors to support better init error reporting. |
src/Weasyprint.Wrapped/Configuration/ConfigurationProvider.cs |
Throws on unsupported OS rather than defaulting to Linux asset selection. |
src/Weasyprint.Wrapped.Tests/Tests/PrinterTests.cs |
Strengthens assertions (PDF header checks), removes side-effect writes, adds missing-asset init test. |
AGENTS.md |
Adds repo-level operational/documentation map for contributors/agents. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Agent-Logs-Url: https://github.com/berthertogen/weasyprint.wrapped/sessions/2ca2a9ff-69ff-4a7f-afb1-34efd8feb01f Co-authored-by: berthertogen <22886034+berthertogen@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…alization
closes #78