Skip to content

fix(py39): restore Python 3.9 import + optional numpy (v0.7.0 release hotfix)#11

Merged
lavs9 merged 1 commit into
mainfrom
fix/py39-release-hotfix
Jul 13, 2026
Merged

fix(py39): restore Python 3.9 import + optional numpy (v0.7.0 release hotfix)#11
lavs9 merged 1 commit into
mainfrom
fix/py39-release-hotfix

Conversation

@lavs9

@lavs9 lavs9 commented Jul 13, 2026

Copy link
Copy Markdown
Owner

Release recovery for v0.7.0. The tag's wheel-smoke failed on CPython 3.9:

TypeError: unsupported operand type(s) for |: 'type' and 'NoneType'
  quantwave/__init__.py:205  def __init__(self, slug: str, polars_method: str | None)

__init__.py used a runtime PEP 604 union (str | None) without from __future__ import annotations — PEP 604 at runtime is 3.10+. Fix: add the future import (all annotations become lazy strings). Also make numpy lazy in quantwave.talib so import quantwave / list_functions() work without numpy.

State: crates.io already published 0.7.0 (Rust job ✓); PyPI did not (gated on smoke). After merge I'll re-tag v0.7.0 on the fixed commit — publish_crates.sh is idempotent (skips already-published crates), so the rebuilt wheel publishes to PyPI cleanly.

Verified on Python 3.9.19: wheel_smoke_test passes without numpy; talib.RSI works with numpy; talib.list_functions()=161.

🤖 Generated with Claude Code

The v0.7.0 release wheel-smoke failed on CPython 3.9: quantwave/__init__.py used
a runtime PEP 604 annotation (`str | None` in _PolarsOnlySurface.__init__) without
`from __future__ import annotations`, so `import quantwave` raised
`TypeError: unsupported operand type(s) for |` on 3.9 (PEP 604 is 3.10+). Add the
future import so all annotations are lazy strings.

Also make numpy lazy in quantwave.talib (imported inside the wrappers, not at module
top), so `import quantwave` and talib.list_functions() work without numpy; calling a
talib function still requires numpy (classic array API).

Verified on Python 3.9.19: wheel_smoke_test passes without numpy; talib.RSI works
with numpy; talib.list_functions()=161.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@lavs9 lavs9 merged commit 59f92d4 into main Jul 13, 2026
6 checks passed
@lavs9 lavs9 deleted the fix/py39-release-hotfix branch July 13, 2026 16:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant