|
| 1 | +# Release v1.2.1 |
| 2 | + |
| 3 | +**Release Date**: November 17, 2025 |
| 4 | + |
| 5 | +This is a patch release that fixes a bug causing build failures in LaTeX/PDF output. |
| 6 | + |
| 7 | +## 🐛 Bug Fixes |
| 8 | + |
| 9 | +### LaTeX/PDF Build Failure |
| 10 | + |
| 11 | +Fixed a `ValueError: list.remove(x): x not in list` error that occurred when building LaTeX/PDF documentation with sphinx-exercise v1.2.0. |
| 12 | + |
| 13 | +**Issue:** |
| 14 | +- The `UpdateReferencesToEnumerated` transform attempted to remove the `'std-ref'` CSS class from inline reference nodes |
| 15 | +- In LaTeX/PDF builds (and potentially other build scenarios), this class may not be present |
| 16 | +- Python's `list.remove()` raises a `ValueError` when the item doesn't exist, causing the build to fail |
| 17 | + |
| 18 | +**Fix:** |
| 19 | +- Added a defensive check: `if "std-ref" in classes:` before attempting removal |
| 20 | +- The transform now safely handles cases where the class is absent |
| 21 | +- Preserves the intended behavior: converting textual references to numeric references for enumerated exercises |
| 22 | + |
| 23 | +**Impact:** |
| 24 | +- Fixes build failures in projects using sphinx-exercise with LaTeX/PDF output |
| 25 | +- No functional changes to existing behavior |
| 26 | +- All existing tests continue to pass |
| 27 | + |
| 28 | +**Example Error (before fix):** |
| 29 | +``` |
| 30 | +Exception occurred: |
| 31 | + File ".../sphinx_exercise/post_transforms.py", line 69, in run |
| 32 | + classes.remove("std-ref") |
| 33 | +ValueError: list.remove(x): x not in list |
| 34 | +``` |
| 35 | + |
| 36 | +## 📦 Installation |
| 37 | + |
| 38 | +Install or upgrade via pip: |
| 39 | + |
| 40 | +```bash |
| 41 | +pip install --upgrade sphinx-exercise |
| 42 | +``` |
| 43 | + |
| 44 | +## 🔄 Migration Notes |
| 45 | + |
| 46 | +**If you're upgrading from v1.2.0:** |
| 47 | +- No breaking changes |
| 48 | +- No action required |
| 49 | +- If you encountered LaTeX/PDF build failures with v1.2.0, this release fixes that issue |
| 50 | + |
| 51 | +**Compatibility:** |
| 52 | +- Python 3.10, 3.11, 3.12, 3.13 |
| 53 | +- Sphinx 6, 7, 8 |
| 54 | +- All existing directives and configurations continue to work |
| 55 | + |
| 56 | +## 🔗 Related Issues |
| 57 | + |
| 58 | +- PR [#82](https://github.com/executablebooks/sphinx-exercise/pull/82) - Fix std-ref class removal |
| 59 | +- Issue discovered in [QuantEcon/continuous_time_mcs CI build](https://github.com/QuantEcon/continuous_time_mcs/actions/runs/19413054039/job/55537214078?pr=144) |
| 60 | + |
| 61 | +## 📚 Documentation |
| 62 | + |
| 63 | +For complete documentation, see: |
| 64 | +- [Configuration Options](../syntax.md) |
| 65 | +- [Installation Guide](../install.md) |
0 commit comments