Skip to content

Conversation

@g-builder-0
Copy link
Contributor

Add Django 5.x testing support

Fixes #132

Summary

This PR adds comprehensive testing support for Django 5.0, 5.1, 5.2, and the main development branch as requested in issue #132.

Changes Made

tox.ini

  • ✅ Added Django 5.0, 5.1, 5.2, and main to test environments
  • ✅ Included Python 3.10+ support for Django 5.x versions (Django 5.0+ requirement)
  • ✅ Maintained backward compatibility with Django 4.2 and Python 3.9
  • ✅ Added proper error handling for unstable Django main branch

.github/workflows/test.yml

  • ✅ Updated GitHub Actions matrix to test all new Django versions
  • ✅ Added conditional logic to handle Django 5.2 alpha installations
  • ✅ Separated stable and unstable (main) testing with appropriate error tolerance
  • ✅ Updated to latest action versions (checkout@v5, setup-python@v6)

Test Matrix Coverage

Django Version | Python Versions | Status
-- | -- | --
4.2 | 3.9, 3.10, 3.11, 3.12 | ✅ Stable
5.0 | 3.10, 3.11, 3.12, 3.13 | ✅ Stable
5.1 | 3.10, 3.11, 3.12, 3.13 | ✅ Stable
5.2 | 3.10, 3.11, 3.12, 3.13 | ✅ Alpha support
main | 3.10, 3.11, 3.12, 3.13 | ⚠️ Error tolerance

Testing

Tested locally with:

bash
tox -e py310-dj51  # Django 5.1 with Python 3.10
tox -e py312-dj52  # Django 5.2 with Python 3.12
tox -e flake8      # Code quality
tox -e isort       # Import sorting

Compatibility Notes

  • Django 5.0+ requires Python 3.10 or higher (properly handled in exclusions)
  • Django 5.2 uses alpha versions until stable release
  • Django main branch testing allows failures due to development instability
  • Backward compatibility maintained for existing Django 4.2 + Python 3.9 users
  • I have opened this pull request against master
  • I have added or modified the tests when changing logic
  • I have followed the conventional commits guidelines to add meaningful information into the changelog
  • I have read the contribution guidelines and I have joined #workgroup-pr-review on
    Slack to find a “pr review buddy” who is going to review my pull request.

- Added PyCharm and system-specific files to .gitignore
- Extended tox environments to cover Django 4.2, 5.0, 5.1, 5.2 alpha, and main branch
- Ensured flake8 and isort checks are included in tox
- Improved test matrix to run across Python 3.9–3.13
- Add Python environment and IDE-specific files
- Exclude local development artifacts
- Ensure clean repository structure
## Changes Made

- Added Django 5.0, 5.1, 5.2, and main branch to test matrix
- Included Python 3.10+ support for Django 5.x versions (requirement for Django 5.0+)
- Updated GitHub Actions workflow to handle Django 5.2 alpha installations
- Maintained backward compatibility with Django 4.2 and Python 3.9
- Added proper error handling for unstable Django main branch

## Test Matrix Coverage

- **Django 4.2**: Python 3.9, 3.10, 3.11, 3.12
- **Django 5.0**: Python 3.10, 3.11, 3.12, 3.13
- **Django 5.1**: Python 3.10, 3.11, 3.12, 3.13
- **Django 5.2**: Python 3.10, 3.11, 3.12, 3.13
- **Django main**: Python 3.10, 3.11, 3.12, 3.13 (with error tolerance)

Tested locally with `tox -e py310-dj51` and `tox -e py312-dj52`.
- Add Django 5.0, 5.1, 5.2, and main branch to test matrix
- Include Python 3.10+ support for Django 5.x compatibility
- Update GitHub Actions workflow for Django 5.2 alpha handling
- Maintain backward compatibility with Django 4.2 and Python 3.9
- Add proper error handling for unstable Django main branch

Fixes django-cms#132
@codecov
Copy link

codecov bot commented Sep 20, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 0.00%. Comparing base (d818cc4) to head (e06bb99).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files
@@          Coverage Diff           @@
##           master    #150   +/-   ##
======================================
  Coverage    0.00%   0.00%           
======================================
  Files           9       9           
  Lines         537     537           
  Branches       76      76           
======================================
  Misses        537     537           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@fsbraun
Copy link
Member

fsbraun commented Sep 20, 2025

@g-builder-0 Thanks for the PR!

I think current Django main only works with python 3.11+. Can you adjust the test matrix?

@g-builder-0
Copy link
Contributor Author

@g-builder-0 Thanks for the PR!

I think current Django main only works with python 3.11+. Can you adjust the test matrix?

Thanks for pointing that out! I will update the test matrix.

@fsbraun
Copy link
Member

fsbraun commented Sep 22, 2025

@g-builder-0 It seems I got it wrong: Django 6 starts at Python 3.12. Sorry.

Django 6 (main branch) requires Python 3.12+ minimum.
Updated both tox.ini and GitHub Actions matrix accordingly.

- Remove Python 3.11 from Django main testing
- Maintain Python 3.10+ support for Django 5.0-5.2
- Keep backward compatibility for Django 4.2

Addresses maintainer feedback in PR review.
Copy link
Member

@fsbraun fsbraun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work!

@fsbraun fsbraun merged commit 537f8d7 into django-cms:master Sep 23, 2025
25 checks passed
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.

Update tests to cover new Django versions (5.0, 5.1, main)

2 participants