Skip to content

Commit afa7734

Browse files
committed
Update tox to use the latest python versions
1 parent 9d7ca0b commit afa7734

File tree

4 files changed

+53
-50
lines changed

4 files changed

+53
-50
lines changed

.github/workflows/python-test.yml

Lines changed: 36 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ jobs:
77
format:
88
runs-on: ubuntu-latest
99
steps:
10-
- uses: actions/checkout@v2
11-
- name: Set up Python 3.7
12-
uses: actions/setup-python@v1
10+
- uses: actions/checkout@v4
11+
- name: Set up Python 3.11
12+
uses: actions/setup-python@v5
1313
with:
14-
python-version: 3.7
14+
python-version: 3.11
1515
- name: Install dependencies
1616
run: pip install tox
1717
- name: Validate formatting
@@ -23,30 +23,30 @@ jobs:
2323
max-parallel: 4
2424
matrix:
2525
tox_env:
26-
- py36-django22
27-
- py36-django30
28-
- py37-django22
29-
- py37-django30
30-
- py38-django22
31-
- py38-django30
26+
- py311-django42
27+
- py311-django52
28+
- py312-django42
29+
- py312-django52
30+
- py313-django42
31+
- py313-django52
3232
include:
33-
- python-version: 3.6
34-
tox_env: py36-django22
35-
- python-version: 3.6
36-
tox_env: py36-django30
37-
- python-version: 3.7
38-
tox_env: py37-django22
39-
- python-version: 3.7
40-
tox_env: py37-django30
41-
- python-version: 3.8
42-
tox_env: py38-django22
43-
- python-version: 3.8
44-
tox_env: py38-django30
33+
- python-version: 3.11
34+
tox_env: py311-django42
35+
- python-version: 3.11
36+
tox_env: py311-django52
37+
- python-version: 3.12
38+
tox_env: py312-django42
39+
- python-version: 3.12
40+
tox_env: py312-django52
41+
- python-version: 3.13
42+
tox_env: py313-django42
43+
- python-version: 3.13
44+
tox_env: py313-django52
4545

4646
steps:
47-
- uses: actions/checkout@v2
47+
- uses: actions/checkout@v4
4848
- name: Set up Python ${{ matrix.python-version }}
49-
uses: actions/setup-python@v1
49+
uses: actions/setup-python@v5
5050
with:
5151
python-version: ${{ matrix.python-version }}
5252
- name: Install dependencies
@@ -57,28 +57,30 @@ jobs:
5757
run: tox -e ${{ matrix.tox_env }}
5858
- name: Prepare artifacts
5959
run: mkdir .coverage-data && mv .coverage.* .coverage-data/
60-
- uses: actions/upload-artifact@master
60+
- uses: actions/upload-artifact@v4
6161
with:
62-
name: coverage-data
62+
name: coverage-data-${{ matrix.tox_env }}
63+
include-hidden-files: true
6364
path: .coverage-data/
6465

6566
coverage:
6667
runs-on: ubuntu-latest
6768
needs: [test]
6869
steps:
69-
- uses: actions/checkout@v2
70-
- uses: actions/download-artifact@master
70+
- uses: actions/checkout@v4
71+
- name: Set up Python 3.11
72+
uses: actions/setup-python@v5
7173
with:
72-
name: coverage-data
73-
path: .
74-
- name: Set up Python 3.7
75-
uses: actions/setup-python@v1
74+
python-version: 3.11
75+
- uses: actions/download-artifact@v4
7676
with:
77-
python-version: 3.7
77+
pattern: coverage-data-*
78+
path: .
79+
merge-multiple: true
7880
- name: Install dependencies
7981
run: |
8082
python -m pip install --upgrade pip
81-
pip install tox
83+
pip install tox tox-gh-actions coverage[toml]
8284
- name: Prepare Coverage report
8385
run: tox -e coverage-report
8486
- name: Upload to codecov

setup.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from setuptools import find_packages, setup
22

33
install_requires = [
4-
"Django>=1.11",
4+
"Django>=4.2",
55
"cryptography",
66
"djangorestframework",
77
"pyjwt",
@@ -13,11 +13,11 @@
1313
]
1414

1515
tests_require = [
16-
"coverage[toml]==5.0.3",
17-
"pytest==5.3.5",
18-
"pytest-django==3.8.0",
19-
"pytest-cov==2.8.1",
20-
"pytest-responses==0.4.0",
16+
"coverage[toml]==7.8.2",
17+
"pytest==8.4.0",
18+
"pytest-django==4.11.1",
19+
"pytest-cov==6.1.1",
20+
"pytest-responses==0.5.1",
2121
# Linting
2222
"isort[pyproject]==4.3.21",
2323
"flake8==3.7.9",

tests/urls.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from django.conf.urls import url
1+
from django.urls import path
22
from rest_framework.decorators import api_view, authentication_classes
33
from rest_framework.response import Response
44

@@ -11,4 +11,4 @@ def sample_view(request):
1111
return Response({"hello": "world"})
1212

1313

14-
urlpatterns = [url(r"^$", sample_view, name="sample_view")]
14+
urlpatterns = [path("", sample_view, name="sample_view")]

tox.ini

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,32 @@
11
[tox]
2-
envlist = py{36,37,38}-django{22,30}
2+
envlist = py{311,312,312}-django{42,52}
33

44

55
[gh-actions]
66
python =
7-
3.6: py36
8-
3.7: py37
9-
3.8: py38
7+
3.11: py311
8+
3.12: py312
9+
3.13: py313
1010

1111
[testenv]
1212
commands = coverage run --source django_cognito_jwt --parallel -m pytest {posargs}
1313
deps =
14-
django22: Django>=2.2,<2.3
15-
django30: Django>=3.0,<3.1
14+
django42: Django>=4.2,<4.3
15+
django52: Django>=5.2,<5.3
1616
extras = test
1717

1818
[testenv:coverage-report]
19-
basepython = python3.7
19+
basepython = python3.11
2020
deps = coverage[toml]
2121
skip_install = true
22+
ignore_errors = true
2223
commands =
2324
coverage combine
2425
coverage xml
2526
coverage report
2627

2728
[testenv:format]
28-
basepython = python3.7
29+
basepython = python3.11
2930
deps =
3031
black
3132
isort[toml]

0 commit comments

Comments
 (0)