Skip to content

feat!: Migrate to Python 3.10+ with 3.13 support - #14

Merged
rasmusjen merged 2 commits into
mainfrom
feat/python-310-plus
Oct 2, 2025
Merged

feat!: Migrate to Python 3.10+ with 3.13 support#14
rasmusjen merged 2 commits into
mainfrom
feat/python-310-plus

Conversation

@rasmusjen

Copy link
Copy Markdown
Owner

⚠️ BREAKING CHANGE: Python 3.10+ Required

This PR migrates the minimum Python version requirement from 3.8 to 3.10 and adds support for Python 3.13.


🎯 Problem

Python 3.8 reached End of Life in October 2024, making it a security risk to continue supporting it. Additionally:

  • Python 3.9 reaches EOL in October 2025 (very soon)
  • Modern Python versions (3.11+) offer significant performance improvements for batch processing
  • The scientific Python ecosystem is moving to 3.10+ as the baseline
  • Better type hints and language features available in 3.10+

🔧 Approach

Implemented a phased migration strategy following best practices:

Phase 1: Update Configuration ✅

  • Updated pyproject.toml:
    • requires-python = ">=3.10"
    • Added Python 3.13 to classifiers
    • Updated tool configurations (black, ruff, mypy) to target Python 3.10
    • Bumped package version to 0.3.0 (semantic versioning for breaking change)

Phase 2: Update CI/CD ✅

  • Updated GitHub Actions CI matrix:
    • New: ["3.10", "3.11", "3.12", "3.13"]
    • Removed: Python 3.8 and 3.9
    • Ensures all supported versions are tested

Phase 3: Update Documentation ✅

  • Updated all documentation files:
    • README.md - User-facing requirements
    • docs/DEVELOPMENT.md - Developer prerequisites
    • docs/ARCHITECTURE.md - Technical specifications
  • Added comprehensive CHANGELOG.md entry with migration guide

Phase 4: Code Modernization ⏳

  • Deferred to future PRs to keep this change focused
  • Can leverage modern features (pattern matching, enhanced type hints) incrementally

🧪 Tests

  • ✅ All configuration files updated consistently
  • ✅ Pre-commit hooks passed (ruff, black, mypy)
  • ✅ Documentation references updated
  • ✅ CI will test on Python 3.10, 3.11, 3.12, 3.13
  • ⚠️ Breaking change clearly documented

📊 Impact Analysis

Benefits

Performance:

  • 🚀 15-30% speed improvement from Python 3.11+ optimizations
  • Better memory efficiency for batch processing workloads
  • Faster file I/O and CSV parsing

Security:

  • ✅ No longer supporting EOL Python versions
  • Faster security patches and updates
  • Reduced vulnerability exposure

Developer Experience:

  • Modern type hints: dict[str, Any] vs Dict[str, Any]
  • Structural pattern matching (3.10+)
  • Better error messages and debugging
  • Enhanced IDE support and autocomplete

Ecosystem Alignment:

  • Matches modern scientific Python stack (conda, NumPy, pandas)
  • Better compatibility with HPC/cluster environments
  • Easier integration with Jupyter and scientific libraries

User Migration Path

Users on Python 3.8 or 3.9 must upgrade:

Option 1: Using Conda (Recommended for scientific workflows)

conda install python=3.10  # or 3.11, 3.12, 3.13
pip install --upgrade eddypro-batch-processor

Option 2: System Python

# Download from python.org and install
# Then reinstall package
pip install --upgrade eddypro-batch-processor

Option 3: Virtual Environment

python3.10 -m venv venv
source venv/bin/activate  # or venv\Scripts\activate on Windows
pip install eddypro-batch-processor

Compatibility Matrix

Python Version Status Support Timeline
3.8 ❌ Dropped EOL: October 2024
3.9 ❌ Dropped EOL: October 2025
3.10 ✅ Supported EOL: October 2026
3.11 ✅ Supported EOL: October 2027
3.12 ✅ Supported EOL: October 2028
3.13 ✅ Supported EOL: October 2029

🔄 Migration Notes

