Skip to content

Conversation

rahlk
Copy link
Contributor

@rahlk rahlk commented Jul 14, 2025

Motivation and Context

This change addresses a critical backwards compatibility issue where the package unnecessarily required Python 3.12+ as highlighted in issue #13, blocking adoption for users on Python 3.10/3.11 environments. After comprehensive code analysis, no Python 3.11+ or 3.12+ specific features were found in the codebase, making the stricter version requirement unjustified.

The change also includes a major refactoring of the core class from AnalyzerCore to Codeanalyzer to provide better library naming consistency and enable direct library imports.

How Has This Been Tested?

  • ✅ Verified all Python features used (ast.unparse(), built-in generics, type hints) are compatible with Python 3.10
  • ✅ Confirmed no Python 3.11+ features (ExceptionGroup, TaskGroup, tomllib, match/case, Self types) are used
  • ✅ Validated all dependencies support Python 3.10+
  • ✅ Tested CLI functionality remains intact after class rename
  • ✅ Verified library import works: from codeanalyzer import Codeanalyzer
  • ✅ Created and tested sample library usage script

Breaking Changes

  • BREAKING: Renamed AnalyzerCore class to Codeanalyzer - users importing the class directly will need to update their imports
  • BREAKING: Changed Python version requirement from >=3.12 to ==3.10 - this actually improves compatibility but is technically a breaking change in version specification
  • CLI usage remains unchanged and backward compatible

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the Codellm-Devkit Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

Additional context

Key Changes:

  1. Class Rename: AnalyzerCoreCodeanalyzer for better naming consistency
  2. Library Interface: Added direct import capability: from codeanalyzer import Codeanalyzer
  3. Python Compatibility: Downgraded requirement from >=3.12 to ==3.10 for backwards compatibility
  4. Documentation: Updated changelog, created bug report, and updated all references

Impact:

  • High Impact: Enables adoption for Python 3.10 users (enterprise environments, CI/CD systems)
  • Medium Impact: Provides cleaner library interface for programmatic usage
  • Low Risk: All functionality preserved, only naming and compatibility improvements

Files Changed:

  • core.py - Renamed class and updated type hints
  • main.py - Updated imports and usage
  • init.py - Added library exports
  • pyproject.toml - Updated Python version and bumped to 0.2.1
  • CHANGELOG.md - Documented all changes
  • BUG_REPORT_PYTHON_DOWNGRADE.md - Created comprehensive bug analysis

This release significantly improves the package's accessibility while maintaining all existing functionality.

Signed-off-by: Rahul Krishna <i.m.ralk@gmail.com>
@rahlk rahlk added the bug Something isn't working label Jul 14, 2025
Signed-off-by: Rahul Krishna <i.m.ralk@gmail.com>
@rahlk rahlk merged commit 1b79092 into main Jul 14, 2025
@rahlk rahlk deleted the 13-bug-report-python-version-downgrade-for-backwards-compatibility branch July 14, 2025 16:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant