feat: Python 3.11–3.14 compatibility, PEP 621 packaging, and uv CI migration#154
Open
ravenoak wants to merge 16 commits into
Open
feat: Python 3.11–3.14 compatibility, PEP 621 packaging, and uv CI migration#154ravenoak wants to merge 16 commits into
ravenoak wants to merge 16 commits into
Conversation
… for Python 3.12-3.14
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…CM fallback_version
…n CI Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Merge origin/main into python-3-12-plus-compat. Only conflict was setup.py (deleted in this branch, bumped to 3.6.0 on main) — resolved by keeping deletion since all metadata has moved to pyproject.toml. All other changes (interpretation.py docstrings, test updates, annotation function 6-arg signature support) merged automatically.
…3.12+ compat Numba 0.65.x tightened nopython type inference for list comprehensions that construct tuples from separate variables. The three affected cases in get_rule_edge_clause_grounding build edge tuples (source, target) from two string variables; replacing with empty_list + append loop resolves the TypingError on Python 3.12/3.13/3.14. Also bump actions/setup-python v4 -> v5 and astral-sh/setup-uv v3 -> v6 across CI workflows to avoid Node.js 20 deprecation breakage on June 2, 2026. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The parallel consistency test requires interpretation.py and interpretation_parallel.py to be identical except for parallel=True/False. Apply the same numba.typed.List.empty_list + append loop pattern to the three cases in get_rule_edge_clause_grounding. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Collaborator
…ba type unification on Python 3.11+ Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…3.11+ Three separate issues prevented JIT compilation of reason() on Python 3.11+: 1. Recursion limit: Python 3.11+ bytecode generates ~2300 CFG nodes for the large reason() function; Numba's recursive _dfs_rec DFS exceeded Python's default limit of 1000. Fixed by raising the limit to 5000 in __init__.py before any JIT compilation is triggered. 2. Variable type conflict: loop variable 'i' was reused across the 567-line reason() function as both int64 (range/prange loops) and a complex Tuple (enumerate loops). Python 3.11+ bytecode creates phi nodes where Numba 0.65.x can no longer unify the types. Fixed by renaming integer loop variables: facts loops use 'fi', rules-parallel loop uses 'ri', list-comprehension indices use 'j'. Same change applied to interpretation_parallel.py to keep files in sync. 3. Actions versions: bump actions/checkout v4 -> v6, actions/setup-python v4 -> v5, astral-sh/setup-uv v3 -> v6 across CI workflows to clear Node.js 20 deprecation warnings. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…mba JIT cache - Replace numba.typed.List comprehensions with explicit loops in interpretation_fp.py to fix TypingError on Python 3.12+ - Rename integer loop variable 'i' to avoid type-unification conflicts with enumerate tuple 'i' in the @numba.njit reason() function - Add actions/cache@v4 to persist Numba JIT artifacts across CI runs, keyed on Python version + script content hash (per-function hash invalidation means only changed functions recompile on cache restore) - Remove timeout-minutes from CI job so long 3.11+ JIT runs can complete Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Author
Awesome, thank you! There are some updates to the GHA workflows as well, which you can see in ravenoak#1 |
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.
Summary
numba(≥0.65.1),numpy(≥2.1,<2.5),pandas(≥2.0.0),torch(≥2.6.0), andnetworkx(≥3.1) to versions that support the full 3.10–3.14 range; added classifiers for all supported versionssetup.pyintopyproject.toml[project]table; deletedsetup.py;setuptools-scmnow lives exclusively in[build-system]with afallback_version = "0.0.0"safety nettorch,dev(pytest, ruff, pre-commit,memory_profiler), anddocs(sphinx) into[project.optional-dependencies]groups;memory_profilerimport inpyreason.pyis now guarded with a helpfulImportErrorif the profiling flag is set without the package installeduvadopted for package installation (astral-sh/setup-uv@v3); publish workflow updated withfetch-depth: 0(required for setuptools-scm tag resolution); ReadTheDocs updated to Python 3.12, ubuntu-24.04, and pip-extras install methodimportlib.metadata: Replaced deprecatedpkg_resources.get_distributionwithimportlib.metadata.versionin__init__.pyignore::UserWarningsuppression; kept targeted Numba and NetworkX filtersTest Plan
pytest tests/unit/disable_jit— 466 passed, 37 skipped, 0 faileduv pip install -e ".[dev,torch]"installs cleanly on a fresh environmentuv pip install -e ".[docs]"builds docs without errors🤖 Generated with Claude Code