Skip to content

Python 3.10 Compatibility Issue #12

Closed

Description

@ekzhu

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

  1. Set up Python 3.10 environment:

    uv venv --python 3.10
    uv sync
    uv pip install -e .
  2. 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 from enum module
  • assert_never from typing module

Affected Files

  • chatkit/errors.py:2 - from enum import StrEnum
  • chatkit/agents.py:13 - assert_never import in typing imports
  • chatkit/server.py - assert_never import (inferred from test output)

Activity

  1. weedon-openai commented on Oct 9, 2025

    @weedon-openai
    Contributor

    Thanks, for flagging. Will fix!

  2. ekzhu commented on Oct 17, 2025

    @ekzhu
    Author

    @weedon-openai, when can we expect the fix to be released?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions