Skip to content

Commit 4ec375b

Browse files
committed
chore: add support for Python 3.11 + 3.12 and Django 4.2 + 5.2
1 parent 2dfb6e2 commit 4ec375b

File tree

18 files changed

+693
-706
lines changed

18 files changed

+693
-706
lines changed

.github/workflows/ci.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,16 @@ jobs:
2525
strategy:
2626
fail-fast: false
2727
matrix:
28-
os: [ubuntu-20.04]
29-
python-version: [3.8]
30-
toxenv: [py38-django32, quality, docs]
28+
os: [ubuntu-latest]
29+
python-version: [3.11, 3.12]
30+
toxenv: [django42, django52, quality, docs]
3131

3232
steps:
3333
- name: checkout repo
34-
uses: actions/checkout@v3
34+
uses: actions/checkout@v5
3535

3636
- name: setup python
37-
uses: actions/setup-python@v4
37+
uses: actions/setup-python@v6
3838
with:
3939
python-version: ${{ matrix.python-version }}
4040

@@ -47,7 +47,7 @@ jobs:
4747
run: tox
4848

4949
- name: Run coverage
50-
if: matrix.python-version == '3.8' && matrix.toxenv == 'py38-django32'
50+
if: matrix.python-version == '3.11' && matrix.toxenv == 'django42'
5151
uses: codecov/codecov-action@v3
5252
with:
5353
token: ${{ secrets.CODECOV_TOKEN }}

.github/workflows/pypi-publish.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,16 @@ on:
66

77
jobs:
88
push:
9-
runs-on: ubuntu-20.04
9+
runs-on: ubuntu-latest
1010

1111
steps:
1212
- name: Checkout
13-
uses: actions/checkout@v3
13+
uses: actions/checkout@v5
1414

1515
- name: setup python
16-
uses: actions/setup-python@v4
16+
uses: actions/setup-python@v6
1717
with:
18-
python-version: 3.8
18+
python-version: 3.11
1919

2020
- name: Install Dependencies
2121
run: pip install -r requirements/pip.txt

completion_aggregator/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55

66
from __future__ import absolute_import, unicode_literals
77

8-
__version__ = '4.2.0'
8+
__version__ = '4.2.1'
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Rename indexes from index_together to Meta.indexes with explicit names.
2+
3+
from django.db import migrations
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
dependencies = [
9+
('completion_aggregator', '0005_cachegroupinvalidation'),
10+
]
11+
12+
operations = [
13+
migrations.RenameIndex(
14+
model_name='aggregator',
15+
new_name='aggr_name_user_course_idx',
16+
old_fields=('user', 'aggregation_name', 'course_key'),
17+
),
18+
migrations.RenameIndex(
19+
model_name='aggregator',
20+
new_name='aggr_name_course_block_per_idx',
21+
old_fields=('course_key', 'aggregation_name', 'block_key', 'percent'),
22+
),
23+
migrations.RenameIndex(
24+
model_name='stalecompletion',
25+
new_name='stale_user_course_resolved_idx',
26+
old_fields=('username', 'course_key', 'created', 'resolved'),
27+
),
28+
]

completion_aggregator/models.py

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -259,9 +259,15 @@ class Meta:
259259
Metadata describing the Aggregator model.
260260
"""
261261

262-
index_together = [
263-
('user', 'aggregation_name', 'course_key'),
264-
('course_key', 'aggregation_name', 'block_key', 'percent'),
262+
indexes = [
263+
models.Index(
264+
fields=["user", "aggregation_name", "course_key"],
265+
name="aggr_name_user_course_idx",
266+
),
267+
models.Index(
268+
fields=["course_key", "aggregation_name", "block_key", "percent"],
269+
name="aggr_name_course_block_per_idx",
270+
),
265271
]
266272

267273
unique_together = [
@@ -319,8 +325,11 @@ class Meta:
319325
Metadata describing the StaleCompletion model.
320326
"""
321327

322-
index_together = [
323-
('username', 'course_key', 'created', 'resolved'),
328+
indexes = [
329+
models.Index(
330+
fields=["username", "course_key", "created", "resolved"],
331+
name="stale_user_course_resolved_idx",
332+
),
324333
]
325334

326335
def __str__(self):

0 commit comments

Comments
 (0)