Describe the Bug
Running python3 -m dynamo.frontend --help fails with an ImportError because dynamo/common/configuration/config_base.py imports Self directly from typing, which was only added in Python 3.11. Python 3.10 does not include typing.Self.
Steps to Reproduce
conda create -n myenv python=3.10
conda activate myenv
pip install -e .
python3 -m dynamo.frontend --help
Expected Behavior
Output the help info.
Actual Behavior
Environment
- OS: Rocky Linux 9.7.0 (x86_64)
- Python: 3.10.x (CPython, conda env)
- dynamo version: latest main
Additional Context
Root cause
typing.Self was introduced in Python 3.11 (PEP 673). The import in config_base.py should fall back to typing_extensions for Python < 3.11.
# components/src/dynamo/common/configuration/config_base.py
import sys
if sys.version_info >= (3, 11):
from typing import Self
else:
from typing_extensions import Self
Describe the Bug
Running
python3 -m dynamo.frontend --helpfails with anImportErrorbecausedynamo/common/configuration/config_base.pyimportsSelfdirectly fromtyping, which was only added in Python 3.11. Python 3.10 does not includetyping.Self.Steps to Reproduce
Expected Behavior
Output the help info.
Actual Behavior
Environment
Additional Context
Root cause
typing.Selfwas introduced in Python 3.11 (PEP 673). The import inconfig_base.pyshould fall back totyping_extensionsfor Python < 3.11.