refactor: sort import statements in docxtpl/ - #648
Open
waketzheng wants to merge 6 commits into
Open
Conversation
CAOShurong
approved these changes
Aug 13, 2026
CAOShurong
left a comment
There was a problem hiding this comment.
I independently reviewed and tested the exact head f583ed3428af05eab158960cb06f382c193ebec4.
- All 37 test scripts passed when run directly with the review environment's Python interpreter.
flake8andgit diff --checkpassed, and both the sdist and wheel built successfully.- From clean wheel installs,
from docxtpl import *excludedSubdocwhendocxcomposewas absent and included it when the optional dependency was installed. - A normal template rendered and reopened successfully from the installed wheel; the optional-dependency environment also rendered and reopened a document containing a generated subdocument.
- The 14 upstream test/codestyle checks are green.
The import-only changes preserve the optional dependency behavior and look correct to me.
OpenAI Codex assisted with the exact-head test matrix and diff review. I personally checked the commands, outputs, installed-wheel behavior, and this approval.
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.
Description
try ... except ImportErrorblock indocxtpl/template.pyto below the other import statements.isort(runuvx isort docxtpl).This is based on PR #647.
Diff: waketzheng/python-docx-template@remove-noqa...sort-imports