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)
When you install this from git, you will need to first clone the repository:
git clone git://projects.mako.cc/mediawiki_dump_tools
From within the repository working directory, initiatlize and set up the submodule like:
git submodule init
git submodule update
Wikimedia dumps are usually in a compressed format such as 7z (most common), gz, or bz2. Wikiq uses your computer's compression software to read these files. Therefore wikiq depends on [7za]{.title-ref}, [gzcat]{.title-ref}, and [zcat]{.title-ref}.
Dependencies
These non-Python dependencies must be installed on your system for wikiq and its associated tests to work.
- 7zip
- ffmpeg
A new diff engine based on [_wikidiff2]{.title-ref} can be used for word-persistence. Wikiq can also output the diffs between each page revision. This requires installing Wikidiff 2 on your system. On Debian or Ubuntu Linux this can be done via.
apt-get install php-wikidiff2
You may have to also run. sudo phpenmod wikidiff2.
Tests ----To run tests:
python -m unittest test.Wikiq_Unit_Test
TODO:
- [] Output metadata about the run. What parameters were used? What versions of deltas?
- [] Url encoding by default