Просмотр исходного кода

Add tests and update CHANGELOG for Python 3.10+ requirement

Co-authored-by: ChristianLempa <28359525+ChristianLempa@users.noreply.github.com>
copilot-swe-agent[bot] 1 месяц назад
Родитель
Сommit
8d0d045a10
2 измененных файлов с 37 добавлено и 0 удалено
  1. 4 0
      CHANGELOG.md
  2. 33 0
      tests/test_module_imports.py

+ 4 - 0
CHANGELOG.md

@@ -10,6 +10,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
 ### Changed
 - Dependency update: typer to v0.21.1 (#1627)
 
+### Fixed
+- Python 3.10+ requirement enforcement - Install script now validates Python version and provides clear upgrade instructions for AlmaLinux/RHEL 9 users
+- Python 3.9 compatibility - Added `from __future__ import annotations` to compose module to support union type syntax on Python 3.9+ (requires Python 3.10+ at runtime)
+
 ## [0.1.3] - 2026-01-06
 
 ### Added

+ 33 - 0
tests/test_module_imports.py

@@ -0,0 +1,33 @@
+"""Test that all modules can be imported successfully."""
+
+import sys
+
+from cli.core.module import Module
+from cli.core.registry import registry
+from cli.core.template import Template
+from cli.core.template.variable import Variable
+from cli.modules.compose import ComposeModule
+
+
+def test_compose_module_import():
+    """Test that compose module imports without errors."""
+    # This test verifies the fix for Python 3.9 compatibility issue
+    # where union type syntax (str | None) caused import errors
+    assert ComposeModule is not None
+    assert ComposeModule.name == "compose"
+
+
+def test_all_modules_import():
+    """Test that all core modules can be imported."""
+    # Test core modules
+    assert Module is not None
+    assert registry is not None
+    assert Template is not None
+    assert Variable is not None
+
+
+def test_python_version_requirement():
+    """Test that we're running on Python 3.10+."""
+    assert sys.version_info >= (3, 10), (
+        f"Python 3.10+ is required, but running {sys.version_info.major}.{sys.version_info.minor}"
+    )