-
Notifications
You must be signed in to change notification settings - Fork 29
Open
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:
StrEnum
fromenum
moduleassert_never
fromtyping
module
Affected Files
chatkit/errors.py:2
-from enum import StrEnum
chatkit/agents.py:13
-assert_never
import in typing importschatkit/server.py
-assert_never
import (inferred from test output)
Metadata
Metadata
Assignees
Labels
No labels