Extension:SyntaxHighlight/Updating pygments

To update the version of Pygments, follow the following instructions.

On Wikimedia sites

Since T320848, Pygments is installed in the Blubber generated container image by directly fetching a built wheel from PyPi. The version of Pygments installed is managed in the syntaxhighlight/requirements.txt file. This file should pin to a specific version matching the version embedded in the extension and use a sha256 hash to verify the downloaded wheel. See https://pip.pypa.io/en/stable/topics/secure-installs/ for more information on hash-checking.

Rebuild the Shellbox container and update the image version for the shellbox-syntaxhighlight deployment. And then deploy it. It'll take roughly an hour for Special:Version to update, triggering cache invalidation of all highlighted content.

The resulting container image expects callers to use $wgPygmentizePath = '/srv/app/pygmentize'; to specify the location of the pygmentize script.

Bundled copy

In a checkout of the SyntaxHighlight git repo, run the createPygmentizeBundle.php maintenance script and commit the result.

If you are working with MediaWiki-Docker, this might look something like:

$ docker compose up -d
$ docker compose exec mediawiki php maintenance/run.php ./extensions/SyntaxHighlight_GeSHi/maintenance/createPygmentizeBundle.php