diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4f9fac5..35f9682 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -65,7 +65,8 @@ jobs: - name: typecheck — mypy run: mypy src/roar_sdk/ --ignore-missing-imports working-directory: python - - run: pytest tests/conformance/ -v + - name: conformance tests + run: pytest tests/test_conformance*.py -v working-directory: . - name: cross-SDK interop tests run: pytest tests/test_cross_sdk_interop.py -v diff --git a/python/src/roar_sdk/_compat.py b/python/src/roar_sdk/_compat.py index d987f74..e10a030 100644 --- a/python/src/roar_sdk/_compat.py +++ b/python/src/roar_sdk/_compat.py @@ -1,11 +1,10 @@ -# Python 3.10 compatibility shim for StrEnum (added in 3.11) -try: - from enum import StrEnum -except ImportError: - from enum import Enum +"""Compatibility helpers for Python version differences.""" - class StrEnum(str, Enum): # type: ignore[no-redef] - """Backport of Python 3.11 StrEnum for Python 3.10.""" +from enum import Enum - def __str__(self) -> str: - return self.value + +class StrEnum(str, Enum): + """Lightweight StrEnum backport for consistent typing on Python 3.10+.""" + + def __str__(self) -> str: + return self.value