Skip to content

Commit 537f8d7

Browse files
authored
Add Django 5.x testing support (#150)
* chore: update .gitignore and tox configuration - 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 * chore: Update .gitignore for Django project - Add Python environment and IDE-specific files - Exclude local development artifacts - Ensure clean repository structure * Fixes #132 ## 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`. * feat: add Django 5.x testing support - 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 #132 * fix: restrict Django main to Python 3.11+ as requested * fix: restrict Django main to Python 3.12+ only 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.
1 parent 00d491f commit 537f8d7

File tree

3 files changed

+21
-42
lines changed

3 files changed

+21
-42
lines changed

.github/workflows/test.yml

Lines changed: 16 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ jobs:
99
strategy:
1010
fail-fast: false
1111
matrix:
12-
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
13-
django-version: ['4.2', '5.0', '5.1']
12+
python-version: ['3.9','3.10', '3.11', '3.12', '3.13']
13+
django-version: ['4.2', '5.0', '5.1', '5.2', 'main']
1414
os: [
1515
ubuntu-latest,
1616
]
@@ -19,44 +19,14 @@ jobs:
1919
django-version: '5.0'
2020
- python-version: '3.9'
2121
django-version: '5.1'
22+
- python-version: '3.9'
23+
django-version: '5.2'
24+
- python-version: '3.9'
25+
django-version: 'main'
2226
- python-version: '3.10'
23-
django-version: '5.0'
24-
- python-version: '3.10'
25-
django-version: '5.1'
26-
27-
steps:
28-
- uses: actions/checkout@v5
29-
- name: Set up Python ${{ matrix.python-version }}
30-
31-
uses: actions/setup-python@v6
32-
with:
33-
python-version: ${{ matrix.python-version }}
34-
- name: Install dependencies
35-
run: |
36-
python -m pip install --upgrade pip
37-
pip install -U Django==${{ matrix.django-version }} coverage setuptools
38-
python setup.py install
39-
40-
- name: Run coverage
41-
run: coverage run tests/settings.py
42-
43-
- name: Upload Coverage to Codecov
44-
uses: codecov/codecov-action@v5
45-
46-
47-
unit-tests-future-versions:
48-
# Runs for all Django/Python versions which are not yet supported
49-
runs-on: ${{ matrix.os }}
50-
strategy:
51-
fail-fast: false
52-
matrix:
53-
python-version: ['3.12', '3.13']
54-
django-version: [
55-
'https://github.com/django/django/archive/main.tar.gz'
56-
]
57-
os: [
58-
ubuntu-latest,
59-
]
27+
django-version: 'main'
28+
- python-version: '3.11'
29+
django-version: 'main'
6030

6131
steps:
6232
- uses: actions/checkout@v5
@@ -68,12 +38,17 @@ jobs:
6838
- name: Install dependencies
6939
run: |
7040
python -m pip install --upgrade pip
71-
pip install ${{ matrix.django-version }} coverage setuptools
41+
if [ "${{ matrix.django-version }}" = "5.2" ]; then
42+
pip install -U "Django>=5.2a,<6.0" coverage setuptools
43+
elif [ "${{ matrix.django-version }}" = "main" ]; then
44+
pip install -U https://github.com/django/django/archive/main.tar.gz coverage setuptools
45+
else
46+
pip install -U Django==${{ matrix.django-version }} coverage setuptools
47+
fi
7248
python setup.py install
7349
7450
- name: Run coverage
7551
run: coverage run tests/settings.py
76-
continue-on-error: true
7752

7853
- name: Upload Coverage to Codecov
7954
uses: codecov/codecov-action@v5

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,5 @@ env/
2020
/*docs/_build*/
2121

2222
local.sqlite
23+
/.venv312/
24+
/project-structure.txt

tox.ini

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ envlist =
33
flake8
44
isort
55
py{39,310,311,312}-dj42
6-
py{311,312,313}-dj{50,51,52,main}
6+
py{310,311,312,313}-dj{50,51,52}
7+
py{312,313}-djmain
78

89
skip_missing_interpreters=True
910

@@ -28,6 +29,7 @@ ignore_errors =
2829
[testenv:flake8]
2930
deps = flake8
3031
commands = flake8
32+
skip_install = true
3133

3234
[testenv:isort]
3335
deps = isort

0 commit comments

Comments
 (0)