Skip to content

Commit

Permalink
Upgrade build matrix to support Django 5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
hugorodgerbrown committed Nov 14, 2023
1 parent c46a804 commit c031da8
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 14 deletions.
48 changes: 41 additions & 7 deletions .github/workflows/tox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,38 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
toxenv: [fmt,lint,mypy]
toxenv: [fmt, lint, mypy]
env:
TOXENV: ${{ matrix.toxenv }}

steps:
- name: Check out the repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up Python 3.11
- name: Set up Python (3.11)
uses: actions/setup-python@v4
with:
python-version: "3.11"

- name: Install and run tox
run: |
pip install tox
tox
checks:
name: Run Django checks
runs-on: ubuntu-latest
strategy:
matrix:
toxenv: ["django-checks"]
env:
TOXENV: ${{ matrix.toxenv }}

steps:
- name: Check out the repository
uses: actions/checkout@v4

- name: Set up Python (3.11)
uses: actions/setup-python@v4
with:
python-version: "3.11"
Expand All @@ -37,20 +60,31 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python: ["3.8", "3.9", "3.10", "3.11"]
django: ["32", "40", "41", "42", "main"]
python: ["3.8", "3.9", "3.10", "3.11", "3.12"]
# build LTS version, next version, HEAD
django: ["32", "42", "50", "main"]
exclude:
- python: "3.8"
django: "50"
- python: "3.8"
django: "main"
- python: "3.9"
django: "50"
- python: "3.9"
django: "main"
- python: "3.10"
django: "main"
- python: "3.11"
django: "32"
- python: "3.12"
django: "32"

env:
TOXENV: py${{ matrix.python }}-django${{ matrix.django }}
TOXENV: django${{ matrix.django }}-py${{ matrix.python }}

steps:
- name: Check out the repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v4
Expand Down
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,14 @@ classifiers = [
"Framework :: Django :: 4.0",
"Framework :: Django :: 4.1",
"Framework :: Django :: 4.2",
"Framework :: Django :: 5.0",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
]
packages = [{ include = "request_token" }]

Expand All @@ -33,7 +35,6 @@ pyjwt = "^2.0"
black = "*"
coverage = "*"
ruff = "*"
freezegun = "*"
mypy = "*"
pre-commit = "*"
pytest = "*"
Expand Down
16 changes: 10 additions & 6 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@ isolated_build = True
envlist =
fmt, lint, mypy,
django-checks,
py38-django{32,40,41,42}
py39-django{32,40,41,42}
py310-django{32,40,41,42,main}
py311-django{32,40,41,42,main}
; https://docs.djangoproject.com/en/5.0/releases/
django32-py{38,39,310}
django40-py{38,39,310}
django41-py{38,39,310,311}
django42-py{38,39,310,311}
django50-py{310,311,312}
djangomain-py{311,312}

[testenv]
deps =
Expand All @@ -18,12 +21,13 @@ deps =
django40: Django>=4.0,<4.1
django41: Django>=4.1,<4.2
django42: Django>=4.2,<4.3
django50: https://github.com/django/django/archive/stable/5.0.x.tar.gz
djangomain: https://github.com/django/django/archive/main.tar.gz

commands =
pytest --cov=request_token tests/
pytest --cov=request_token --verbose tests/

[testenv:checks]
[testenv:django-checks]
description = Django system checks and missing migrations
deps = Django
commands =
Expand Down

0 comments on commit c031da8

Please sign in to comment.