Skip to content

Pin python version for teyit hook - #11735

Merged
SchrodingersGat merged 1 commit into
inventree:masterfrom
hartigdan:pin-python-version-for-teyit-hook
Apr 12, 2026
Merged

SchrodingersGat merged 1 commit into
inventree:masterfrom
hartigdan:pin-python-version-for-teyit-hook

Conversation

@hartigdan

Copy link
Copy Markdown
Contributor

Pre-Commit hooks fail for me since teyit uses an internal CPython API which only existed up to (including) python version 3.12. Here's the trace:

teyit....................................................................Failed
- hook id: teyit
- exit code: 1

Traceback (most recent call last):
  File "/home/daniel/.cache/pre-commit/repokwvueu6g/py_env-python3/bin/teyit", line 5, in <module>
    from teyit import main
  File "/home/daniel/.cache/pre-commit/repokwvueu6g/py_env-python3/lib/python3.14/site-packages/teyit.py", line 12, in <module>
    from refactor.ast import PreciseUnparser
  File "/home/daniel/.cache/pre-commit/repokwvueu6g/py_env-python3/lib/python3.14/site-packages/refactor/__init__.py", line 4, in <module>
    from refactor.actions import *
  File "/home/daniel/.cache/pre-commit/repokwvueu6g/py_env-python3/lib/python3.14/site-packages/refactor/actions.py", line 9, in <module>
    from refactor.ast import split_lines
  File "/home/daniel/.cache/pre-commit/repokwvueu6g/py_env-python3/lib/python3.14/site-packages/refactor/ast.py", line 110, in <module>
    class BaseUnparser(ast._Unparser):  # type: ignore
                       ^^^^^^^^^^^^^
AttributeError: module 'ast' has no attribute '_Unparser'. Did you mean: 'unparse'?

Also see: isidentical/teyit#23 Unfortunately, it seems that development on teyit has come to a standstill. So there is no fix.

I've pinned the python version for teyit to 3.11 since this is the version used in the corresponding github workflow. Hopefully this helps other devs who run into the same issue.

teyit fails with python versions >= 3.12
see isidentical/teyit#23
@netlify

netlify Bot commented Apr 12, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for inventree-web-pui-preview canceled.

Name Link
🔨 Latest commit 2021ebb
🔍 Latest deploy log https://app.netlify.com/projects/inventree-web-pui-preview/deploys/69dbebe94495080008c33cab

@SchrodingersGat SchrodingersGat added the dependency Relates to a project dependency label Apr 12, 2026
@SchrodingersGat SchrodingersGat modified the milestones: 1.3.1, 1.4.0 Apr 12, 2026
@SchrodingersGat
SchrodingersGat merged commit 8e73a22 into inventree:master Apr 12, 2026
28 checks passed
@SchrodingersGat

Copy link
Copy Markdown
Member

@hartigdan thanks for the fix

martonmiklos pushed a commit to martonmiklos/InvenTree that referenced this pull request Jun 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependency Relates to a project dependency

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants