Skip to content

Commit b96a0d2

Browse files
committed
Release v1.2.1
- Update version to 1.2.1 - Add CHANGELOG entry for v1.2.1 - Add detailed release notes in docs/source/releases/v1.2.1.md - Update releases index This patch release fixes a ValueError when building LaTeX/PDF output where 'std-ref' class may not be present in inline node classes.
1 parent c434ee8 commit b96a0d2

File tree

4 files changed

+76
-1
lines changed

4 files changed

+76
-1
lines changed

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
# Changelog
22

3+
## [v1.2.1](https://github.com/executablebooks/sphinx-exercise/tree/v1.2.1) (2025-11-17)
4+
5+
### Fixes 🐛
6+
7+
- Fixed `ValueError: list.remove(x): x not in list` when building LaTeX/PDF output ([#82](https://github.com/executablebooks/sphinx-exercise/pull/82))
8+
- Added defensive check before removing 'std-ref' class in `UpdateReferencesToEnumerated` transform
9+
- The 'std-ref' class may not be present in all build scenarios (particularly LaTeX/PDF builds)
10+
- Fix ensures compatibility across different Sphinx builders and versions
11+
312
## [v1.2.0](https://github.com/executablebooks/sphinx-exercise/tree/v1.2.0) (2025-11-05)
413

514
### New ✨

docs/source/releases/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ This section contains detailed release notes for sphinx-exercise versions.
55
```{toctree}
66
:maxdepth: 1
77
8+
v1.2.1
89
v1.2.0
910
v1.1.1
1011
v1.1.0

docs/source/releases/v1.2.1.md

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
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)

sphinx_exercise/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
:license: MIT, see LICENSE for details.
88
"""
99

10-
__version__ = "1.2.0"
10+
__version__ = "1.2.1"
1111

1212
from pathlib import Path
1313
from typing import Any, Dict, Set, Union, cast

0 commit comments

Comments
 (0)