Skip to content

Commit 27a62e6

Browse files
lociiiauvipy
andauthored
Add Django 5.0/5.1 and Python 3.10/3.11/3.12 support (#542)
* django 5.0+ compatibility * remove unused tox.ini * update github actions, add support for django 5.0/5.1 and newer python releases * documentation * revert change to artifact upload * fix missing letter * restore and adjust tox.ini * Update docs/installation.rst --------- Co-authored-by: Asif Saif Uddin <[email protected]>
1 parent 4f2101d commit 27a62e6

File tree

5 files changed

+68
-40
lines changed

5 files changed

+68
-40
lines changed

.github/workflows/workflow.yaml

Lines changed: 33 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -30,31 +30,47 @@ jobs:
3030
strategy:
3131
fail-fast: false
3232
matrix:
33-
python-version:
33+
python:
3434
- 3.8
3535
- 3.9
3636
- "3.10"
37-
- "3.11"
38-
- "3.12"
37+
- 3.11
38+
- 3.12
3939
django:
4040
- 3.2
4141
- 4.0
4242
- 4.1
4343
- 4.2
4444
- 5.0
45+
- 5.1
4546
database:
4647
- sqlite
4748
- mysql
4849
- postgres
4950
exclude:
50-
- python-version: 3.8
51-
django: 5.0
52-
- python-version: 3.9
53-
django: 5.0
54-
- python-version: "3.11"
51+
# django 3.2
52+
- python: 3.11
5553
django: 3.2
56-
- python-version: "3.12"
54+
- python: 3.12
5755
django: 3.2
56+
# django 4.0
57+
- python: 3.11
58+
django: 4.0
59+
- python: 3.12
60+
django: 4.0
61+
# django 4.1
62+
- python: 3.12
63+
django: 4.1
64+
# django 5.0
65+
- python: 3.8
66+
django: 5.0
67+
- python: 3.9
68+
django: 5.0
69+
# django 5.1
70+
- python: 3.8
71+
django: 5.1
72+
- python: 3.9
73+
django: 5.1
5874

5975
# additional service containers to run
6076
services:
@@ -98,18 +114,18 @@ jobs:
98114
- uses: actions/checkout@v4
99115

100116
# install python
101-
- name: Set up Python ${{ matrix.python-version }}
117+
- name: Set up Python ${{ matrix.python }}
102118
uses: actions/setup-python@v5
103119
with:
104-
python-version: ${{ matrix.python-version }}
120+
python-version: ${{ matrix.python }}
105121

106122
# upgrade pip
107123
- name: Update pip
108124
run: python -m pip install --upgrade pip
109125

110126
# install environment specific dependencies
111127
- name: Install coverage
112-
run: pip install coverage>=5.3 setuptools
128+
run: pip install coverage>=7.6.0 setuptools
113129

114130
- name: Install Django 3.2
115131
if: matrix.django == 3.2
@@ -126,17 +142,19 @@ jobs:
126142
- name: Install Django 5.0
127143
if: matrix.django == 5.0
128144
run: pip install "Django>=5.0,<5.1"
145+
- name: Install Django 5.1
146+
if: matrix.django == 5.1
147+
run: pip install "Django>=5.1,<5.2"
129148
- name: Install MySQL libs
130149
if: matrix.database == 'mysql'
131-
run: pip install mysqlclient>=2.0.1 django-mysql>=3.9.0
150+
run: pip install mysqlclient>=2.2.4 django-mysql>=4.14.0
132151
- name: Install postgres libs
133152
if: matrix.database == 'postgres'
134-
run: pip install psycopg2-binary>=2.8.6
153+
run: pip install psycopg2-binary>=2.9.9
135154

136155
- name: Install Django ReST framework libraries
137156
run: pip install -U django-rest-framework rest-framework-generic-relations drf-spectacular
138157

139-
140158
# install our package
141159
- name: Install package
142160
run: pip install -e .

actstream/actions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ def action_handler(verb, **kwargs):
115115
if hasattr(verb, '_proxy____args'):
116116
verb = verb._proxy____args[0]
117117
# _args is the new attribute in Django >= 5.0
118-
if hasattr(verb, '_args'):
118+
elif hasattr(verb, '_args'):
119119
verb = verb._args[0]
120120

121121
newaction = apps.get_model('actstream', 'action')(

docs/changelog.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ Changelog
66
2.0.1
77
-----
88

9-
- Adds support for Django 5.0
9+
- Added support for Django 5.0 and 5.1
10+
- Added support for Python 3.10, 3.11 and 3.12
11+
- Updated GitHub actions
1012

1113
2.0.0
1214
-----

docs/installation.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ Make sure to pick the version of Django and django-activity-stream that supports
6060
Python
6161
******
6262

63-
* **Python 3**: 3.6 to 3.12
63+
* **Python 3**: 3.8 to 3.12
6464
* **PyPy**: 3
6565

6666
Django

tox.ini

Lines changed: 30 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
[tox]
22
envlist =
3-
py{37,38,39,310}-django32-{mysql,postgres,sqlite}
4-
py{38,39,310}-django40-{mysql,postgres,sqlite}
5-
py{38,39,310,311}-django41-{mysql,postgres,sqlite}
6-
py{38,39,310,311,312}-django42-{mysql,postgres,sqlite}
7-
py{310,311,312}-django50-{mysql,postgres,sqlite}
3+
py{38,39,310}-django32-{mysql,postgres-psycopg2,sqlite}
4+
py{38,39,310}-django40-{mysql,postgres-psycopg2,sqlite}
5+
py{38,39,310,311}-django41-{mysql,postgres-psycopg2,sqlite}
6+
py{38,39,310,311,312}-django42-{mysql,postgres-psycopg3,sqlite}
7+
py{310,311,312}-django50-{mysql,postgres-psycopg3,sqlite}
8+
py{310,311,312}-django51-{mysql,postgres-psycopg3,sqlite}
89
toxworkdir=/tmp/.tox
910

1011
[testenv]
11-
commands = python -m pytest -s --cov --cov-append actstream/ runtests/testapp runtests/testapp_nested/
12+
commands = pytest -s --cov --cov-append actstream/ runtests/testapp runtests/testapp_nested/
1213

1314
deps =
1415
django-rest-framework
@@ -18,35 +19,37 @@ deps =
1819
pytest
1920
pytest-cov
2021
pytest-django
21-
setuptools
2222
coverage>=4.5.1
2323
django32: Django>=3.2,<4.0
2424
django40: Django>=4.0,<4.1
2525
django41: Django>=4.1,<4.2
2626
django42: Django>=4.2,<5.0
2727
django50: Django>=5.0,<5.1
28+
django51: Django>=5.1,<5.2
2829
mysql: mysqlclient>=2.0.0
2930
mysql: django-mysql>=2.4.1
30-
postgres: psycopg2-binary>=2.8
31+
postgres-psycopg2: psycopg2-binary>=2.8
32+
postgres-psycopg3: psycopg-binary>=3.2
3133

3234
setenv =
3335
; GITHUB_WORKFLOW=true ; Set this to force enable mysql/postgres dbs
3436
mysql: DATABASE_ENGINE=mysql
35-
postgres: DATABASE_ENGINE=postgresql
37+
postgres-psycopg2: DATABASE_ENGINE=postgresql
38+
postgres-psycopg3: DATABASE_ENGINE=postgresql
3639

3740
; Pass this to force enable mysql/postgres dbs
38-
passenv =
39-
GITHUB_WORKFLOW
40-
MYSQL_HOST
41-
MYSQL_NAME
42-
MYSQL_USER
43-
MYSQL_PASSWORD
44-
MYSQL_PORT
45-
POSTGRES_HOST
46-
POSTGRES_NAME
47-
POSTGRES_PORT
48-
POSTGRES_USER
49-
POSTGRES_PASSWORD
41+
passenv =
42+
GITHUB_WORKFLOW
43+
MYSQL_HOST
44+
MYSQL_NAME
45+
MYSQL_USER
46+
MYSQL_PASSWORD
47+
MYSQL_PORT
48+
POSTGRES_HOST
49+
POSTGRES_NAME
50+
POSTGRES_PORT
51+
POSTGRES_USER
52+
POSTGRES_PASSWORD
5053
SQLITE_NAME
5154

5255
usedevelop = True
@@ -64,9 +67,14 @@ commands =
6467

6568
[travis:env]
6669
DJANGO =
70+
5.1: django51
71+
5.0: django50
72+
4.2: django42
73+
4.1: django41
6774
4.0: django40
6875
3.2: django32
6976
DATABASE =
7077
mysql: mysql
71-
postgresql: postgresql
78+
postgres-psycopg2: postgresql
79+
postgres-psycopg3: postgresql
7280
sqlite: sqlite

0 commit comments

Comments
 (0)