Skip to content

Upgrade Python Support to 3.13 - #163

Open
BAF1927 wants to merge 8 commits into
mainfrom
Bruno-Pyreason-Pyton-Update
Open

BAF1927 wants to merge 8 commits into
mainfrom
Bruno-Pyreason-Pyton-Update

Conversation

@BAF1927

@BAF1927 BAF1927 commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Python 3.10 → Python 3.12
Changing the Python version alone is not enough. On 3.12, import fails (pkg_resources), and Numba cannot compile typed-list comprehensions used in pending-rule filtering and neighbor edge grounding. Those need small engine syntax fixes; a Numba bump alone does not fix them.

What this PR changes
pyreason/init.py: importlib.metadata; skip cache init under tests
interpretation.py / _fp / _parallel: replace failing typed-list comprehensions with explicit loops
setup.py + CI + docs: Python 3.12 only, keep numba==0.59.1 / numpy==1.26.4

@BAF1927

BAF1927 commented Sep 8, 2026

Copy link
Copy Markdown
Contributor Author

Initial testing failed with time efficiency. Not Ready Yet for Implementation to main

BAF1927 and others added 7 commits September 8, 2026 15:20
Bring forward the upstream 3.11-3.13 packaging, CI, docs, importlib.metadata
init path, Numba pending-rule filter helpers, and edge-grounding loop fixes
while keeping current main semantics including the clause-satisfaction hoist.
Node rules leave edges_to_be_added_node_rule empty. The compatibility
helpers indexed that list for every retained node rule, raising IndexError
when a rule was still waiting to fire. This breaks both two-timestep delays
and one-timestep delays combined with a zero-timestep rule.

Filter the edge list independently in all three engines, restoring the
previous behavior while retaining the explicit loops needed by Numba.
Keep pending node rules and their optional trace entries aligned.

Add compiled helper tests for retaining all, some, or none of the rules,
with tracing enabled and disabled. Add serial and parallel API regressions
that verify delayed results, immediate results, and the recorded traces.

Validation:
- Before the fix: 12 helper cases and 4 serial API cases failed.
- Python 3.13: 194 JIT-enabled unit tests passed; classifier tests excluded
  because this environment lacks PyTorch.
- Python 3.13: 466 JIT-disabled unit tests passed, 37 skipped.
- Python 3.13: all 8 serial and parallel API regressions passed.
- Python 3.10: all 18 new helper cases and engine consistency check passed.
- Ruff 0.15.22 and git diff --check passed.
@ColtonPayne ColtonPayne changed the title Pyreason with Python 3.12 Upgrade Python Support to 3.13 Oct 17, 2026
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.

2 participants