financepy/products/bonds/bond.py line 1238 contains an f-string whose replacement field spans two lines:
print(f"Warning: YTM calculation did not converge for price {
dirty_price}")
Multi-line expressions inside f-strings are a PEP 701 feature, available only on Python 3.12+. On Python 3.10 and 3.11 this is a SyntaxError at import time:
File ".../financepy/products/bonds/bond.py", line 1238
SyntaxError: unterminated string literal (detected at line 1238)
and it takes down the whole financepy.products.bonds package (its __init__.py imports bond), plus everything that imports bonds transitively — on 3.11, 17 unit-test modules fail collection for this reason (that's how I ran into it while testing #247).
Why it slips through:
pyproject.toml declares requires-python = ">=3.10,<3.14", so pip installs happily on 3.10/3.11 where the import then fails.
run-unit-tests.yml pins a single PYTHON_VERSION: '3.13.9', so CI never exercises the older interpreters. The line came in with e38db05 (Nov 2025).
Fix options:
- Put the replacement field on one line (one-line change) — keeps 3.10/3.11 support; or
- Declare reality and bump
requires-python to >=3.12.
If you'd like option 1, happy to send the trivial PR; adding the minimum supported version to the CI matrix would keep this from regressing either way.
financepy/products/bonds/bond.pyline 1238 contains an f-string whose replacement field spans two lines:Multi-line expressions inside f-strings are a PEP 701 feature, available only on Python 3.12+. On Python 3.10 and 3.11 this is a
SyntaxErrorat import time:and it takes down the whole
financepy.products.bondspackage (its__init__.pyimportsbond), plus everything that imports bonds transitively — on 3.11, 17 unit-test modules fail collection for this reason (that's how I ran into it while testing #247).Why it slips through:
pyproject.tomldeclaresrequires-python = ">=3.10,<3.14", so pip installs happily on 3.10/3.11 where the import then fails.run-unit-tests.ymlpins a singlePYTHON_VERSION: '3.13.9', so CI never exercises the older interpreters. The line came in with e38db05 (Nov 2025).Fix options:
requires-pythonto>=3.12.If you'd like option 1, happy to send the trivial PR; adding the minimum supported version to the CI matrix would keep this from regressing either way.