pywikidiff2 was imported at module scope, so every invocation of wikiq required it -- including `wikiq --help`. It is not on PyPI, compiles a C++ extension, and needs libthai, which made a compiler a hard requirement for installing a tool that mostly does not need one. Only --diff and -p wikidiff2 actually use it. Import it inside those two code paths instead, and report what to install when it is missing rather than failing with an ImportError traceback. The check also runs once at startup, since both use sites sit deep in the per-revision loop and a run can stream for hours before reaching them. Dropping the dependency also removes the PEP 508 direct reference from the package metadata, and with it the need for hatchling's allow-direct-references. PyPI rejects uploads whose metadata contains a direct URL, so this is a prerequisite for publishing wikiq there. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> (cherry picked from commit 12325afd46670e949abf1c0e14799e212d7ff6ce)
1015 B
1015 B