Conversation
This branch has not been deployed
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.
First
HwpxDocument.to_bytes()loaded every tool module throughhwpx.tools.__init__, including exporters, viewers, diff, and mail merge. Tool exports and the previously reachable submodules now resolve on first access through static imports; save loads only the package validator and its required document validator. The Markdown converter also importsimportlib.metadataonly when it looks up the distribution version.Existing exports,
__all__,dir(), star imports, object identities, and static types are preserved. A targeted module setter preserves thedoc_difffunction when Python attaches its same-named child, including direct-child-first imports. Save validation remains intact.Fixes #386.
Validation
lxml: deferred imports, all exports, doc_diff import ordering/function replacement, version lookup, and save/reopen pass with warnings treated as errors.tests/fixtures/m3_gongmun_gold/NOTICE.md): all six unchanged/edited save-reopen cases pass, with every saved ZIP member byte-identical to main for the same operation.Local measurements
11 interleaved fresh isolated processes per tree, identical Python 3.13 interpreter/dependencies, bytecode warmed once; medians:
import hwpxto_bytes()importlib.metadataafter plain importThe hwpx-module import bound remains 97. Timings are observations on this machine.