← Back to issue list

Incompatibility with python 3.13

View original Github issue

Metadata

Project
craft-grammar
Number
#81
Type
issue
State
closed
Author
upils
Labels
—
Created
Updated
Closed

Current evaluation

Python 3.13 incompatibility was fixed in merged PR #82, which validates the generic type's origin before calling issubclass.

Resolution: closed resolved

Reason: PR #82 was merged and resolved the issue in commit aea0ab4. The change uses the generic type's origin for grammar-list validation, avoiding Python 3.13's TypeError from passing a type variable to issubclass.

Evaluated by: mr-cal-bot

No scores available.

Issue body

craft-grammar is incompatible with python 3.13. I understand this is due to using `issubclass` with a type variable types here https://github.com/canonical/craft-grammar/blob/main/craft_grammar/models.py#L124 The error: ``` TypeError: issubclass() arg 1 must be a class ``` I understand it should have never worked and it was fixed in python 3.13 (see https://github.com/python/cpython/issues/101162) To reproduce: ``` uv lock UV_PYTHON=3.13 uv sync --all-extras UV_PYTHON=3.13 uv run pytest ``` Also see imagecraft's test https://github.com/canonical/imagecraft/actions/runs/13788632594/job/38562506196?pr=96

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed resolved Python 3.13 incompatibility was fixed in merged PR #82, which validates the generic type's origin before calling issubclass.
stealth/space-bunny-alpha — closed resolved Fixed in PR #82 via commit aea0ab4 by validating the generic type's origin before calling issubclass, restoring Python 3.13 compatibility.
stealth/space-bunny-alpha — closed resolved Python 3.13 compatibility was restored by merged PR #82 (commit aea0ab4), which now uses the generic type's origin before issubclass validation.
qwen/qwen3.6-35b-a3b — — Closed without resolution or linked pull request. The Python 3.13 incompatibility stemming from issubclass usage with type variables remains unfixed, indicating the report was abandoned or closed as invalid.
qwen/qwen3.6-35b-a3b — — Closed. The Python 3.13 incompatibility caused by issubclass usage with type variables was resolved by updating the code to comply with stricter type checking rules.
qwen/qwen3.6-35b-a3b — — Closed without resolution or comments. The Python 3.13 issubclass incompatibility was abandoned or superseded by the upstream CPython fix.

Update history

No update history recorded yet.

Related work

  • Likely Fixed By: canonical/craft-grammar#82 (confidence 100%)

    Merged fix for Python 3.13 compatibility, implemented in commit aea0ab4.

Related issues

No related issues found above the similarity threshold.