Repository navigation
v2.3.1
A hotfix release. import okama raised TypeError on Python 3.11, 3.12 and 3.13 —
every supported version except 3.14 — which made releases v2.2.3, v2.2.4 and v2.3.0
unusable for most users. The release also adds a continuous integration test matrix
so this class of breakage cannot reach PyPI again.
Fixed
Frame.get_portfolio_mean_return()andFrame.get_portfolio_risk()annotated their
weightsparameter aslist | np.array.np.arrayis a factory function rather than
a type, so the PEP 604|operator raised
TypeError: unsupported operand type(s) for |: 'type' and 'builtin_function_or_method'.
Python evaluates annotations eagerly before 3.14, so the error was raised while
importingokama.common.helpers.helpersand brokeimport okamaoutright on
Python 3.11–3.13. Python 3.14 defers annotation evaluation (PEP 649), which is why the
bug stayed invisible during development. Both annotations now usenp.ndarray.
Reported and fixed by @nervgh in
#95.
Tooling
- The unit test suite now runs in CI on every supported Python version (3.11, 3.12, 3.13,
3.14) on each push and pull request. Previously only ruff and CodeQL ran automatically,
and no test was ever executed on the minimum supported Python — which is how the import
failure above shipped through three releases. - The release workflow now requires a full unit-test run on the minimum supported Python
before any version bump.