Release v1.2.1#

Release Date: November 17, 2025

This is a patch release that fixes a bug causing build failures in LaTeX/PDF output.

πŸ› Bug Fixes#

LaTeX/PDF Build Failure#

Fixed a ValueError: list.remove(x): x not in list error that occurred when building LaTeX/PDF documentation with sphinx-exercise v1.2.0.

Issue:

  • The UpdateReferencesToEnumerated transform attempted to remove the 'std-ref' CSS class from inline reference nodes

  • In LaTeX/PDF builds (and potentially other build scenarios), this class may not be present

  • Python’s list.remove() raises a ValueError when the item doesn’t exist, causing the build to fail

Fix:

  • Added a defensive check: if "std-ref" in classes: before attempting removal

  • The transform now safely handles cases where the class is absent

  • Preserves the intended behavior: converting textual references to numeric references for enumerated exercises

Impact:

  • Fixes build failures in projects using sphinx-exercise with LaTeX/PDF output

  • No functional changes to existing behavior

  • All existing tests continue to pass

Example Error (before fix):

Exception occurred:
  File ".../sphinx_exercise/post_transforms.py", line 69, in run
    classes.remove("std-ref")
ValueError: list.remove(x): x not in list

πŸ“¦ Installation#

Install or upgrade via pip:

pip install --upgrade sphinx-exercise

πŸ”„ Migration Notes#

If you’re upgrading from v1.2.0:

  • No breaking changes

  • No action required

  • If you encountered LaTeX/PDF build failures with v1.2.0, this release fixes that issue

Compatibility:

  • Python 3.10, 3.11, 3.12, 3.13

  • Sphinx 6, 7, 8

  • All existing directives and configurations continue to work

πŸ“š Documentation#

For complete documentation, see: