-
Notifications
You must be signed in to change notification settings - Fork 72
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Summary: The project is set up to support Python ≥3.10 in pyproject.toml but uses Python 3.11+ exclusive features, causing import errors when running tests on Python 3.10.
Environment
- Python Version: 3.10.16
- Package Manager: uv 0.7.19
- OS: Linux
Steps to Reproduce
-
Set up Python 3.10 environment:
uv venv --python 3.10 uv sync uv pip install -e . -
Run tests:
uv run pytest tests/ -v
Expected Behavior
Tests should run successfully on Python 3.10 as specified in requires-python = ">=3.10".
Actual Behavior
Tests fail with import errors for Python 3.11+ features:
ImportError: cannot import name 'assert_never' from 'typing'
ImportError: cannot import name 'StrEnum' from 'enum'
Root Cause
Two incompatible imports using features added in Python 3.11:
StrEnumfromenummoduleassert_neverfromtypingmodule
Affected Files
chatkit/errors.py:2-from enum import StrEnumchatkit/agents.py:13-assert_neverimport in typing importschatkit/server.py-assert_neverimport (inferred from test output)
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working