Skip to content

Commit 8e0bc30

Browse files
committed
Add Python 3.11 support and rearrage CI suite
1 parent a23c2f8 commit 8e0bc30

File tree

2 files changed

+109
-70
lines changed

2 files changed

+109
-70
lines changed

.github/workflows/ci.yml

Lines changed: 107 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,6 @@ on:
88

99
jobs:
1010

11-
dist:
12-
runs-on: ubuntu-latest
13-
steps:
14-
- uses: actions/checkout@v3
15-
- uses: actions/setup-python@v4
16-
with:
17-
python-version: "3.10"
18-
- run: sudo apt install gettext -y
19-
- run: python -m pip install --upgrade pip build wheel twine
20-
- run: make gettext
21-
- run: python -m build --sdist --wheel
22-
- run: python -m twine check dist/*
23-
- uses: actions/upload-artifact@v3
24-
with:
25-
path: dist/*
26-
2711
lint:
2812
runs-on: ubuntu-latest
2913
strategy:
@@ -38,82 +22,136 @@ jobs:
3822
- uses: actions/checkout@v3
3923
- uses: actions/setup-python@v4
4024
with:
41-
python-version: "3.10"
25+
python-version: "3.x"
4226
cache: 'pip'
4327
cache-dependency-path: 'linter-requirements.txt'
4428
- run: python -m pip install -r linter-requirements.txt
4529
- run: ${{ matrix.lint-command }}
4630

47-
pytest:
31+
dist:
32+
runs-on: ubuntu-latest
33+
steps:
34+
- uses: actions/checkout@v3
35+
- uses: actions/setup-python@v4
36+
with:
37+
python-version: "3.x"
38+
- run: sudo apt install gettext -y
39+
- run: python -m pip install --upgrade pip build wheel twine
40+
- run: make gettext
41+
- run: python -m build --sdist --wheel
42+
- run: python -m twine check dist/*
43+
- uses: actions/upload-artifact@v3
44+
with:
45+
path: dist/*
46+
47+
pytest-os:
48+
name: PyTest
4849
needs:
4950
- lint
5051
strategy:
5152
matrix:
5253
os:
5354
- "ubuntu-latest"
55+
- "macos-latest"
56+
- "windows-latest"
57+
runs-on: ${{ matrix.os }}
58+
steps:
59+
- uses: actions/checkout@v3
60+
- name: Set up Python ${{ matrix.python-version }}
61+
uses: actions/setup-python@v4
62+
with:
63+
python-version: "3.x"
64+
- run: python -m pip install .[test]
65+
- run: python -m pytest
66+
- uses: codecov/codecov-action@v3
67+
with:
68+
flags: ${{ matrix.os }}
69+
70+
pytest-python:
71+
name: PyTest
72+
needs:
73+
- lint
74+
strategy:
75+
matrix:
5476
python-version:
77+
- "3.8"
78+
- "3.9"
5579
- "3.10"
5680
django-version:
5781
- "3.2" # LTS
58-
- "4.0"
59-
- "4.1"
60-
extras:
61-
- "test"
6282
include:
63-
- os: "ubuntu-latest"
64-
python-version: "3.8"
83+
- python-version: "3.11" # only Django 4.1+ supports Python 3.11
6584
django-version: "4.1"
66-
extras: "test"
67-
- os: "ubuntu-latest"
68-
python-version: "3.9"
69-
django-version: "4.1"
70-
extras: "test"
71-
- os: "macos-latest"
72-
python-version: "3.10"
73-
django-version: "3.2"
74-
extras: "test"
75-
- os: "windows-latest"
76-
python-version: "3.10"
77-
django-version: "3.2"
78-
extras: "test"
79-
- os: "ubuntu-latest"
80-
python-version: "3.10"
81-
django-version: "3.2"
82-
extras: "test,dramatiq"
83-
- os: "ubuntu-latest"
84-
python-version: "3.10"
85-
django-version: "3.2"
86-
extras: "test,celery"
87-
- os: "ubuntu-latest"
88-
python-version: "3.10"
89-
django-version: "3.2"
90-
extras: "test,drf"
91-
- os: "ubuntu-latest"
92-
python-version: "3.10"
93-
django-version: "3.2"
94-
extras: "test,cleanup"
85+
runs-on: ubuntu-latest
86+
steps:
87+
- uses: actions/checkout@v3
88+
- name: Set up Python ${{ matrix.python-version }}
89+
uses: actions/setup-python@v4
90+
with:
91+
python-version: ${{ matrix.python-version }}
92+
- run: python -m pip install .[test]
93+
- run: python -m pip install django~=${{ matrix.django-version }}.0
94+
- run: python -m pytest
95+
- uses: codecov/codecov-action@v3
96+
with:
97+
flags: py${{ matrix.python-version }}
9598

96-
runs-on: ${{ matrix.os }}
99+
pytest-django:
100+
name: PyTest
101+
needs:
102+
- lint
103+
strategy:
104+
matrix:
105+
python-version:
106+
- "3.10" # only Django 4.1+ supports Python 3.11
107+
django-version:
108+
# LTS gets tested on all OS
109+
- "4.0"
110+
- "4.1"
111+
runs-on: ubuntu-latest
97112
steps:
98-
- uses: actions/checkout@v3
99-
- name: Set up Python ${{ matrix.python-version }}
100-
uses: actions/setup-python@v4
101-
with:
102-
python-version: ${{ matrix.python-version }}
103-
- name: Install redis
104-
if: matrix.os == 'ubuntu-latest'
105-
run: sudo apt-get install -y redis-server
106-
- run: python -m pip install .[${{ matrix.extras }}]
107-
- run: python -m pip install django~=${{ matrix.django-version }}.0
108-
- run: python -m pytest
109-
- uses: codecov/codecov-action@v3
110-
with:
111-
flags: ${{ matrix.os }}-py${{ matrix.python-version }}-dj${{ matrix.django-version }}-${{ matrix.extras }}
113+
- uses: actions/checkout@v3
114+
- name: Set up Python ${{ matrix.python-version }}
115+
uses: actions/setup-python@v4
116+
with:
117+
python-version: ${{ matrix.python-version }}
118+
- run: python -m pip install .[test]
119+
- run: python -m pip install django~=${{ matrix.django-version }}.0
120+
- run: python -m pytest
121+
- uses: codecov/codecov-action@v3
122+
with:
123+
flags: dj${{ matrix.django-version }}
112124

125+
pytest-extras:
126+
name: PyTest
127+
needs:
128+
- lint
129+
strategy:
130+
matrix:
131+
extras:
132+
- "celery"
133+
- "dramatiq"
134+
- "drf"
135+
- "cleanup"
136+
runs-on: ubuntu-latest
137+
steps:
138+
- uses: actions/checkout@v3
139+
- name: Set up Python ${{ matrix.python-version }}
140+
uses: actions/setup-python@v4
141+
with:
142+
python-version: 3.x
143+
- name: Install redis
144+
if: matrix.extras == 'dramatiq'
145+
run: sudo apt-get install -y redis-server
146+
- run: python -m pip install .[test,${{ matrix.extras }}]
147+
- run: python -m pytest
148+
- uses: codecov/codecov-action@v3
149+
with:
150+
flags: ${{ matrix.extras }}
113151

114152
codeql:
115153
name: CodeQL
116-
needs: [ pytest ]
154+
needs: [ dist, pytest-os, pytest-python, pytest-django, pytest-extras ]
117155
runs-on: ubuntu-latest
118156
permissions:
119157
actions: read

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,10 @@ classifiers = [
2323
"Topic :: Software Development",
2424
"Programming Language :: Python :: 3",
2525
"Programming Language :: Python :: 3 :: Only",
26-
"Programming Language :: Python :: 3.9",
26+
"Programming Language :: Python :: 3.8",
2727
"Programming Language :: Python :: 3.9",
2828
"Programming Language :: Python :: 3.10",
29+
"Programming Language :: Python :: 3.11",
2930
"Framework :: Django",
3031
"Framework :: Django :: 3.2",
3132
"Framework :: Django :: 4.0",

0 commit comments

Comments
 (0)