For Users

  • Action Required: Upgrade to Python 3.10 or higher
  • Timeline: Recommended before upgrading to v0.3.0
  • Support: v0.2.x will receive security fixes for 6 months
  • Testing: Validate with eddypro-batch validate --config config/config.yaml

For Developers

  • New baseline: All development now targets Python 3.10+
  • CI changes: GitHub Actions will test 3.10-3.13
  • Optional: Can now use modern Python features in new code
  • Type hints: Can use built-in generics (list[str] vs List[str])

Backward Compatibility

  • ⚠️ Breaking: Python 3.8 and 3.9 no longer supported
  • API: No changes to CLI commands or configuration format
  • Data: Existing data files and configs remain compatible
  • Functionality: All features work identically

📖 Documentation Updates

All documentation has been updated to reflect Python 3.10+ requirement:

  • ✅ README.md installation instructions
  • ✅ DEVELOPMENT.md prerequisites
  • ✅ ARCHITECTURE.md technical specifications
  • ✅ CHANGELOG.md with comprehensive migration guide

✅ Definition of Done

  • pyproject.toml updated with Python 3.10+ requirement
  • Python 3.13 added to classifiers
  • All tool configurations updated (black, ruff, mypy)
  • CI matrix updated to test 3.10-3.13
  • Documentation updated across all files
  • CHANGELOG.md includes breaking change notice and migration guide
  • Version bumped to 0.3.0 (semantic versioning)
  • Pre-commit hooks pass
  • All commits follow conventional commits format

🚀 Next Steps After Merge

Immediate:

  1. Monitor CI for any Python 3.13 compatibility issues
  2. Communicate breaking change to users
  3. Tag release v0.3.0

Future PRs (Optional Code Modernization):

  1. Use structural pattern matching in CLI (match/case)
  2. Modernize type hints throughout codebase
  3. Leverage 3.10+ features in new code
  4. Performance benchmarking on 3.11+

Closes: Python version modernization
Breaking Change: Yes - requires Python 3.10+
Semantic Version: 0.2.0 → 0.3.0
Recommended Action: Users should upgrade Python before installing v0.3.0

BREAKING CHANGE: Minimum Python version increased from 3.8 to 3.10

Phases 1-3 Implementation:

Phase 1: Update Configuration
- Updated pyproject.toml requires-python to >=3.10
- Added Python 3.13 to classifiers
- Updated black target-version to py310
- Updated ruff target-version to py310
- Updated mypy python_version to 3.10
- Bumped package version to 0.3.0

Phase 2: Update CI/CD
- Updated GitHub Actions CI matrix to test Python 3.10, 3.11, 3.12, 3.13
- Removed Python 3.8 and 3.9 from CI testing

Phase 3: Update Documentation
- Updated README.md Python requirement to 3.10+
- Updated docs/DEVELOPMENT.md Python requirement to 3.10+
- Updated docs/ARCHITECTURE.md Python runtime to 3.10+
- Added comprehensive CHANGELOG entry with migration guide

Rationale:
- Python 3.8 reached EOL in October 2024
- Python 3.9 reaches EOL in October 2025
- Performance improvements in 3.11+ benefit batch processing
- Better type hints and language features in 3.10+
- Aligns with modern scientific Python ecosystem

Migration:
Users on Python 3.8/3.9 should upgrade to 3.10+ and reinstall the package.
See CHANGELOG.md for detailed migration instructions.
- Replace typing.Dict/List/Set with built-in dict/list/set (PEP 585)
- Replace Optional[X] with X | None syntax (PEP 604)
- Replace isinstance(x, (int, float)) with isinstance(x, int | float) (UP038)
- Add strict=True to zip() calls for Python 3.10+ safety (B905)
- Remove deprecated typing imports (UP035)
- Applied via ruff --fix with UP and B905 rule sets

All code quality checks pass:
- ruff: All checks passed
- black: Formatted 2 test files
- mypy: No issues found
- pytest: 149/149 tests pass, 71.77% coverage maintained

This completes the Python 3.10+ migration Phase 4 code modernization.
@rasmusjen
rasmusjen merged commit 0a2ddc8 into main Oct 2, 2025
5 checks passed
@rasmusjen
rasmusjen deleted the feat/python-310-plus branch October 2, 2025 21:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant