fix(py39): restore Python 3.9 import + optional numpy (v0.7.0 release hotfix)#11
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Release recovery for v0.7.0. The tag's wheel-smoke failed on CPython 3.9:
__init__.pyused a runtime PEP 604 union (str | None) withoutfrom __future__ import annotations— PEP 604 at runtime is 3.10+. Fix: add the future import (all annotations become lazy strings). Also makenumpylazy inquantwave.talibsoimport 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.0on the fixed commit —publish_crates.shis idempotent (skips already-published crates), so the rebuilt wheel publishes to PyPI cleanly.Verified on Python 3.9.19:
wheel_smoke_testpasses without numpy;talib.RSIworks with numpy;talib.list_functions()=161.🤖 Generated with Claude Code