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
UpdateReferencesToEnumeratedtransform attempted to remove the'std-ref'CSS class from inline reference nodesIn LaTeX/PDF builds (and potentially other build scenarios), this class may not be present
Pythonβs
list.remove()raises aValueErrorwhen the item doesnβt exist, causing the build to fail
Fix:
Added a defensive check:
if "std-ref" in classes:before attempting removalThe 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: